- Rust Programming By Example
- Guillaume Gomez Antoni Boucher
- 150字
- 2021-07-02 19:13:08
Writing Tetris
First, let's review the Tetris rules (just in case):
- There is a grid with a height of 16 blocks and a width of 10 blocks.
- You have seven different tetrimino (a tetris piece) that are all composed of four blocks.
- A new tetrimino appears at the top of the game's grid every time the previous one cannot descend any more (because the block below is already occupied or because you've reached the game's floor).
- The game is over when a new tetrimino cannot appear anymore (because there is already a tetrimino at the top of the grid).
- Every time a line is full (all blocks are occupied by a tetrimino part), it disappears and all lines above descend by one line.
Now that we all agree on the game rules, let's see how to actually write those mechanisms.
First, we need to actually create those tetriminos.
推薦閱讀
- 北大中文系第一課
- 博物館新視覺:博物館管理叢書
- 現(xiàn)代圖書館全面質(zhì)量管理與創(chuàng)新服務(wù)研究
- 知中16·西南聯(lián)大的遺產(chǎn)
- 博物館與文化浙江建設(shè):浙江省博物館學(xué)會(huì)2017年學(xué)術(shù)研討會(huì)論文集
- 國(guó)學(xué)研究文萃·文學(xué)卷
- 計(jì)算社會(huì)學(xué)
- 讓文明得到更好的傳承:公共文化服務(wù)體系中公共檔案館發(fā)展戰(zhàn)略
- 李一氓文存(第一卷):存在集·存在集續(xù)編
- 圖書館服務(wù)均等化與資源共享(上冊(cè))
- “秦陵杯”講解員職業(yè)技能大賽講解詞匯編
- 抗戰(zhàn)時(shí)期中國(guó)圖書館界研究
- 一本書的圖書館之旅:圖書館閱讀推廣十五年
- 北京大學(xué)中國(guó)古文獻(xiàn)研究中心集刊·第十七輯
- 高校科技查新與圖書館工作研究