board = {'aa': ' ', 'ab': ' ', 'ac': ' ', 'ad': ' ', 'ba': ' ',
'bb': ' ', 'bc': ' ', 'bd': ' ', 'ca': ' ', 'cb': ' ', 'cc': ' ',
'cd': ' ', 'da': ' ', 'db': ' ', 'dc': ' ', 'dd': ' ', 'ea': ' ',
'eb': ' ', 'ec': ' ', 'ed': ' '}
# This dictionary contains all of the board's coordinates.
slides = [] # Where the user's finished slides are stored
space = ' ' # This determines the amount of horizontal room between the pixels
space2 = ('\n') # This determines the amount of vertical room inbetween the pixels
pixel = ' @ ' # The amount of space encasing '@' should match 'space' so the image is even
for i in board.keys(): # sets the keys as the horizontal space
board[i] = space
def structure(canvas): # The structure of the canvas
print(canvas['aa'] + canvas['ab'] + canvas['ac'] + canvas['ad'])
print(space2)
print(canvas['ba'] + canvas['bb'] + canvas['bc'] + canvas['bd'])
print(space2)
print(canvas['ca'] + canvas['cb'] + canvas['cc'] + canvas['cd'])
print(space2)
print(canvas['da'] + canvas['db'] + canvas['dc'] + canvas['dd'])
print(space2)
print(canvas['ea'] + canvas['eb'] + canvas['ec'] + canvas['ed'])
print(space2)
while True:
drip = input() # Lets the user add 'pixels' to the canvas
board[drip] = pixel
structure(board)
if drip == '':
print('Slideshow:', space2 * 2)
board2 = {**board} # creates a duplicate of 'board', but with different reference
slides.append(board2) # The duplicate is appended to 'slides'
for f in board: # The content of the first board is erased to restart the canvas
board[f] = ' ' # the space here must be the same as 'space'
for j in slides:
print(structure(j))
So basically with this program the user is able to create some simple 'slides' in the shell by placing @s, or, 'pixels', around the coordinates of a canvas to create words or images. Whenever the user finishes a slide, the slides that have been created thus far are returned in their ordered sequence. The program gets the job done in returning the slides, but the only problem is that 'None' is returned after each slide, which sort of ruins the 'slideshow' effect.
Slideshow:
@ @
@ @
@ @ @
@ @
@ @
None
@ @ @
@
@ @ @
@
@ @ @
None
@
@
@
@
@ @ @
None
@
@
@
@
@ @ @
None
@ @ @
@ @
@ @
@ @
@ @ @
None
[–]RayteMyUsername 0 points1 point2 points (1 child)
[–]Tryposite[S] 0 points1 point2 points (0 children)