Shop OBEX P1 Docs P2 Docs Learn Events
How do you change a key to a string — Parallax Forums

How do you change a key to a string

Harry1Harry1 Posts: 29
edited 2006-10-22 00:45 in Propeller 1
wink.gif·smurf.gif·smhair.gif I am working on an hangman game that runs on a propeller chip and i am trying to get a keyboard input. My program is below, but i can get the keys but i cant get the strings to show up on the TV.

VAR
Long Index
Long numLetters
Long marker
Byte theWord
Long moveCounter
CON
· _clkmode = xtal1 + pll16x······
· _xinfreq = 5_000_000
· NewLine = 13
· ClearScreen = 0
· dpine = 26
· cpine = 27
·'
OBJ
· VideoDisplay: "TV_Terminal"·················· 'Creates the object VideoDisplay
· keyboard : "Keyboard"
'
DAT
Str1 byte "crrers",0
PUB Start
'
· DisplayTextOnMonitor
'
PRI DisplayTextOnMonitor | Count
· VideoDisplay.start(12)·····················
· SetScreenWhiteOnDarkGreen····················
· numLetters :=5
· Index :=0
· marker := 0·····································
'
·' Repeat Count From 1 To 200000·······················
· ' WaitCnt(40_000_000 + Cnt)
··· VideoDisplay.str(string("OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO"))
··· numberLettersInWordater
··· VideoDisplay.str(string("O······· WELCOME TO GUESS THE WORD······ O"))·····

··
··········· VideoDisplay.str(string("O·········· Copyright 1983·············· O"))
··············· VideoDisplay.str(string("O······································· O"))
··················· VideoDisplay.str(string("O······································· O"))
······················· VideoDisplay.str(string("O······································· O"))·
······ VideoDisplay.str(string( " _______······························· "))··
····· VideoDisplay.str(string( "·· |··· 0································ "))
······ VideoDisplay.str(string( "·· |·· /|\·················· Wrong Guesses "))·
······ VideoDisplay.str(string( "· |·· / \······························ "))····
······· VideoDisplay.str(string( "· __|____············· "))
····································
··· VideoDisplay.out(NewLine)
······
··· VideoDisplay.out(NewLine)
···· VideoDisplay.str(string( "_________ TRY TO GUESS THIS WORD__________"))··
···· VideoDisplay.str(string( "············································· "))
···· repeat Index from 1 to numLetters
····· VideoDisplay.str(string(" __ "))
·······
· ' VideoDisplay.dec(Count)··················
·'· VideoDisplay.out(NewLine)··················
··· WaitCnt(40_000_000 + Cnt)
' VideoDisplay.out(ClearScreen)···············
'
PUB startx
··
PRI numberLettersInWordater
·
· numLetters := strsize(@Str1)·················· 'testing only remove
PRI SetScreenWhiteOnDarkGreen···················
· VideoDisplay.out(1)
· VideoDisplay.out(5)
PRI MoveCounterizer
·

Please help me...ill give you a hug ^^cool.giffreaked.giflol.gifroll.gifshakehead.gifsmile.gifyeah.gif

Comments

  • acantostegaacantostega Posts: 105
    edited 2006-10-22 00:45
    I believe Mike Green posted some routines to do just this, use the search feature.
Sign In or Register to comment.