Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 7742

Python • Re: A Basic Text Adventure ..

$
0
0
One way (avoiding a major re-write) is to add code after the move to look for n,s,e,w as single character, then expand to the full command
e.g.

Code:

    move = move.lower().split()        if move[0] == 'e':        move=['go','east']    if move[0] == 'w':        move=['go','west'][code]

Statistics: Posted by neilgl — Mon May 11, 2026 9:11 pm



Viewing all articles
Browse latest Browse all 7742

Latest Images

Trending Articles



Latest Images