Jump to content



Photo
- - - - -

Prizm Program Help


  • Please log in to reply
9 replies to this topic

#1 joshp689

joshp689

    Newbie

  • Members
  • Pip
  • 4 posts

  • Calculators:
    Prizm

Posted 20 April 2016 - 05:33 AM

Hello,

This is my first post and i need help.

I trying to write a program on my Prizm. I am exposed to c++ and python with a hint r. I think my problem is mostly a syntax error, but here we go.

here is my code so far.

Lbl 0
"1 for option 1"
"2 for option 2"
"3 for option 3"
"4 for option 4"
"5 for option 5"

?->A
A=1 =>GoTo 1
A=2 =>GoTo 2
A=3 =>GoTo 3
A=4 =>GoTo 4
A=5 =>GoTo 5

Lbl 1
ClrText
"option 1"
?->B
math function on B
output number(idk how to do the output symbol)
GoTo 0

Lbl 2
ClrText
"option 1"
?->B
math function on B
output number(idk how to do the output symbol)
GoTo 0

Lbl 3
ClrText
"option 1"
?->B
math function on B
output number(idk how to do the output symbol)
GoTo 0

Lbl 4
ClrText
"option 1"
?->B
math function on B
output number(idk how to do the output symbol)
GoTo 0

Lbl 1
ClrText
"option 1"
?->B
math function on B
output number(idk how to do the output symbol)
GoTo 0

This post was in the wrong section so i moved it.

So my issue is now that I can jump to the correct section and ask for a new input how would I do a math function on "B", then output the results?

 



#2 pan.gejt

pan.gejt

    Casio Freak

  • Members
  • PipPipPipPip
  • 128 posts
  • Gender:Male
  • Location:CZ

  • Calculators:
    fx-880, fx-6300G, fx-9700GE, fx-9860G Slim, Classpad 330-A, TI-Nspire + keypad, TI-Nspire CAS, TI-Nspire CX CAS,TI-89 Titanium, HP-50g, SEC-101, fx-991ES PLUS, fx-991DE PLUS, fx-CP400, Canon X MARK I PRO, Citizen SRP-75,

Posted 20 April 2016 - 03:51 PM

My solution

 

Lbl 5:ClrText:"INPUT OPTION 1-5"?->O:
O≠1=>Goto 1:ClrText:"OPTION 1":
"B"?->B:"R="▲ (triangle - shift+prgm and F5)
2B:Goto 5▲ (put your function instead of 2B)

Lbl 1:O≠2=>Goto 2:ClrText:"OPTION 2":
"B"?->B:"R="▲ (triangle - shift+prgm and F5)
2B-5:Goto 5▲ (put your function instead of 2B-5)

Lbl 2:O≠3=>Goto 3:ClrText:"OPTION 3":
"B"?->B:"R="▲ (triangle - shift+prgm and F5)
ln B:Goto 5▲ (put your function instead of ln  B )

Lbl 3:O≠4=>Goto 4:ClrText:"OPTION 4":
"B"?->B:"R="▲ (triangle - shift+prgm and F5)
2B+5:Goto 5▲ (put your function instead of 2B+5)

Lbl 4:ClrText:"OPTION 5":
"B"?->B:"R="▲ (triangle - shift+prgm and F5)
B*B-5:Goto 5▲ (put your function instead of B*B-5)

 

 

19cuf3.png2ldulb.png3feu49.png40muqo.png


Edited by pan.gejt, 20 April 2016 - 04:11 PM.


#3 joshp689

joshp689

    Newbie

  • Members
  • Pip
  • 4 posts

  • Calculators:
    Prizm

Posted 21 April 2016 - 12:53 AM

I got that program to work. but I need help for another thing.

 

I want it to go to a label based on two different inputs

something like

Lbl 0
"Menu 1"
"Option 1"
"Option 2"
?->A

If A=1
Then Goto 1
If A=2
Then Goto 1

Lbl 1
"Menu 2"
"Option 1"
"Option 2"
?->B

If A=1 and B=1
Then Goto 2
If A=1 and B=2
Then Goto 3



I think my calculator is "forgetting" the value of A when at the B input.


Edited by joshp689, 21 April 2016 - 12:54 AM.


#4 Viliami

Viliami

    Casio Addict

  • Moderator
  • PipPipPip
  • 85 posts
  • Gender:Male
  • Location:New Zealand
  • Interests:C++ - OpenGL,SDL
    Python - Pygame
    Java - SFML
    C - Casio SDK

  • Calculators:
    FX-9750 GII upgraded to FX-9860 GII

Posted 21 April 2016 - 10:26 AM

I don't know if it's it's the same as the BASIC synntax in fx-9860giis, but if it is, you're missing the ENDIFs or the ELSE.

Nevermind, I read some Prism BASIC code, the ENDIF is not needed.


Edited by Viliami, 21 April 2016 - 10:34 AM.


#5 pan.gejt

pan.gejt

    Casio Freak

  • Members
  • PipPipPipPip
  • 128 posts
  • Gender:Male
  • Location:CZ

  • Calculators:
    fx-880, fx-6300G, fx-9700GE, fx-9860G Slim, Classpad 330-A, TI-Nspire + keypad, TI-Nspire CAS, TI-Nspire CX CAS,TI-89 Titanium, HP-50g, SEC-101, fx-991ES PLUS, fx-991DE PLUS, fx-CP400, Canon X MARK I PRO, Citizen SRP-75,

Posted 21 April 2016 - 10:38 AM

Is this code correct? Because I don't understand why do you need different values of A for the same jump. In such case you can assign any value to A and omit the code.  

 

If A=1
Then Goto 1
If A=2
Then Goto 1

----------------------------------------------------

 

If A=2 means the jump to the beginning

 

 

Lbl 2:ClrText:"Menu 1":"INPUT OPTION 1-2"?->A:
A≠1=>Goto 2:"MENU 2":"INPUT OPTION 1-2"?->B:       ;if A=1 the program continues to Menu 2, if A=2 the program jumps to the beginning for the new input

A≠B=>Goto 1:put something here for A=B=1:                ;if A=1 and B=1 the program continues, if A=1 and B=2 the program jumps to Lbl 1

Lbl 1:put something here for A=1 and B=2:Goto 2


Edited by pan.gejt, 21 April 2016 - 11:07 AM.


#6 Viliami

Viliami

    Casio Addict

  • Moderator
  • PipPipPip
  • 85 posts
  • Gender:Male
  • Location:New Zealand
  • Interests:C++ - OpenGL,SDL
    Python - Pygame
    Java - SFML
    C - Casio SDK

  • Calculators:
    FX-9750 GII upgraded to FX-9860 GII

Posted 21 April 2016 - 10:50 AM

The program is also going to flow to label 1 naturally, so the if statements checking for A=1 and A=2 are not needed.



#7 frankmar98

frankmar98

    Casio Freak

  • Moderator
  • PipPipPipPip
  • 105 posts
  • Gender:Male
  • Location:Spain
  • Interests:Science, programming

  • Calculators:
    CFX-9970G
    fx-9860G SD
    HP Prime
    TI-84+CE-T TI-83+
    fx-9750GII SH4-A
    CP-300 fx-4800p
    fx-3650pII PB-100
    fx-991SP X fx-991ES plus

Posted 21 April 2016 - 06:00 PM

I think, like Viliami you´re missing the endifs.

 

You must look at the user´s guide the syntax of the if then else endif sentence.

 

To output somethig in Casio Basic, you have to put a little triangle in the end.  PRINT(X) is in casio basic: X(output triangle)

 

You can find this triangle in Shift Vars (Prgm)

 

Luck!



#8 Forty-Two

Forty-Two

    Casio Overlord

  • Deputy
  • PipPipPipPipPipPipPip
  • 528 posts
  • Gender:Male
  • Location:Well, The sign says "You are here"...

  • Calculators:
    Casio fx-CG10 Prizm
    Casio fx-9860GII
    TI-84+ SE

Posted 21 April 2016 - 06:53 PM

This post was in the wrong section so i moved it.

 

I've moved the replies from the old topic to this thread, and deleted the old topic.



#9 joshp689

joshp689

    Newbie

  • Members
  • Pip
  • 4 posts

  • Calculators:
    Prizm

Posted 22 April 2016 - 05:54 AM

My problem is arguing two variables. 

 

The 

If A=1
Goto 1
If A=2
Goto 1

is only display the selected option and to move along to the next menu, after the second menu (Lbl 1). I know I should've added the display part to avoid the confusion.

 

The program moves to the 

If A=1 and B=1
Then Goto 2
If A=1 and B=2
Then Goto 3

and this needs to move to certain labels based on the combination of "A" and "B". In C++ I would do something like "if A=1 && B=1" but I don't know to how on my Prizm.


Edited by joshp689, 22 April 2016 - 05:58 AM.


#10 Viliami

Viliami

    Casio Addict

  • Moderator
  • PipPipPip
  • 85 posts
  • Gender:Male
  • Location:New Zealand
  • Interests:C++ - OpenGL,SDL
    Python - Pygame
    Java - SFML
    C - Casio SDK

  • Calculators:
    FX-9750 GII upgraded to FX-9860 GII

Posted 23 April 2016 - 05:14 AM

To type the And logical operator press the OPTN button then select LOGIC and then select AND. That is also where you find OR, NOT and XOR.

If it isn't showing make sure that COMP is the mode in the setup menu. You can reach the setup menu by pressing Shift and then MENU  in the maths add-in.


Edited by Viliami, 23 April 2016 - 05:16 AM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users