repl.it
Python

No description

fork
loading
Files
  • main.py
  • computerscreen.txt
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import replit
import time
import random
replit.clear()
screen = open('computerscreen.txt', 'r')
Adictionary = 'qwertyuiopasdfghjklzxcvbnm.!$%&()?+-=*;:"'
Cdictionary = {}
for character in Adictionary:
	Cdictionary.__setitem__(bin(ord(character)), character)
def drawscreen(screendata, screen):
	x = 0
	for line_of_data in screen.readlines():
		if x == 7:
			x = 0
		print(line_of_data.replace('\n', '').replace('#', str(screendata[x])))
		if '#' in line_of_data:
			x = x + 1
def refineword(wordlist):
	refinedwords = []
	for worditem in wordlist:
		moddedword = ''
		extender = ''
		for charbit in worditem:
			moddedword = moddedword + bin(ord(charbit))
			if len(moddedword) > 0:
				for i in range(len(worditem)):
					extender = extender + '  '
		moddedword = moddedword + (' ' * (32 - len(moddedword)) ) + extender
		refinedwords.append(moddedword.replace('0b', ''))
	return refinedwords

drawscreen(refineword(['x', 'xx', '', '', '', '', '']), screen)
print(len('xxxxxxxxxxxxxxxxxxxxxxx'))
print(32 - 7)
?