So i am creating a slot machine as a little project for fun and learning, I was wondering if there was a way to replace multiple lines of text in the console. I have it replacing one line but I would like to be able to print three lines then the top be replaced with the middle then middle with the bottom and continue untill the loop is finished. I am still a beginner so if there are any tips you have for me and or please feel free to critique my code. Thank you
import sys
import time
from random import randint
slot_possibilities = [" Star "," Moon "," Sun! "," Monkey"]
wait_time = 15
print "--------------------------------"
print "|--------Monkey-----Slots------|"
print "|------------------------------|"
while wait_time != 0 :
x = randint(0,3)
y = randint(0,3)
z = randint(0,3)
sys.stdout.write("\r|" + slot_possibilities[x] + " || " + slot_possibilities[y] + " || "+ slot_possibilities[z] + " |")
time.sleep(1)
wait_time -= 1
print
print