amp-bind: Turing machine and game examples#7742
amp-bind: Turing machine and game examples#7742dreamofabear merged 6 commits intoampproject:masterfrom
Conversation
3dc4583 to
b661a30
Compare
examples/bind/game.amp.html
Outdated
| (G.grid[0][0] != G.grid[0][1] && G.grid[1][0] != G.grid[1][1] && G.grid[0][0] != G.grid[1][0] && G.grid[0][1] != G.grid[1][1]) && | ||
| (G.grid[0][0] > 0 && G.grid[0][1] > 0 && G.grid[1][0] > 0 && G.grid[1][1] > 0) | ||
| ) ? 'lose' : 'hidden'"> | ||
| You <span [text]="(G.grid[0][0] + G.grid[0][1] + G.grid[1][0] + G.grid[1][1] >= 30) ? 'WON' : 'LOST'"></span>! |
There was a problem hiding this comment.
Just curious, how often can you get to 30?
There was a problem hiding this comment.
Pretty easily. The 2x2 size makes the game almost trivial.
kmh287
left a comment
There was a problem hiding this comment.
Looks good. Just a few comments.
examples/bind/game.amp.html
Outdated
| <br> | ||
|
|
||
| <!-- | ||
| cases for RIGHT: |
There was a problem hiding this comment.
Move the code for RIGHT to right below this. Maybe consider writing this out for the other three cases as well, just to make this easier to read. Though, I think writing one more just for UP or DOWN would probably be sufficient.
examples/bind/game.amp.html
Outdated
| ], | ||
| 'spawnChance': G.spawnChance | ||
| } | ||
| })">DOWN</button> |
There was a problem hiding this comment.
How would you feel about arranging the buttons into a natural UP, RIGHT, DOWN, LEFT shape instead of having them in a line?
|
|
||
| <h3 [text]="'Count: ' + (count || 0)">Count: 0</h3> | ||
|
|
||
| <!-- |
There was a problem hiding this comment.
Do you intend to have this comment block in here?
There was a problem hiding this comment.
Yea, just some things I noticed when writing this sample. Planning to turn them into an issue after some more thought.
| @@ -0,0 +1,154 @@ | |||
| <!doctype html> | |||
There was a problem hiding this comment.
How would you feel about adding a high-level explanation of what's supposed to happen in this demo in a comment.
There was a problem hiding this comment.
Added a <p> describing this example below the heading.
508f0fa to
e2975d6
Compare
* initial commit for turing machine example * initial commit for bind game example * flip chance conditional, tweak generation logic * add win/loss message and new game button * kevin's comments * prettify games with mdl
* initial commit for turing machine example * initial commit for bind game example * flip chance conditional, tweak generation logic * add win/loss message and new game button * kevin's comments * prettify games with mdl
Fixes #7820. Requires #7797.
examples/bind/turing.amp.htmlis a Turing machine that counts up to 8 bitsexamples/bind/game.amp.htmlis a 2x2 clone of game 2048Note that some expressions in
game.amp.htmlare not simplified for the sake of readability./to @kmh287