Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

编程游戏 Human Resource Machine Level 1-42 通关 (iOS) #1

Open
tianyuan opened this issue Feb 23, 2023 · 1 comment
Open

编程游戏 Human Resource Machine Level 1-42 通关 (iOS) #1

tianyuan opened this issue Feb 23, 2023 · 1 comment
Labels
2023 gamification Gamification is the solution for boredom.

Comments

@tianyuan
Copy link
Owner

tianyuan commented Feb 23, 2023

yihong0618 在他的一些转码分享里提到了这款"Human Resource Machine"游戏,我也花了7刀小玩了一下,虽然都是“goto",但是还蛮有趣的,开个issue,后续可能会继续更新.

开始做游戏竞品分析(运营策划),正好玩了一款特别有趣的游戏叫《Human Resource Machine》,那时候还不咋懂程序是什么,硬着头皮不看攻略的最后打通了,至今记得最后一关是用“汇编”写一个冒泡排序,足足花了我一个周末,至今如果有朋友问我怎么写程序,我都第一时间推荐这游戏

过了20关,用了5个小时,都是双灯,没有觉得难。我以为size和speed必须在一个solution里面同时满足,于是做了很多无用功😿 。事实上,这俩是trade-off. 而且大部分这俩会只取其一,你可以写两个版本,一个完成size,一个完成speed. 关于speed,一个loop里面能做的事情越多,就会减少运算次数(通过减少loop的执行次数).

看了一些知乎的评价,貌似这个游戏是基于汇编的。我没学过汇编~~ 感觉就是loop, if, 加 goto. 有人说这个是模拟计算机的输入,寄存,和输出,最近在一本“计算机是怎么工作的”的书里读到了这些概念(10年前学的计算机原理都忘了,那时候一上来就被二进制整不会了), 感觉知识有了连结,好玩~~~

---- 更新,玩到了30+关,还好还好。估计大”boss"在最后。

---- 更新,通关了~ 以为后面会很难,没想到并没有。最后一关是个sorting,直接用双指针很快就弄出来了。

基本上一直维持在力扣“容易”的水平,最高难度就是最后的sorting.

结局彩蛋有点意思,被computer替代的人类,就如typist这个职业的消失一般。干了42年,白发苍苍👩‍🦳,最后退休(或者理解为被machine layoff).

@tianyuan tianyuan added gamification Gamification is the solution for boredom. cn and removed bug labels Feb 23, 2023
@tianyuan tianyuan changed the title 编程游戏 Human Resource Machine Level 1-10 (iOS) 编程游戏 Human Resource Machine Level 1-20 (iOS) Feb 24, 2023
@tianyuan tianyuan changed the title 编程游戏 Human Resource Machine Level 1-20 (iOS) 编程游戏 Human Resource Machine Level 1-30 (iOS) Feb 25, 2023
@tianyuan tianyuan changed the title 编程游戏 Human Resource Machine Level 1-30 (iOS) 编程游戏 Human Resource Machine Level 1-42 通关 (iOS) Mar 1, 2023
@tianyuan
Copy link
Owner Author

玩过之后,再去读程序是如何运行的这本书,真的能理解CPU的架构。

@tianyuan tianyuan added the 2023 label Jan 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2023 gamification Gamification is the solution for boredom.
Projects
None yet
Development

No branches or pull requests

1 participant