Skip to content

Commit

Permalink
Docs: HelloWorld From CheverJohn (#59)
Browse files Browse the repository at this point in the history
* Docs: HelloWorld From CheverJohn

a interesting demo by python.

* Docs: just update a .py file
  • Loading branch information
John Chever authored Dec 3, 2021
1 parent 44364d5 commit 3394323
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 0 deletions.
1 change: 1 addition & 0 deletions 2021/CheverJohn/MerryChristmas
Submodule MerryChristmas added at 64a1c3
53 changes: 53 additions & 0 deletions 2021/CheverJohn/xmas.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import termcolor
import random
import time, datetime
import sys, os
from colorama import init
from termcolor import colored

def clear():
if sys.platform == 'win32': # if windows
return os.system('cls')
else: #if *nix
return os.system('clear')


colors = [
'red',
'green',
'yellow',
'blue',
'magenta',
'cyan',
'white']

yellowlight = termcolor.colored('o', 'yellow')
magentalight = termcolor.colored('o', 'magenta')
cyanlight = termcolor.colored('o', 'cyan')

lightlist = [yellowlight, cyanlight, magentalight]

init()
while True: #exit with ctrl+C
print('to exit use a keyboard interrupt (ctrl+c)')
for i in range(1,30,2): #tree
tree = ''
for j in range(i): #make lights
randNum=random.randint(0,500)
if (randNum <= 750) and (randNum >=250) :
tree += lightlist[random.randint(0,2)]
else:
tree += termcolor.colored('*', 'green')
string = '_'*(15-int(i/2))+tree+'_'*(15-int(i/2))+'\n'
print(string,end='')
trunk=colored('mWm', 'yellow')
for k in range(3): #trunk
outbuffer = '_'*14+trunk+'_'*14+'\n'
print(outbuffer, end='')
merry_Christmas =termcolor.colored('Merry Christmas', colors[random.randint(0,len(colors)-1)])
outbuffer2 = '_'*8+merry_Christmas+'_'*8+'\n'
print(outbuffer2, end='')
time.sleep(0.4)
clear()


1 change: 1 addition & 0 deletions 2021/Signatures.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Please sign your name below:
# e.g.: GeMini-220
CheverJohn
TerrificTerry

0 comments on commit 3394323

Please sign in to comment.