Login [Register]
Don't have an account? Register now to chat, post, use our tools, and much more.
heey, ive created LINGO (Dutch), a kind of mastermind, but with words.
but i think ive a very long code. please can someone look if he sees something that can shorter? tanx in advance!


Code:
:DCS
"BB777777777777BBB77222222222277B77222222222222777222BBBB222222277222BBBB2222222777222BB22222222777722BB22222222777777BB22222222777777BB77222222777777BB77777777777777BB777BB77777777BBBBBBBB77777777BBBBBBBB77777777777777777777B77777777777777BBB777777777777BB
Lbl ZZ
ClrHome
If 80>det([[20
Then
Disp "Get Doors CSE to run this:","http://dcs.cemetech.net"
Return
End
Disp "========LINGO v1.0========"," 1 PLAYER"," 2 PLAYERS"," QUIT"
2->R
Repeat Ans=105
If Ans
Then
Output(R,1," "
Output(R,26," "
End
min(4,max(2,R+sum(DeltaList(Ans={25,34->R
Output(R,1,">
Output(R,26,"<
getKey
End
If R=4
Then
ClrHome
Disp "Made by Peter Tillema"
Return
End
If R=3
Then
Repeat length(Str9)=5
ClrHome
Disp "PLEASE ENTER A WORD OF 5","LETTERS:","",""
Asm(prgmALOCK
Input "          ",Str9
End
End
If R=2
Then
"rowSwap(LINGO"->Str0
randInt(1,479
det(0
End
{22,14,17,3,26,27}->|LLING
0->P
"LINGO2"
real(5,0,0
real(0,1,1
real(0,3,4,93,1
real(0,3,4,93,0
For(A,1,5
For(B,1,5
real(7,7,19A-17,19B-17,20,20,0,1
real(7,7,19A-17,19B-17,20,20,0,0
End
End
For(A,1,dim(|LLING
real(4,0,6A+110,20,1,1,0,0,255,1,0,|LLING(A)
real(4,0,6A+110,20,1,1,0,0,255,0,0,|LLING(A)
End
real(9
Repeat Str3=Str9 or P>4
" "->Str3
Repeat K=105 and length(Str3)=6
Repeat Ans>40 and Ans<94 or max(Ans={105,23
getKey->K
End
Ans-20-5int(.1Ans
If 6>length(Str3) and 0<Ans and Ans<29
Str3+sub("ABC  DEFGHIJKLMNOPQRSTUVWXYZ",Ans,1->Str3
If K=23 and 1<length(Str3
Then
real(7,3,6length(Str3)+104,30,93,8,1
real(7,3,6length(Str3)+104,30,93,8,0
sub(Str3,1,length(Str3)-1->Str3
End
For(A,1,length(Str3
real(4,0,6A+104,30,1,1,0,0,255,1,0,inString("ABCDEFGHIJKLMNOPQRSTUVWXYZ: ",sub(Str3,A,1))-1
real(4,0,6A+104,30,1,1,0,0,255,0,0,inString("ABCDEFGHIJKLMNOPQRSTUVWXYZ: ",sub(Str3,A,1))-1
End
real(9
End
If 1<length(Str3
sub(Str3,2,length(Str3)-1->Str3
For(A,1,5
If sub(Str3,A,1)=sub(Str9,A,1)
Then
real(7,9,19A-16,3+19P,18,18,224,1
real(7,9,19A-16,3+19P,18,18,224,0
Else
If inString(Str9,sub(Str3,A,1)
Then
real(7,12,19A-8,11+19P,8,231,1
real(7,12,19A-8,11+19P,8,231,0
End
End
real(4,0,19A-10,8+19P,1,1,0,0,255,1,0,inString("ABCDEFGHIJKLMNOPQRSTUVWXYZ: ",sub(Str3,A,1))-1
real(4,0,19A-10,8+19P,1,1,0,0,255,0,0,inString("ABCDEFGHIJKLMNOPQRSTUVWXYZ: ",sub(Str3,A,1))-1
End
real(7,3,110,30,93,40,1
real(7,3,110,30,93,40,0
P+1->P
End
If P=5 and Str3!=Str9
Then
For(A,1,5
real(7,9,19A-16,98,18,18,224,1
real(7,9,19A-16,98,18,18,224,0
real(4,0,19A-10,103,1,1,0,0,255,1,0,inString("ABCDEFGHIJKLMNOPQRSTUVWXYZ",sub(Str9,A,1))-1
real(4,0,19A-10,103,1,1,0,0,255,0,0,inString("ABCDEFGHIJKLMNOPQRSTUVWXYZ",sub(Str9,A,1))-1
End
End
If Str3=Str9
Then
{9,4,27,7,4,1,19,27,6,4,22,14,13,13,4,13}->|LLING
For(A,1,dim(|LLING
real(4,0,6A+3,103,1,1,0,0,255,1,0,|LLING(A)
real(4,0,6A+3,103,1,1,0,0,255,0,0,|LLING(A)
End
End
Pause
real(0,3,4,255,1
real(0,3,4,255,0
real(0,1,0,1
Goto ZZ


in english: if you won: 'You have won"
if you lose you see the original word
Nice work PT! Another game is always good in my books! Smile Anyhow, I'm not too well versed with the real() command, so here's an idea that I can see from looking at it:
Store "ABCDEFGHIJKLMNOPQRSTUVWXYZ: " into a separate string, and use that in your instring functions. That should clear out a lot of repeated bytes.

Good luck on this program; have you uploaded it to the archives? Looks like it could be pretty entertaining, do you happen to have any more info on how it plays? Great job; you've got those real() commands down! Smile
first: thank you! im busy to update it, to add something like 6- and 7-letter words or maybe some 10-letter words.

i want to explain how it goes.
on the first way, you can choose if you are playing it with a friend or lonely.
if you choose the first, the calculator asks to give a 5-letter word and store it in a string. With the second choice, the calculator search a random word in an appvar (479 different words) and store that in a string.
Then the match will begin. Each time, you must enter a 5-letter word and if you press enter, it will check each letter of the word. A red square means that that letter is exactly at the same place as the word you want to find. A yellow round means that is is not at the same place, but IN the word. You understand? If not, search on YouTube for 'Lingo'

If ive improved it, i can upload it to the archives.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are GMT - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement