Share your repls and programming experiences

← Back to all posts
Star Wars Scrolling Text Engine - Node.js
AmazingMech2418 (661)

Well, today is May 4th.

May 4th = "May the fourth"

In Star Wars, "May the force be with you".

Therefore, May 4th = "May the fourth be with you" = National Star Wars Day.

So, in celebration of Star Wars day, here is a Star Wars scrolling text engine! I know it isn't in 3D like in the movies, but it is the closest you can get in Node.js.

Also, the Star Wars logo in ASCII is based on the ASCII Star Wars animation. If you want to see it, go here: https://repl.run <= Links to repl by @turbio .

Update: Python version here: https://repl.it/@AmazingMech2418/Star-Wars-Text-Generator-Python

Commentshotnewtop
Bookie0 (2847)

Cool! I love it !may the force be with you too!

sugarfi (472)

telnet towel.blinkenlights.nl

AmazingMech2418 (661)

@sugarfi Yes. However, telnet will not work on Repl.it for some reason. I tried install-pkg telnet and it didn't work.

Rithaquick (17)

A tribute to Star Wars and its pretty cool I like it.

Rithaquick (17)

Also your at 299 cycles and i'm about give you 300 :)@AmazingMech2418

TheForArkLD (618)

My idea lol : publish it to npm

AmazingMech2418 (661)

@TheForArkLD Well, that would kind of be you publishing my code, so I think I should publish it...

CodingCactus (2527)

in python (i think):

def lineByLine(text):
  lines = text.split("\n")
  for i in range(len(lines)):
    for l in range(i):
      print("\n")
    print(lines[i:])

lineByLine("does\nthis\nwork\n???")
CodingCactus (2527)

oops, no obviously doesn't work lol

CodingCactus (2527)

@AmazingMech2418 this kinda works:

import time

def lineByLine(text):
  lines = text.split("\n")
  for i in range(len(lines)):
    for l in range(len(lines)-i):
      print("\n")
    for k in range(i):
      print(lines[k])
    time.sleep(1)
    print("\033[2J\033[H", end="")
    

lineByLine("does\nthis\nwork\n???")
AmazingMech2418 (661)

@CodingCactus LOL! Just look at the Node.js source code (line 1) and convert it to Python...

CodingCactus (2527)

@AmazingMech2418 i have no idea what is happening on line one lol :)

AmazingMech2418 (661)

@CodingCactus Only true JavaScript programmers can read line 1...

AmazingMech2418 (661)

@CodingCactus Yeah. Yours didn't have built-in word wrapping with an option for the width and height though...

AmazingMech2418 (661)

@CodingCactus Though 31 lines of Python code fit into 1 line in Node.js... You see why I like Node more than Python now?