二十一点 [英] blackjack

查看:84
本文介绍了二十一点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在制作黑色插孔代码,但我卡住了,我已经开始了,但是由于理由gettin错误,我似乎无法修复,下面是我开始的代码。

i am making black jack code, but i am stuck, i have made start, but for reason gettin errors, which i dont seem be able to fix, below is my code wht i started.

展开 | 选择 | Wrap | 行号

推荐答案

random.randint将两个数字作为参数并返回一个中间的随机数他们。我认为你正在寻找的是random.choice,它从列表中选择一个随机项:
random.randint takes two numbers as arguments and returns a random number that''s between them. I think what you''re looking for is random.choice, which selects a random item from a list:
展开 | 选择 | Wrap | 行号


好的,谢谢不,我没有错误,但我怎么会显示玩家的手,电脑手。


下面是代码现在的样子,但是,必须保持代码恭喜,因为那个想法会显示出来。


感谢您的帮助

ok thanks no i dont have no erros,, but how would i display the players hand, computers hand.

below is how the code looks now, but, would have to keep the code commeted out, as that think would display the, hands.

thanks for help

展开 | 选择 | Wrap | 行号


感谢您在boxfish之前的帮助,我能够,继续,并完成我的二十一点代码。但是,我遇到了一个小问题,我的命中功能似乎不起作用。你知道我怎么解决这个问题。还有,有谁知道我怎样才能在我的程序中重新运行代码?

thanks for ur help before "boxfish" , i was able, proceed and pretty much complete my blackjack code. however, i have come across a minor problem, my hit function does not seem to work. do you know how i can fix this. also, does anyone know how i can fit a re-run code into my program too?

展开 | 选择 < span class =codeDivider> | Wrap | 行号


这篇关于二十一点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆