Пример #1
0
def printline(input):
    debug(2, "Writing line '" + input + "'")
    writeraw("[-]")
    glob.bitcounter = 0
    for x in range(0, len(input)):
        printchar(input[x])
    printchar('\n')
Пример #2
0
def portrait(imagepath):
  debug(3, "Writing portrait image at '"+imagepath+"'")
  if not os.path.exists(imagepath):
    print("ERROR: file not found: "+imagepath)
  image=asciify.runner(imagepath)
  writeraw("[-]")
  glob.bitcounter=0
  
  writeraw(">")
  storechar(chr(27))
  writeraw(">")
  storechar('[')
  writeraw(">")
  storechar('1')
  writeraw(">")
  storechar('C')
  writeraw("<<<<")

  printtext(chr(27)+"[f")
  for x in range(0,len(image)):
    if (image[x]=='@'):
      writeraw(">.>.>.>.<<<<")
    else:
      printchar(image[x])
    if (x==138):
      printtext(chr(27)+"E")
  writeraw(">[-]>[-]>[-]>[-]<<<<")
  flushcode()
Пример #3
0
def image(image):
    debug(3, "Writing image at '" + image + "'")
    if not os.path.exists(image):
        print("ERROR: file not found: " + image)
    printtext(chr(27) + "[f")
    printtext(asciify.runner(image))
    skipline(6)
    flushcode()
Пример #4
0
def preimage(path):
    debug(3, "Writing prerendered image at '" + path + "'")
    if not os.path.exists(path):
        print("ERROR: file not found: " + path)
    f = open(path, "r")
    printtext(chr(27) + "[f")
    printtext(f.read())
    f.close
    flushcode()
Пример #5
0
def dialogue(speaking, text):
    debug(3, "Writing dialogue for " + speaking + ": '" + text + "'")
    cleardialogue()
    printtext(chr(27) + "[43;0H")
    if not (speaking == ""):
        printline('+' + ('-' * (len(speaking) + 2)) + '+')
        printline("| " + speaking + " |")
    else:
        skipline(2)

    printline('+' + ('-' * 148) + '+')
    printtext(linecorrect(text))
    writeraw(">,[-]<")
Пример #6
0
def printchar(input):
  try:
    if sys.argv[2] == "--char":
      debug(1, "Writing character '"+input+"'")
  except:
    ''
  while (ord(input) != glob.bitcounter):
    if (ord(input)>glob.bitcounter):
      writeraw("+")
      glob.bitcounter+=1
    else:
      writeraw("-")
      glob.bitcounter-=1
  writeraw(".")
Пример #7
0
def printframe(path):
    debug(3, "Writing prerendered image at '" + path + "'")
    if not os.path.exists(path):
        print("ERROR: file not found: " + path)
    f = open(path, "r")
    printtext(chr(27) + "[f")
    writeraw("[-]")
    for c in f.read():
        if c == 'b':
            writeraw("<.>")
            writeraw("++++++[-]")  #Idle
        elif c == 'w':
            writeraw(">[.>]<[<]")
        else:
            glob.bitcounter = 0
            printchar(c)
            writeraw("[-]")
    f.close
    flushcode()
Пример #8
0
def flushcode():
  debug(1, "Flushing code...")
  glob.f.write(glob.output)
  glob.output=""
Пример #9
0
def printtext(input):
  debug(2, "Writing text '"+input+"'")
  writeraw("[-]")
  glob.bitcounter=0
  for x in range(0,len(input)):
    printchar(input[x])
Пример #10
0
def storechar(input):
  debug(1, "Storing character '"+input+"'")
  glob.output+="[-]"+('+'*ord(input))