高低游戏(PERL编码) [英] High Low Game (PERL Coding)

查看:88
本文介绍了高低游戏(PERL编码)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个游戏相当容易,你必须选择你认为卡片要么更高还是更低,或者在两张图片的中间,但我有一点小故障。这是我的代码,有时它可以工作,但当卡片像5和6时,我选择它更高,出现的图像是8但它说我失去了那是我有问题和继承人的网站: http://ctech.smccme.edu/~rhodge/cw/hilow/hilow.pl

< span class =codeLinkonclick =Blur(this,this.parentNode.parentNode,getChildren(this),true);>展开 | 选择 | Wrap | 行号

解决方案

您是否考虑过打印每个转弯的所有值,看看每只手的每张牌是什么,以确定你出错的地方?


例如打印:

展开 | 选择 | Wrap | 行号


最后我希望第一页上的两个图像转到第二页但不能更改并且随机卡 ; card3"处于中间。


听起来很酷,但首先我们应该尝试调试你的逻辑为什么不正确:)


-Frinny

Well this game is fairly easy you have to chose what you think the card is going to be either higher or lower or in the middle of the two images but im having a little bit of a glitch. Here is my code and sometimes it works but when the cards are like say 5 and 6 and i chose it to be higher and the image that comes up is a 8 but it says i lose thats what im having problems with and heres the site: http://ctech.smccme.edu/~rhodge/cw/hilow/hilow.pl

Expand|Select|Wrap|Line Numbers

解决方案

Have you considered printing all of the values for each turn to see what each card is for each hand to try and determine where you''re going wrong?

For example print:

Expand|Select|Wrap|Line Numbers


Well eventually i want the two images on the first page to go over to the second page but not change and have the random card "card3" to be in the middle.


Sounds cool but first we should try to debug why your logic isn''t correct :)

-Frinny


这篇关于高低游戏(PERL编码)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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