Jump to content



Photo
- - - - -

how do i?


  • Please log in to reply
7 replies to this topic

#1 Bob Vila

Bob Vila

    Casio Overlord

  • Members
  • PipPipPipPipPipPipPip
  • 768 posts
  • Gender:Male
  • Location:USA

  • Calculators:
    FX 1.0+ : CFX-9850 GB Plus : TI-81

Posted 07 July 2003 - 04:08 PM

i am writing a program where the user has to input information in words, and my question is how do i make the letters in the word appear one after another and on the same line as the question? and how do i make it so if they type a word then it does something specific?

#2 CrimsonCasio

CrimsonCasio

    UCF Ambassador

  • [Legends]
  • PipPipPipPipPipPipPipPipPipPip
  • 3579 posts
  • Gender:Male
  • Location:USA
  • Interests:Claculators, Stephen King, Video Games, Calculators, Programming, Calculators, Reading, Calculators... hmm, what else... Ah! Calculators!

  • Calculators:
    Algebra FX2.0, CFX 9850Ga+, Classpad 300

Posted 08 July 2003 - 01:33 AM

Im not sure if i understand, but here is what you need to input "words":

1->A
Dim (#+1)->List 1 //# should be max size of word
Do
Do
LpWhile getkey=0
Getkey->G
G->List 1[A]
Isz A
LpWhile getkey<>31 And A<>Dim List 1
31->List 1[Dim List 1]  //insures that 31 will always be at the end of the list

that will collect the word into a list which you can interpret into individual letters which can be printed. 31 is used as a terminator, when you display your letters 31 will be the que to quit.

Here is the code to display the text the user entered.

#->X
#->Y
1->A
While List 1[A]<>31
List 1[A]->L
L=#=>Locate X+(A-1),Y,"A"  //# should be the GetKey value for each letter
L=#=>Locate X+(A-1),Y,"B"
L=#=>Locate X+(A-1),Y,"C"
...
...
L=#=>Locate X+(A-1),Y,"Z"
Isz A
WhileEnd

if you want to check if a specific word was entered I suggest making another list filled with the GetKey values for the letters to check for, then compare the two lists. heres the code:

this might work, I dont remember:
List 1=List 2=>{CODE}

if not then:

0->B
For 1->A to Dim List 1
List 1[A]<>List 2[A]=>1->B
Next
B=0=>{CODE}


Addmitedly this is not the best way to do this, but it is the easyest to understand, hope it helps.

PS: glad to see your writing a program.

#3 Bob Vila

Bob Vila

    Casio Overlord

  • Members
  • PipPipPipPipPipPipPip
  • 768 posts
  • Gender:Male
  • Location:USA

  • Calculators:
    FX 1.0+ : CFX-9850 GB Plus : TI-81

Posted 08 July 2003 - 01:42 PM

thanks crimson just what i needed :)

#4 CrimsonCasio

CrimsonCasio

    UCF Ambassador

  • [Legends]
  • PipPipPipPipPipPipPipPipPipPip
  • 3579 posts
  • Gender:Male
  • Location:USA
  • Interests:Claculators, Stephen King, Video Games, Calculators, Programming, Calculators, Reading, Calculators... hmm, what else... Ah! Calculators!

  • Calculators:
    Algebra FX2.0, CFX 9850Ga+, Classpad 300

Posted 08 July 2003 - 02:35 PM

Your welcome, what is this program going to be?

#5 Bob Vila

Bob Vila

    Casio Overlord

  • Members
  • PipPipPipPipPipPipPip
  • 768 posts
  • Gender:Male
  • Location:USA

  • Calculators:
    FX 1.0+ : CFX-9850 GB Plus : TI-81

Posted 08 July 2003 - 04:27 PM

well i dont know yet but i was messing around trying to get that input stuff working, because i'm sure i will use it what ever i plan to do. :hammer:

#6 Bob Vila

Bob Vila

    Casio Overlord

  • Members
  • PipPipPipPipPipPipPip
  • 768 posts
  • Gender:Male
  • Location:USA

  • Calculators:
    FX 1.0+ : CFX-9850 GB Plus : TI-81

Posted 10 July 2003 - 01:47 PM

hey crimson, it has an error on this command

Dim (#+1)->List 1 //# should be max size of word


i have tried to put the number and the # in and i think it has a syn error, what shoul i do?

#7 CrimsonCasio

CrimsonCasio

    UCF Ambassador

  • [Legends]
  • PipPipPipPipPipPipPipPipPipPip
  • 3579 posts
  • Gender:Male
  • Location:USA
  • Interests:Claculators, Stephen King, Video Games, Calculators, Programming, Calculators, Reading, Calculators... hmm, what else... Ah! Calculators!

  • Calculators:
    Algebra FX2.0, CFX 9850Ga+, Classpad 300

Posted 10 July 2003 - 02:22 PM

:blush: sorry, I wrote that wrong, heres how it should be:
(#+1)->Dim List 1


#8 Bob Vila

Bob Vila

    Casio Overlord

  • Members
  • PipPipPipPipPipPipPip
  • 768 posts
  • Gender:Male
  • Location:USA

  • Calculators:
    FX 1.0+ : CFX-9850 GB Plus : TI-81

Posted 13 July 2003 - 11:40 PM

thanks




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users