0

I have a TI-84 Plus CE, and I'm trying to create a random integer dice rolling program. For my code I have:

ClrHome
Menu("HOW MANY SIDES?","4",A,"6",B,"8",C,"10",D,"12",E,"20",F)
Lbl A
randInt(1,4,1)➔G
Disp G
Stop
Lbl B
randInt(1,6,1)➔H
Disp H
Stop
Lbl C
randInt(1,8,1)➔I
Disp I
Stop
Lbl D
randInt(1,10,1)➔J
Disp J
Stop
Lbl E
randInt(1,12,1)➔K
Disp K
Stop
Lbl F
randInt(1,20,1)➔L
Disp L
Stop

I'm expecting:

HOW MANY SIDES?
1:4
2:6
3:8
4:10
5:12
6:20

And then a response like {8}. I assume the issue is with the randInt portions of the program, but I don't know how to fix it. I'd appreciate if anyone can help out with this. Thanks!

2 Answers2

0

can lists be diplayed with the Disp command ? Instead of a variable, you have lists of length one. Have you tried randInt(1,6)->H instead of randInt(1,6,1)->H ?

  • I just tried that, it gives me the same error: argument. Is there another way to display lists, or can I convert the list to just the number? – Madi Scientist May 04 '22 at 15:00
0

I tried running the code as it is. It works fine, so I guess I'd check for typos in your program. Missing or flipping values in the long list of menu arguments would produce an ARGUMENT error before the menu opens (is that when the error happens? vs. after selecting a menu option).

I recommend using 4, 6, 8... instead of A, B, C... for the labels to both reduce the risk of typos and reduce the necessary mental work.

Quaris
  • 361
  • 2
  • 9