When playing games, the letters NOW LOADING
are in the lower right corner,
I think there are some who move from left to right and some characters are bigger, but that's it.
I'm sorry if you don't understand.
The code is written in python3. It's a poor code, but please forgive me ...
You can use a carriage return (\ r) to override the terminal output.
For example, if you want to create an animation where the hyphen -
moves to the right every 0.5 seconds, the code would look like this:
sample.py
import time
for i in range(0, 9):
print('\r{0} {1}%'.format(' ' * i, '-'), end='')
time.sleep(0.5)
move.py
import time
import os
def main():
#Setting the initial value for looping
num = 1
#Clock setting
clock = 0.5
os.system('cls')
print(" ")
#Code that moves characters from here
while num != 0:
str = 'N O W L O A D I N G'
space = ' ' * num
count = num - 20
if num < 20:
time.sleep(clock)
#The depiction part of the character. Moves sideways as the value of num increases
print('\r{0} {1}'.format(space, str), end='')
num += 1
else:
#After moving 20 full-width spaces to the right, go out to the right and in from the left
if count <= len(str):
time.sleep(clock)
print('\r{0} {1} {2}'.format(str[len(str) - count:], ' ' * (num - count), str[:(le`n(str) - count)]), end='')
num += 1
else:
num = 1
if __name__ == "__main__":
main()
I don't think it will be a useful program, but with the package installer I believe it's fashionable if the letters ʻINSTALLING` move.
I wish I could move the original characters and ASCII art during the installation of ʻaptor
yum`!
I think.
I was originally planning to make the following code for fish to swim ...
Sunfish swims on a small LCD on a CD player while in a friend's car There is a mode, and I thought it would be nice, so I made it myself. However, I think that the code is not so cool, and the fish unexpectedly I couldn't display it cutely, so I posted it as a bonus ... Mi ((((°>>>)
fish.py
import time
import os
def main():
#Setting the initial value for looping
num = 1
#Clock setting
clock = float(input('Please enter the speed([early]1>>>5>>>10[slow])')) / 10
os.system('cls')
print(" ")
#Fish swim from here
while num != 0:
if num < 11:
time.sleep(clock)
space = ' ' * num
#The part of the depiction of the fish. Moves sideways as the value of num increases
print('\r{0} {1} {2} {3} {4} {5}'.format(space + ' ', '△\n', space, 'Mi((((°>\n', space + ' ', 'Re' + '\033[2A'), end='')
num += 1
#Part for moving fins
time.sleep(clock)
print('\r{0} {1} {2} {3} {4} {5}'.format(space + ' ', '△\n', space, 'Ξ((((°>\n', space + ' ', 'Re' + '\033[2A'), end='')
else:
#After moving 10 full-width spaces to the right, the part that fades out to the right
time.sleep(clock)
space = ' ' * num
print('\r{0} {1} {2} {3} {4} {5}'.format(space + ' ', '△\n', space, 'Mi(((( \n', space + ' ', 'Re' + '\033[2A'), end='')
time.sleep(clock)
print('\r{0} {1} {2} {3} {4} {5}'.format(space + ' ', '△\n', space, ' Ξ(((( \n', space + ' ', 'Re' + '\033[2A'), end='')
time.sleep(clock)
print('\r{0} {1} {2} {3} {4} {5}'.format(space + ' ', '\n', space, 'Mi(( \n', space + ' ', '' + '\033[2A'), end='')
time.sleep(clock)
print('\r{0} {1} {2} {3} {4} {5}'.format(space + ' ', '\n', space, ' Ξ(( \n', space + ' ', '' + '\033[2A'), end='')
time.sleep(clock)
print('\r{0} {1} {2} {3} {4} {5}'.format(space + ' ', '\n', space, ' \n', space + ' ', '' + '\033[2A'), end='')
#If you fade out to the right, the part that fades in from the left
time.sleep(clock * 2)
space = ' ' * 20
print('\r{0} {1} {2} {3} {4} {5}'.format(space , '\n', '°>', space + '\n', space, '\033[2A'), end='')
time.sleep(clock * 2)
print('\r{0} {1} {2} {3} {4} {5}'.format(' △', space + '\n', '(((°>', space + '\n', space, '\033[2A'), end='')
time.sleep(clock * 2)
print('\r{0} {1} {2} {3} {4} {5}'.format(' △', space + '\n', 'Ξ((((°>', space + '\n Les' , space , '\033[2A'), end='')
time.sleep(clock)
print('\r{0} {1} {2} {3} {4} {5}'.format(' △', space + '\n', 'Mi((((°>', space + '\n Les' , space , '\033[2A'), end='')
num = 1
if __name__ == "__main__":
main()
If you like, please copy and move it!