How do I make a converter while using a small amount of code?

More specifically; how do I make a function that can check a number (example 65), and convert it to a character on the ASCII table? (65 is A)
I would do multiple check if elses, but I feel like that would take too long to make one for each character (95).
Is there an easier way to do this?

5 Likes

There is a harder way, lots of clones and all that mathy stuff, it could take hours, would you like that?

2 Likes

Not really?

3 Likes

A converter? What do you mean by that?

3 Likes

Like something that takes one thing, and makes it something else
Example: Red to blue

3 Likes

Honestly not sure if that’s a helpful description of a converter

3 Likes

So what exactly will you be using it for?

1 Like

I’m gonna be using it to convert numbers into ASCII characters, like 75 is K

2 Likes

I’m gonna try doing a check if for each character since it seems like the easiest option currently, I’ll update with what happens

3 Likes

For ascii characters what I did is I put every printable one in a string then used the character at index block to get the character from the number.

8 Likes

Update: My iPad died and I don’t think it saved :sweat_smile:

2 Likes

That’s actually smart!

3 Likes

If you have a number as input, you can output a string that has a fixed length by using the characters in between block

Example: 45 → A
Example: 2 → _red   3 → blue

5 Likes

The solution I would suggest is the same one that Petrichor mentioned above.
Let us know if you manage to figure it out and feel free to ask if you need more help!

4 Likes

Petrichor beat me - using strings is a very simple way to convert one thing to another thing

2 Likes

I found the project where I did it. The code is all in the text object called “Text”, though it is difficult to read.

3 Likes