I am doing a bit of python on my casio calculator and i have run into a little problem, the version of python that my calculator uses is microPython 1.9.4. I am not able to use import time
as the time module isn't in this version. Any help would be greatly appreciated.
edit: changed version to 1.9.4
My Code (the time.sleep() is near the bottom):
import time
barriers = []
playerPosition = [11, 1]
playTime = 0
while playTime <= 0:
line = 6
while line >= 1:
if line > 2:
if playerPosition[1] != line:
print(" ")
else:
currentLine = ""
xPosition = 1
while xPosition < playerPosition[0]:
currentLine = currentLine + " "
xPosition = 1 + xPosition
currentLine = currentLine + "|"
xPosition = 1 + xPosition
while xPosition < 21:
currentLine = currentLine + " "
xPosition = 1 + xPosition
else:
obstructions = []
obstructions.clear()
if playerPosition[1] == line:
obstructions.append(playerPosition[0])
for barrier in barriers:
obstructions.append(barrier)
obstructions.sort()
currentLine = ""
nextObstruction = 0
xPosition = 1
while xPosition <= 21:
try:
if xPosition != obstructions[nextObstruction]:
currentLine = currentLine + " "
else:
currentLine = currentLine + "|"
nextObstruction = 1 + nextObstruction
except:
currentLine = currentLine + " "
xPosition = 1 + xPosition
print(currentLine)
line = line - 1
barrierID = 0
while barrierID < len(barriers):
if barriers[barrierID] > 1:
barriers[barrierID] = barriers[barrierID] - 1
else:
barriers.remove(barrierID)
time.sleep(0.5)
playTime = 1 + playTime