I'll go ahead and show you what I'm trying to achieve.
Here's an example of a normal way.
Code: Select all
default hour = 0
if hour == 1:
call screen room_1_screen
elif hour == 2:
call screen room_2_screen
elif hour == 3:
call screen room_3_screen
elif hour == 4:
call screen room_4_screenIf I were to have up to 50 hours, writing that will require 50 if statements which sounds inefficient.
Is it possible to turn all that into one if statement?
I'd assume I'd have to create a function. And I'd call the function to make the hour pass and by doing that, "room_x_screen", x would go up as well.
I don't know where to start!
Sorry for the hideous explanation..