代码:
import time
words = input('Please input the words you want to say!:')
for item in words.split():
print('\n'.join([''.join([(item[(x-y) % len(item)] if ((x*0.05)**2+(y*0.1)**2-1)**3-(x*0.05)**2*(y*0.1)**3 <= 0 else ' ') for x in range(-30, 30)]) for y in range(12, -12, -1)]))
time.sleep(1.5);
实现效果:
- 实现出来是一个连续的爱心动图,爱心由你输入的话组成,下面是截取的静态图