CareerCup Old cell-phones game "snake"
来源:互联网 发布:笔记本电脑选择知乎 编辑:程序博客网 时间:2024/05/04 13:45
Implement in OOP the old cell-phones game "snake". Implement the function "MoveUp". Follow up: how would you reduce space complexity?
--------------------------------------------------
if it's really about the space, you can just store coordinates of the head and the rest of the snake store as a linked list containing the 2bit flag: UP/DOWN/LEFT/RIGHT
then, when you move the head up, you need to calculate a new position of each "limb" of the snake starting from the head and going down to the tail. Then if it happens that the new position of the head coincides with that of one of the limbs, game is over..Otherwise, you just update 2bit flags in your linked list according to new positions
- CareerCup Old cell-phones game "snake"
- Halo Game to Hit Cell Phones 2005.11.23
- Snake Game
- snake game
- Game: snake
- Snake Game-贪吃蛇
- 20100125 Lecture3 Snake Game
- 353. Design Snake Game
- LeetCode 353. Design Snake Game
- POJ_1694_An Old Stone Game
- www.onthesource.com/cell-phones-mobile-phones/ Wholesale
- 50 Cell Phones Increase Traffic, Pedestrian Fatalities
- A EFI shell app snake game
- Snake Game——贪吃蛇
- Snake Game---贪吃蛇WINAPI版
- [Small Game]Gluttonous Snake-V1.0
- [Small Game]Gluttonous Snake-V2.0
- [Small Game]Gluttonous Snake-V2.2
- 【电子新发现】仿真软件LTspice和小体积贴片式升压变压器
- 【风宇冲】Unity3D教程宝典之路径搜寻:第二讲SimplePath详细教程
- 九度OJ 1551 切蛋糕 计算几何+二分
- 关于计算机专业读研的看法(参考)
- 理解ORACLE数据库字符集
- CareerCup Old cell-phones game "snake"
- 北风网:学完JAVA后的就业方向
- 【OpenCV入门教程之四】 ROI区域图像叠加&初级图像混合 全剖析
- yum源导入KEY值----warning: rpmts_HdrFromFdno: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
- 归并排序--Java
- U-boot分析第0章------------------ 编译烧写
- Unity3D 主角面朝方向一定区域内对象角度计算
- 一位ACMer过来人的心得
- JAVA环境搭建