Share your repls and programming experiences

← Back to all posts
Ascii Typer
AZRIELGIESWEIN (19)

An ascii typer.
(Version [1.8][Now with Secret Mode])

Commentshotnewtop
KiKUP (39)

Very cool! I would work on cutting down the code since it's so long! Maybe a list would work?

AZRIELGIESWEIN (19)

Please enjoy "Ascii Typer" and [DON'T REPUBLISH FOR PROFIT]

MiloWebster (1)

I really like it, but I found an error. "test test" works fine, but "really long string" causes there to be a space between every line. No idea how that could happen but I'd imagine it'd be easy to fix.

AZRIELGIESWEIN (19)

I will be inserting a 'Secret'

amasad (1258)

I love it. It'd be cool if we can choose different styles

AZRIELGIESWEIN (19)

@amasad "I am working on a simple way to do that that doesn't require 3 weeks to 2 months to make."

ebest (551)

You know there's a module that does this?

AZRIELGIESWEIN (19)

@ebest It is a cool independent project for my first year in CS

ebest (551)

@AZRIELGIESWEIN This is your first year?

Ok then, a few suggestions:
#1: Use a dictionary. They might not be very useful now, but they'll become extremely important later.

#2: There's way too many if statements. #1 would fix this too.

#3: The input string can be .uppercase d. If you use so many if statements, at least to .uppercase!

#4: Check out the modules! Here's my program that does this. Use font "doh" and blue on red. https://repl.it/@ebest/Ascii-txt

-Ebest

Steven_The_GuyT (197)

You know that someone could access the secret mode just by changing line 17 to

secret_mode = True

It's too easy...

ebest (551)

@Steven_The_GuyT BUT WHAT'S THE SECRET

oh, there is a secret. It's just hard to find

Clue:

Secret

Really! Just turn it into 1s and 0s

AZRIELGIESWEIN (19)

@Steven_The_GuyT Thats cheating, but fair point

TacoCode (4)

Great ASCII typer, but...


You could improve the design to use a dictionary instead of manually doing if letter == "some letter":. This would improve code readness, complexity, and file size.
You can just do:

for letter in user:
    try:
        for i in len(letters[letter]()):
            output[i] += letters.get(letter)[i]
    except:
        print("Invalid caracter '{}'".format(letter))

Where the list letters is something like this:

letters = {
    " " = ['       ', '       ', '       ', '       ', '       ', '       '],
    "!" = ['  ||   ','  ||   ','  ||   ','  \/   ','       ','  []   '],
    ...
}

You can see an example of this here