Hunt the Wumpus: Difference between revisions
m
→{{header|Julia}}
Line 183:
"""
function queryprompt(query, choices, choicetxt="")
carr = map(x -> uppercase(strip(string(x))), collect(choices))
while true
print(query, " ", choicetxt == "" ? carr : choicetxt, ": ")
choice = uppercase(strip(readline(stdin)))
if choice in carr
Line 283:
arrowroom = playerroom
for i in 1:distance
choices[i] = parse(Int, queryprompt("ROOM #",
while i > 2 && choices[i] == choices[i-2]
println("ARROWS AREN'T THAT CROOKED - TRY ANOTHER ROOM")
choices[i] = parse(Int, queryprompt("ROOM #",
end
arrowroom = choices[i]
|