Ask coding questions

← Back to all posts
making the / turn in circles
h
RmyDahGod (19)

Yo guys. So in many codes, i’ve seen the / turning around itself, and looking pretty cool.
I just tried the print command, but idk how to get the slash to turn.
the code is in python.

Answered by Coder100 (16823) [earned 5 cycles]
View Answer
Comments
hotnewtop
Coder100 (16823)

Try this:

import time

while True:
  print('\x1b[0;0H\\')
  time.sleep(0.1)
  print('\x1b[0;0H|')
  time.sleep(0.1)
  print('\x1b[0;0H/')
  time.sleep(0.1)
  print('\x1b[0;0H-')
  time.sleep(0.1)

https://repl.it/@Coder100/WeakSnoopySection#py.py

Coder100 (16823)

np! mark as correct answer? @RmyDahGod

SixBeeps (5044)

Usually you'd put the cursor to that position, then print the following in sequence:

/ - \ |