
-----------------------------------
chipanpriest
Mon Dec 19, 2011 2:01 pm

Turning integer into a character
-----------------------------------
Okay, I am trying to make a program that randomly generates a letter. Simple as that.

This is what I have var letter : string
var ch : int
var font := Font.New ("Comic Sans MS:30:bold")

randint (ch,65,122)
letter := intstr (ch)

Draw.Text (letter,100,100,font,7)


Now, this works, but not the way I want it to. I displays the actual number where I want to display the letter that the integer represents. like how 65 = A etc. Any help?

-----------------------------------
Insectoid
Mon Dec 19, 2011 2:09 pm

RE:Turning integer into a character
-----------------------------------
look up chr() and ord()

-----------------------------------
chipanpriest
Tue Dec 20, 2011 9:16 pm

RE:Turning integer into a character
-----------------------------------
oh okay i got it thanks

-----------------------------------
mirhagk
Wed Dec 21, 2011 9:23 am

RE:Turning integer into a character
-----------------------------------
cheat also works in this circumstance, although it's not recommended.

-----------------------------------
Velocity
Tue Dec 27, 2011 9:47 pm

RE:Turning integer into a character
-----------------------------------
chr is char to int ord is int to chr... or other way around, i have not used turing in almost 4 DAYS! lol fail 