[SOLVED] Trying to create a simple math minigame. Strange list index out of range error?

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Message
Author
User avatar
Remix
Miko-Class Veteran
Posts: 886
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I cannot draw very well)
Projects: An un-named 3d anime based trainer game
Contact:

Re: Trying to create a simple math minigame. Strange list index out of range error?

#16 Post by Remix » Fri Jul 13, 2018 4:52 am

or perhaps:

chess_answer_list.append( (str(correct_value), True))
others = renpy.python.rng.sample( [k for k in range(-7,0) ]+[ k for k in range(1,8) ], 4 ) ## <-- get 4 unique choices from the list (without zeros)
for k in others:
chess_answer_list.append( (str(correct_value + k), False))

Post Reply

Who is online

Users browsing this forum: Mikomi