Code Breaker combination

26 views
Skip to first unread message

Jody Crothers

unread,
Nov 4, 2021, 11:31:38 PM11/4/21
to TI IT list
Hi all,
I want to create a program in which participants are asked to enter a 4 digit code.
It will be a combination so I need it to say Correct or incorrect.
I want people to get 3 attempts

I am having two issues.
I cant clear the value of the code attempt so the old value appear
Tried using DelVar doesn't seem to work

Also more importantly I need to be able to hide the code to enter so students cant simply look at the program to get the answer

help appreciated

Jody Crothers


Head of Learning Area (Mathematics)

Ridge View Secondary College

Western Australia

www.jodstar.com

lockbox.tns

John Hanna

unread,
Nov 5, 2021, 5:51:02 AM11/5/21
to tins...@googlegroups.com

 

 

Define lockedbox()=

Prgm

:Local comb

:Disp "Enter your code below you have 3 attempts"""

:tries:=0

:correct:=false

:While tries<3 and not correct

:  comb:=0

:  Request "End Combination",comb

:Disp comb

:If comb=2345 Then

:  Disp "correct"

:  correct:=true

:Else

:  Disp "wrong"

:  tries:=tries+1

:EndIf

:EndWhile

:If not correct Then

:  Disp "No more attempts. Goodbye."

:Else

:  Disp "You're in!"

:EndIf

:EndPrgm

 

 

Do good,

     John

--
--
To post to this group, send email to tins...@googlegroups.com
To unsubscribe send email to tinspire+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com.au/group/tinspire?hl=en-GB?hl=en-GB
The tns documents shared by group members are archived at
https://sites.google.com/site/tinspiregroup/classroom-news/welcome-abouttime

---
You received this message because you are subscribed to the Google Groups "tinspire" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tinspire+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tinspire/SL2P216MB1048207B650B0431FF17E306B88E9%40SL2P216MB1048.KORP216.PROD.OUTLOOK.COM.

John Hanna

unread,
Nov 5, 2021, 8:26:48 AM11/5/21
to tins...@googlegroups.com

Suggestion: generate a random combination!

 

Do good,

     John

Jody Crothers

unread,
Nov 6, 2021, 12:55:54 AM11/6/21
to tins...@googlegroups.com
Hi John,
thanks for that I need to be able to set the combination.
I have 4 separate activities which students complete to determine the combination. I often use a combination padlock on a toolbox with prizes in the toolbox.

Now how to hide the variable.

Jody Crothers


Head of Learning Area (Mathematics)

Ridge View Secondary College

Western Australia

www.jodstar.com


From: tins...@googlegroups.com <tins...@googlegroups.com> on behalf of John Hanna <jeh...@optonline.net>
Sent: Friday, 5 November 2021 8:26 PM
To: tins...@googlegroups.com <tins...@googlegroups.com>

John Hanna

unread,
Nov 6, 2021, 7:09:32 AM11/6/21
to tins...@googlegroups.com

Re: “Now how to hide the variable.

 

That will be a challenge! All you’d  have to do is add a Disp <var> to the program to reveal it.

 

You could put the combination into a document in the form of a Question and make the doc an exam to hide the answer…

 

 

Do good,

     John

image001.png

John Hanna

unread,
Nov 6, 2021, 7:44:04 AM11/6/21
to tins...@googlegroups.com

 

You could conceal the program (delete the page containing the Program Editor app), clear the Calc app’s history to have a blank Calc app, then send the file to the students.

 

They would have to press [var] to paste the program name and then run the program.

 

But a clever student can always add a Program Editor, open the program and reveal the code.

 

I think the best solution to keep the code hidden would be to write the program using Lua!

 

Do good,

     John

image001.png

Jody Crothers

unread,
Nov 6, 2021, 10:50:42 PM11/6/21
to tins...@googlegroups.com
Any LUA experts out there.
Tried it 5 years ago then got into TI Basic because of the rover.
Python is my next plan.

Jody Crothers


Head of Learning Area (Mathematics)

Ridge View Secondary College

Western Australia

www.jodstar.com


Sent: Saturday, 6 November 2021 7:43 PM

John Hanna

unread,
Nov 8, 2021, 6:35:55 AM11/8/21
to tins...@googlegroups.com

See attached, Jody.

image001.png
Combination - Lua.tns

Jody Crothers

unread,
Nov 8, 2021, 10:32:07 PM11/8/21
to tins...@googlegroups.com
Great work John
Couple of questions
  1. What's the combo? So I can check the response
  2. How can I edit the file to create various answers?

Jody Crothers


Head of Learning Area (Mathematics)

Ridge View Secondary College

Western Australia

www.jodstar.com


Sent: Monday, 8 November 2021 7:35 PM
Reply all
Reply to author
Forward
0 new messages