Code: Select all
label practice:
$ i = 0
$ right_answer = "DLRLRL"
$ input_answer = ""
$ end = len(right_answer)
"Type in %(right_answer)s."
##input code
label check:
for i in range(end):
if input_answer == right_answer[:end-i]:
$ good = True
if input_answer == right_answer:
jump win
if !good:
"FAILURE."
Code: Select all
if input_answer == "D":
$ good = True
elif input_answer == "DL":
$ good = True
After a bit of research into Python strings and for-loops(which I have never touched before); I wrote the above, but it keeps returning this error:
Code: Select all
On line 36 of C:\Users\Curry\Documents\renpy projects\PRACTICE/game/music.rpy: expected statement.
for i in range(end):
^