Another Psuedocode Implementation Question?
显示 更早的评论
Hello there. I have another psuedocode problem. The following photo shows the section of the psuedocode that has me stumbled. The thing is that when I try to execute this part of the entire psuedocode, it says that the gameOn function is undefined. Why is this? Can anyone help out?
Here's my attempted psuedocode implementation:
while gameOn == true
if turn < 0
[r,c] = getmove(G,-1);


回答(1 个)
Walter Roberson
2017-11-2
0 个投票
You failed to do steps 4 and 6 and 7. gameOn is defined in step 6.
4 个评论
Matt Amador
2017-11-2
编辑:Matt Amador
2017-11-2
Walter Roberson
2017-11-2
You set gameon to true, but you compare gameOn to true.
Matt Amador
2017-11-2
Walter Roberson
2017-11-2
As long as you make sure you initialize gameOn (upper-case O) instead of gameon (lower-case O) either one is fine.
类别
在 帮助中心 和 File Exchange 中查找有关 Entering Commands 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
