I'm writing a simple script for a slot machine game just after a tutorial on codeacademy.com I would like to print things in the same place of the first print not everything under the previous. Is this possible?
In my script i print out a board like this:
slot = []
for row in range(9):
slot.append(['[]'] * 9)
def print_slot(slot):
for element in slot:
print(" ".join(element))
print_slot(slot)
after this board i don't want another board for every action but i would like actions to happen in the board or, even better something like the output you get when you rerun the code.
how can achieve this? something different from print? or maybe is the python console thet work like this, a complete program can be different. (real beginner here)
this is my output before the user input:
##- simple slotmachine -##
##- five identical win -##
##- u start with 100cr -##
[] [] [] [] [] [] [] [] []
[] [] [] [] [] [] [] [] []
[] [] [] [] [] [] [] [] []
[] [] [] [] [] [] [] [] []
[] [] [] [] [] [] [] [] []
[] [] [] [] [] [] [] [] []
[] [] [] [] [] [] [] [] []
[] [] [] [] [] [] [] [] []
[] [] [] [] [] [] [] [] []
##- simple slotmachine -##
##- five identical win -##
##- space enter 2 play -##
here after the user input:
##- simple slotmachine -##
##- five identical win -##
##- u start with 100cr -##
[] [] [] [] [] [] [] [] []
[] [] [] [] [] [] [] [] []
[] [] [] [] [] [] [] [] []
[] [] [] [] [] [] [] [] []
[] [] [] [] [] [] [] [] []
[] [] [] [] [] [] [] [] []
[] [] [] [] [] [] [] [] []
[] [] [] [] [] [] [] [] []
[] [] [] [] [] [] [] [] []
##- simple slotmachine -##
##- five identical win -##
##- space enter 2 play -##
[] [] [] [] [] [] [] [] []
[] [] [] [] [] [] [] [] []
[] [] [] [] [] [] [] [] []
[] [] [] [] [] [] [] [] []
[] [] 0 4 5 4 5 [] []
[] [] [] [] [] [] [] [] []
[] [] [] [] [] [] [] [] []
[] [] [] [] [] [] [] [] []
[] [] [] [] [] [] [] [] []
as you can see the previous board is still visible, i would like to substitute a new board at every change.