Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0e3006b

Browse files
committed
homework week 5
1 parent 4dbe0a6 commit 0e3006b

File tree

1 file changed

+35
-18
lines changed

1 file changed

+35
-18
lines changed

Week5/MAKEME.md

Lines changed: 35 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -62,21 +62,38 @@ Don't cheat - but if you get stuck ... http://stackoverflow.com/questions/750486
6262
```
6363

6464

65-
## TODO:
66-
67-
Create a game!
68-
* The game uses the Reqres API as input (use $.getJSON to load data): http://reqres.in.
69-
* The game should have user interaction
70-
* Have at least 7 different functions
71-
* Have at least one callback function
72-
* Use objects (this can also be a source of inspiration for what kind of game to make)
73-
* The game has to run on an HTML page (live on Github using pages.github.io using this tutorial https://pages.github.com/ and share your link on Trello)
74-
* All the code needs to be commented
75-
* The Github page should have a README.md describing how the game/code works and a whishlist of features to be added in the future
76-
77-
- Create at least 1 issue (bug / feature / code improvement) on another students github game repository. Do this in pairs.
78-
- solve the issue proposed by another student in your github game repo. More info [here](https://hackyourfuture.slack.com/files/michahell/F31BX1XT6/Merging_a_local_branch_into_master)
79-
- use a local non-tracking branch and merge into master
80-
- or use a local tracking branch tracking your master, and push directly to master (slightly harder / more advanced)
81-
82-
[Example](https://www.w3schools.com/graphics/game_intro.asp) of a simple js game on w3schools
65+
Rewrite to Async:
66+
```
67+
1.
68+
69+
var sum = calculateSum(2, 6);
70+
console.log(sum);
71+
72+
2.
73+
74+
var results = $.getJSON('http://myapi.com');
75+
showResults(results);
76+
77+
3.
78+
79+
var sum = calculateSum(2, 6);
80+
if (sum > 8) {
81+
console.log('larger than 8');
82+
}
83+
84+
4.
85+
86+
var data = $.getJSON('http://myapi.com');
87+
data = data.map(function (x) { return x * 8; });
88+
89+
writeDataToFile(data);
90+
```
91+
92+
## TODO !!!
93+
1. Choose two "GET" API endpoints from http://reqres.in
94+
2. Use $.getJSON to load data from those two endpoints
95+
3. Display the data on your web page.
96+
4. It should not matter which endpoint is loaded first, the data should *always* look the same (you can add "?delay=<num>" after the endpoint to simulate a delay).
97+
98+
- Create at least 1 issue (bug / feature / code improvement) on another students github repository. Do this in pairs.
99+
- solve the issue proposed by another student in your github repo. More info [here](https://hackyourfuture.slack.com/files/michahell/F31BX1XT6/Merging_a_local_branch_into_master)

0 commit comments

Comments
 (0)