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

2048有bug #14

Open
Natsuki-Min opened this issue Sep 7, 2024 · 0 comments
Open

2048有bug #14

Natsuki-Min opened this issue Sep 7, 2024 · 0 comments

Comments

@Natsuki-Min
Copy link

你使用can标志位确定是否有过移动,但是循环开始时can不一定有值,开局不出问题是因为连续的0也算作can,但是到后面没有can时,不移动只按按键也会生成新的数字,但是又不能粗暴的循环开始就给can赋值,否则没法生成第一个数字
我给出我的解决办法,因为air不可能超过16而且只有开局是16,那么可以这样:循环开始can赋值为0x10,move里面移动后can赋值为0x0f,最后进行continue判断时使用air & can进行判断,这样便可万无一失
另外游玩游戏时我有一个想法,现在2048都是随机出数字,有没有可能做出一个算法出数字尽可能降低玩家的胜率?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant