|
We're glad you came by, but you might find what you're looking for elsewhere. TI-Basic Developer is not the site it once was. While its information on commands and other calculator features remains almost second-to-none, its forum, archives, and even hosting service, Wikidot, have been decaying for years. The calculator community would love to see what you're working on, or help you in your next coding adventure, but TI-Basic Developer is no longer the place to do it. Instead, you should head over to Cemetech (primarily American) or TI-Planet (primarily international). Both are active, well-established forums with their own archives, chatrooms, reference material, and abundant coding tools and resources. We'll see you there, we hope. |
Mastermind is a fun game that involves trying to break a random code of five numbers (1-9) in fifteen guesses or less. To help assist you with the code-breaking, a list of two numbers is provided. The first number is the number of digits that are correct and in the wrong place, and the second is the number of digits that are correct and in the right place. Try out the game and try to understand and think through the code.
The Code
:int(10rand(5))+1→L1
:For(G,-15,-1
:Input A
:int(10fPart(A/10^(5-cumSum(1 or L1→L2
:sum(L1=Ans
:Disp {sum(seq(min(sum(L1=N),sum(L2=N)),N,0,9))-Ans,Ans
:If Ans<4
:End
:If not(G
:Disp L1
:"LOSE
:If G
:"WIN
:"YOU "+AnsRelated Games
.