我已经开始学习Qbasic。对于初学者练习,我从一个简单的文本游戏开始。一座山位于“北”,当您键入“北”时,控制台应在按 后打印“山” Enter。但是,当键入并Enter按下“north”时,代码不会被执行。这只是初学者的错误吗?我应该按不同的东西Enter吗?
这是代码:
CLS
PRINT "There is a mountain to the North"
PRINT "There is a cactus to the East"
PRINT "There is a river to the South"
PRINT "There is a shack to the East"
PRINT " "
INPUT "Type a direction:", direction$
IF direction$ = "north" THEN PRINT "Mountain"
以及repl.it的输出:
QBasic (qb.js)
Copyright (c) 2010 Steve Hanov
:
There is a mountain to the North
There is a cactus to the East
There is a river to the South
There is a shack to the East
:
Type a direction: north
: