您好,我有一个非常烦人的问题。前几天,我和一位朋友制作了一个创建Dungons and Dragons角色扮演角色的节目,经过大约一天的工作,它正常运作。只有我们发现它并不完全同意游戏规则,而且它有点瑕疵,所以我决定写一个新的。唯一的问题?大多数时候,虽然程序应该输出六个数字,但它只给我2到5之间的任何东西。那个伟大的极客之一是否发现了这个问题呢?请告诉我,这将是一个很大的帮助! :) 所以这里是临时脚本:
Hello, I have a problem that''s hugely annoying. The other day, me and a friend made a program for creating a Dungons and Dragons roleplaying character, and after about a day of work, it was working properly. Only for us to find that it did not fully agree with the rules of the game, and it was slightly flawed, so I decided to write a new one. Only problem? Most of the time, while the program should give an output of six numbers, it only gives me anything between two and five. So does one of the great geek spot the problem? Please tell me, it would be a great help! :) So here''s the temporary script:
展开 | 选择 | 换行 | 行号 推荐答案删除几行代码后,意识到我不知道你的代码中发生了什么。 我不知道规则那场比赛所以我放弃了。 但是在这段代码中有很多奇怪的事情发生。并且它中还有很多死代码。就我所见,第102行之后没有代码会执行。 但请不要使用空格缩进。使用标签。或至少3+空格,然后我至少使用了find / replace。 After removing several lines of code a realized that i culd not make sense of whats happening in youre code. And i do not know the rules of that game so i gave up. But there is a lot of strange things going on in that pace of code. And there is a lot of dead code in it aswell. No code after line 102 will ever be executet as far as i can see. But please, Dont use space to indent. Use tab. Or atleast 3+ spaces, Then i culd atleast have used find/replace.
删除几行代码后,意识到我已经知道了不知道你的代码中发生了什么。 我不知道那场比赛的规则所以我放弃了。 但是在这段代码中有很多奇怪的事情发生。并且它中还有很多死代码。就我所见,第102行之后没有代码会执行。 但请不要使用空格缩进。使用标签。或者至少3+个空格,然后我至少使用了find / replace。 After removing several lines of code a realized that i culd not make sense of whats happening in youre code. And i do not know the rules of that game so i gave up. But there is a lot of strange things going on in that pace of code. And there is a lot of dead code in it aswell. No code after line 102 will ever be executet as far as i can see. But please, Dont use space to indent. Use tab. Or atleast 3+ spaces, Then i culd atleast have used find/replace.
谢谢你,Smygis,你的意见。但是,标签不是必需的。每个缩进4个空格是大多数Python编辑使用的。
Thank you, Smygis, for your input. However, tabs are not necessary. 4 spaces per indent is what most Python editors use.
我不知道你在尝试用大量的'if'语句做什么。如果我们能够找到您的规则,我们或许可以提出建议。这将打印六个数字: I cannot tell what your are trying to do with the large number of ''if'' statements. If we could find out what your rules are, we might be able to make a suggestion. This will print six numbers: 展开 | 选择 | Wrap | 行号
更多推荐
再次出现一个新的骰子问题,以及python中出现故障的脚本。
发布评论