Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/binghuan/tetris
Coding quest from "BaseCase"
https://github.com/binghuan/tetris
assignment game javascript take-home-test tetris webapp
Last synced: 13 days ago
JSON representation
Coding quest from "BaseCase"
- Host: GitHub
- URL: https://github.com/binghuan/tetris
- Owner: binghuan
- Created: 2016-03-22T14:45:06.000Z (almost 9 years ago)
- Default Branch: gh-pages
- Last Pushed: 2018-09-03T08:09:30.000Z (over 6 years ago)
- Last Synced: 2023-10-20T18:15:22.030Z (about 1 year ago)
- Topics: assignment, game, javascript, take-home-test, tetris, webapp
- Language: JavaScript
- Homepage: http://studiobinghuan.blogspot.tw/2016/03/tetris.html?view=flipcard
- Size: 4.46 MB
- Stars: 1
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Tetris
My blog:
http://studiobinghuan.blogspot.tw/2016/03/tetris.html?view=flipcardlink to launch the web app: http://binghuan.github.io/tetris/
#### There are 5 different pieces in this version of Tetris
and they fall down a 20x20 tetris board:
--------------------------------------------------------------------------------
The game starts with a random piece appearing at the top of the board. The user is then prompted to make a move:
• (return): move piece left
• (return): move piece right
• (return): rotate piece counter clockwise
• (return): rotate piece clockwiseIf the move the user selects is valid, then it is executed and the screen redrawn (you can use printf()/cout/System.out.println(), etc to redraw the entire board).
If the action is not valid, then the user is again prompted to enter a valid move. Note that the game only updates after the user has entered a valid action.
A valid move is defined thus: The piece is altered as per the user's input, and then displaced by 1 row downwards.
If the piece, drawn at its new location, is not outside the bounds of the board, and does not overlap any pieces that previously fell, then the move is valid.
If the piece's new position is such that it allows no valid move, then a new piece appears along the top of the board, randomly positioned along the x-axis.
If this new piece happens offer no valid move, then the game is over and the program exits. Good Luck!
Coding quest from "BaseCase"