This is an archived, read-only copy of the United-TI subforum , including posts and topic from May 2003 to April 2012. If you would like to discuss any of the topics in this forum, you can visit Cemetech's TI-BASIC subforum. Some of these topics may also be directly-linked to active Cemetech topics. If you are a Cemetech member with a linked United-TI account, you can link United-TI topics here with your current Cemetech topics.

This forum is locked: you cannot post, reply to, or edit topics. TI-Basic => TI-BASIC
United-TI Archives -> TI-Basic
 
    » Goto page Previous  1, 2, 3, 4, 5, 6, 7  Next
» View previous topic :: View next topic  
Author Message
woodswolf


Advanced Newbie


Joined: 26 Feb 2009
Posts: 53

Posted: 08 Jun 2009 06:32:50 am    Post subject:

Without going off-topic to much, I like how you put someone else their codes up your list too! Respect!

Here's my code I actually uploaded somewhere else:


Code:
Whack A Mole!
:Delvar C
:Output(1,1,"+--------------+!(xx)x(xx)x(xx)!!x)(xxx)(xxx)(x!!(xx)x(xx)x(xx)!!x)(xxx)(xxx)(x!!(xx)x(xx)x(xx)!+--------------+!Score:xxxxxxxx! // x = space
:Starttimer->D
:Lbl 0
:Output(8,8,C
:int(9rand->X
:int(1+X/3->A
:X-3A+3->B
:Output(2A,3+5B,"{}
:Repeat A-1=iPart(Ans) and B=10fPart(Ans
:.1(getkey-72
:If 30=Checktimer(D
:Goto 1
:End
:Output(2A,3+5B,"xx // x = space
:C+1->C
:Goto 0
:Lbl 1
:Output(8,13,"WIN
:Pause

Can only be played on a ti84+. This is not the anti-cheat version, I lost that one so...
Back to top
ztrumpet


Active Member


Joined: 06 May 2009
Posts: 555

Posted: 08 Jun 2009 08:25:56 am    Post subject:

I have Whack A Mole!
Our versions are very different. Mine works on a 83 and is on the graphscreen. His is nice too. :)

Code:
FnOff
AxesOff
GridOff
ClrDraw
0->Xmin:1->ΔX
0->Ymin:1->ΔY
Text(-1,20,62,"WHACK
Text(-1,29,74,"A
Text(-1,38,65,"MOLE
{54,44,41,31,28,18,15,5->L2
{55,45,40,30,25,15->L1
For(A,1,5,2
For(B,1,7,2
Line(L1(A),L2(B),L1(A),L2(B+1
Line(L1(A+1),L2(B),L1(A+1),L2(B+1
Line(L1(A),L2(B),L1(A+1),L2(B
Line(L1(A),L2(B+1),L1(A+1),L2(B+1
End
End
DelVar L1DelVar L2DelVar SDelVar M250->T
Text(3,64,"TIME:
Text(10,60,"SCORE:
While T>0
If not(M
Then
1+iPart(4rand->A
1+iPart(3rand->B
Text(13A-3,15B+3,"*
1->M
End
1+B+10(A+6
If getKey=Ans
Then
Text(13A-3,15B+3,"     //5 spaces
DelVar MS+1->S
End
T-1->T
If T=99 or T=9
Text(3,82,"           //11 spaces
Text(3,82,T
Text(10,82,S
End
Text(-1,51,63,"TIME!

Use the number pad, [0], [.], and [-] to Whack the Mole.


My high score is 55. (On a 83+)

Edit: @nitacku- Thanks for putting my reflex program on your list! :)

Edit from 6.5 hours later: @nitacku again- NO WAY!!!!!! You're the person who made AI Checkers! I never knew that. Can you explain the AI?


Last edited by Guest on 08 Jun 2009 02:59:00 pm; edited 1 time in total
Back to top
dxfan101010


Member


Joined: 31 Mar 2008
Posts: 194

Posted: 08 Jun 2009 10:31:15 pm    Post subject:

Ok Here is my version of pig Its pretty short 504(bytes) But its not fully optimized




Code:
[color=#0000FF]Delvar CDelvar PDelvar XDelvar D
0/->/T
ClrHome
Repeat P>100 or C>100
If T=0:Then
Output(1,4,"CPU Turn //1 space
Output(2,3,"Roll:
Output(7,1,"CPU
Randint(1,6/->/R
Output(2,9,R
If R=1:Then
1/->/T
Delvar XDelvarR
Output(2,9,"  //2 spaces
Output(6,1,"   //3 spaces
1/->/T
End
End
End
If T=1
Output(1,4,"Your Turn
Output(7,14,"You
Getkey/->/K
If k=105
Randint(1,6/->/R
Output(2,9,R
If R=1:Then
0/->/T
0/->/X
0/->/R
Output(2,9,"  //2 spaces
Output(6,14,"   //3 spaces
End
If R>1:Then
X+R/->/X
Outut(6,14,X
End
End
If K=21 And T=0:Then
0/->/T
P+X/->/X
Delvar X
Output(8,14,P
Output(6,14,"   //3 spaces
End
End
ClrHome
If C>100:Then
For(X,1,100
Output(4,4,You loose
End
End
If P>100:Then
For(X,1,100
Output(4,4,You Win
End
End
ClrHome
"[/color]


If you find any glitches or ways to cheat please tell me so i can fix them if you cant figure out how to play enter rolls and 2nd stops


Last edited by Guest on 09 Jun 2009 03:27:26 pm; edited 1 time in total
Back to top
ztrumpet


Active Member


Joined: 06 May 2009
Posts: 555

Posted: 09 Jun 2009 08:37:50 am    Post subject:

GLITCH!!!!!!!!!!!!!!!!!!!!!!!!!!

dxfan101010 wrote:
Output(2,9,R
Randint(1,6/->/R

If you find any glitches or ways to cheat please tell me so i can fix them if you cant figure out how to play enter rolls and 2nd stops

The RandInt and Output lines need to be swapped. (RandInt then Output)


Last edited by Guest on 09 Jun 2009 08:38:35 am; edited 1 time in total
Back to top
dxfan101010


Member


Joined: 31 Mar 2008
Posts: 194

Posted: 09 Jun 2009 03:26:12 pm    Post subject:

ztrumpet wrote:
GLITCH!!!!!!!!!!!!!!!!!!!!!!!!!!
The RandInt and Output lines need to be swapped. (RandInt then Output)


ooops ok i fixed that and also This
IF K=21:Then

should be

IF K=21 And T=0 :Then
Back to top
Steelersfan1693


Newbie


Joined: 04 Dec 2008
Posts: 32

Posted: 16 Oct 2009 12:24:19 pm    Post subject:

Thank you that was vey generous!
Back to top
Steelersfan1693


Newbie


Joined: 04 Dec 2008
Posts: 32

Posted: 16 Oct 2009 12:49:31 pm    Post subject:

ztrumpet wrote:
I have Whack A Mole!
Our versions are very different. Mine works on a 83 and is on the graphscreen. His is nice too. Smile

Code:
FnOff
AxesOff
GridOff
ClrDraw
0->Xmin:1->ΔX
0->Ymin:1->ΔY
Text(-1,20,62,"WHACK
Text(-1,29,74,"A
Text(-1,38,65,"MOLE
{54,44,41,31,28,18,15,5->L2
{55,45,40,30,25,15->L1
For(A,1,5,2
For(B,1,7,2
Line(L1(A),L2(8),L1(A),L2(B+1
Line(L1(A+1),L2(8),L1(A+1),L2(B+1
Line(L1(A),L2(8),L1(A+1),L2(B
Line(L1(A),L2(B+1),L1(A+1),L2(B+1
End
End
DelVar L1DelVar L2DelVar SDelVar M250->T
Text(3,64,"TIME:
Text(10,60,"SCORE:
While T>0
If not(M
Then
1+iPart(4rand->A
1+iPart(3rand->B
Text(13A-3,15B+3,"*
1->M
End
1+B+10(A+6
If getKey=Ans
Then
Text(13A-3,15B+3,"     //5 spaces
DelVar MS+1->S
End
T-1->T
If T=99 or T=9
Text(3,82,"           //11 spaces
Text(3,82,T
Text(10,82,S
End
Text(-1,51,63,"TIME!

Use the number pad, [0], [.], and [-] to Whack the Mole.


My high score is 55. (On a 83+)

Edit: @nitacku- Thanks for putting my reflex program on your list! :)

Edit from 6.5 hours later: @nitacku again- NO WAY!!!!!! You're the person who made AI Checkers! I never knew that. Can you explain the AI?
Back to top
GloryMXE7
Puzzleman 3000


Active Member


Joined: 02 Nov 2008
Posts: 604

Posted: 16 Oct 2009 03:18:22 pm    Post subject:

I don't see how you thought it was necessary to quote that and not even add anything to it, but I guess it doesn't matter.

Last edited by Guest on 16 Oct 2009 03:19:00 pm; edited 1 time in total
Back to top
Weregoose
Authentic INTJ


Super Elite (Last Title)


Joined: 25 Nov 2004
Posts: 3976

Posted: 16 Oct 2009 06:00:44 pm    Post subject:

And double posting, no less. Steelersfan1693, remember what the moderator's reactions were to this last time? ;)

Just try to be a little more formal. This isn't like a YIM session in here, exactly.


Last edited by Guest on 16 Oct 2009 06:02:57 pm; edited 1 time in total
Back to top
Steelersfan1693


Newbie


Joined: 04 Dec 2008
Posts: 32

Posted: 20 Oct 2009 10:30:31 am    Post subject:

Weregoose wrote:
And double posting, no less. Steelersfan1693, remember what the moderator's reactions were to this last time? ;)

Just try to be a little more formal. This isn't like a YIM session in here, exactly.

Whats Yim
Back to top
Weregoose
Authentic INTJ


Super Elite (Last Title)


Joined: 25 Nov 2004
Posts: 3976

Posted: 20 Oct 2009 11:30:59 am    Post subject:

Protip: In the time that I spent writing this reply, you could have already found your answer. Try Google and/or Wikipedia.

Last edited by Guest on 20 Oct 2009 11:31:09 am; edited 1 time in total
Back to top
dxfan101010


Member


Joined: 31 Mar 2008
Posts: 194

Posted: 20 Oct 2009 02:07:43 pm    Post subject:

Weregoose wrote:
Protip: In the time that I spent writing this reply, you could have already found your answer. Try Google and/or Wikipedia.

Yeah Google. :ninja:

...赵辉
Back to top
kinkoa


Member


Joined: 28 Jul 2009
Posts: 103

Posted: 18 Nov 2009 01:58:15 pm    Post subject:

i made two programs textapp and textapp2 that are calc linking programs, very easy to code and fast

here it is textapp
program:textapp
:clrhome
:output(1,1,"to send a message type it after pressing [2nd] and [alpha] and press enter, to exit press [2nd] and [mode]
:pause
:clrhome
:lbl 1
:input "msg: ",str0
:getcalc(str8
:disp str8
:goto 1


and textapp2
program:textapp
:clrhome
:output(1,1,"to send a message type it after pressing [2nd] and [alpha] and press enter, to exit press [2nd] and [mode]
:pause
:clrhome
:lbl 1
:input "msg: ",str8
:getcalc(str0
:disp str0
:goto 1


run textapp on one calc and textapp2 on the other and it works very quickly but it has some flaws such as if you send multiple messages they will only see the last one and the other flaw is that if you send multiple messages you will get the same message back repeatedly if they have not pressed enter


Last edited by Guest on 01 Jul 2010 10:17:07 am; edited 1 time in total
Back to top
TI-newb


Member


Joined: 24 Dec 2008
Posts: 158

Posted: 18 Nov 2009 10:09:22 pm    Post subject:

Im very happy this thing is still being posted on =D. U know what? i think il post 1 prgm soon.
Back to top
Weregoose
Authentic INTJ


Super Elite (Last Title)


Joined: 25 Nov 2004
Posts: 3976

Posted: 23 Nov 2009 04:32:52 am    Post subject:

Nothing too spectacular. Insert any arrangement of logical operations on two variables to receive a simplified result:

:Input Str1:0
:For(A,0,1
:For(B,0,1
:Ans+expr(Str1)10^(2A+B
:End:End
:sub("0░░░not(A or BB░░░B or not(AA and not(Bnot(B░░A or B1░░░A and Bnot(A
xor BB and not(Anot(A░░A░░░A or not(BA xor Bnot(A and B",1+64fPart(Ans/16),4

"A xor not(B or not(A" outputs the equivalent "A and B," and the classic "not(A) and not(B)" returns "not(A or B."

The last line of the program should look like this in the editor:

:sub("0´´´not(A
or BB´´´B or not
(AA and not(Bnot
(B´´A or B 1´´´A
´and B not(A xor
´BB and not(Anot
(A´´A´´´A or not
(BA xor B not(A
and B",1+64fPart
(Ans/16),4


Last edited by Guest on 01 Jul 2010 10:17:23 am; edited 1 time in total
Back to top
Galandros


Active Member


Joined: 29 Aug 2008
Posts: 565

Posted: 23 Nov 2009 04:36:51 am    Post subject:

Weregoose wrote:
Nothing too spectacular. Insert any arrangement of logical operations on two variables to receive a simplified result:

:Input Str1:0
:For(A,0,1
:For(B,0,1
:Ans+expr(Str1)10^(2A+B
:End:End
:sub("0░░░not(A or BB░░░B or not(AA and not(Bnot(B░░A or B1░░░A and Bnot(A
xor BB and not(Anot(A░░A░░░A or not(BA xor Bnot(A and B",1+64fPart(Ans/16),4

"A xor not(B or not(A" outputs the equivalent "A and B," and the classic "not(A) and not(Cool" returns "not(A or B."

The last line of the program should look like this in the editor:

:sub("0´´´not(A
or BB´´´B or not
(AA and not(Bnot
(B´´A or B 1´´´A
´and B not(A xor
´BB and not(Anot
(A´´A´´´A or not
(BA xor B not(A
and B",1+64fPart
(Ans/16),4

This is actually useful... xor is rarely used in TI-BASIC mostly because it is hard to see when it can be used. Apart from toggling a variable that serves as a flag, I almost don't use it anywhere else.


Last edited by Guest on 01 Jul 2010 10:18:26 am; edited 1 time in total
Back to top
Flofloflo


Member


Joined: 07 Nov 2007
Posts: 120

Posted: 23 Nov 2009 06:27:30 am    Post subject:

[quote name='TI-newb' post='131990' date='Mar 15 2009, 04:53 PM']i just read my own post, and i didn't get what i was trying to say... so lemme repeat

it's like a Getkey, this Program... actually it is, so it uses Getkeys instead of the Input "..:",A and so i get the Value of what im typing down right away instead of Typine it down on Input and then pressing Enter..
But i think i have given up on it anyways...[/quote]

I once made that for a 'braintrain' game where you'd get random equations to solve ("5+7=?, 9/3=?") so it could keep track of how much time you'd take for solving something like, 20 equations.
It's fun to make, and probably can be useful... To do so, you need to make a formula that converts the keypress values of the numbers into 1,2,3,4,5,6,7,8,9, that formula is probably somewhere among the brainteasers Wink.
I guess its not that hard to think of some games that utilise it actualy Smile I might try that again sometime...
Back to top
ztrumpet


Active Member


Joined: 06 May 2009
Posts: 555

Posted: 23 Nov 2009 03:59:07 pm    Post subject:

Galandros wrote:
xor is rarely used in TI-BASIC mostly because it is hard to see when it can be used. Apart from toggling a variable that serves as a flag, I almost don't use it anywhere else.

I've used xor numerous times. The two main times I think I use it are:
1: Draw a checkerboard pattern. Like this:
:For(A,1,16
:For(B,1,8
:Output(B,A,sub("8O",1+not(fpart(A/2) xor fpart(B/2)),1
:End
:End

2: The second is just for optimization. The most recent time I used it was in the Sort code for Oasis, as it determines if it sorts for All or Mirage Programs.


Last edited by Guest on 01 Jul 2010 10:16:49 am; edited 1 time in total
Back to top
GloryMXE7
Puzzleman 3000


Active Member


Joined: 02 Nov 2008
Posts: 604

Posted: 23 Nov 2009 06:27:00 pm    Post subject:

I also use Xor alot when using xlib.
Back to top
TI-newb


Member


Joined: 24 Dec 2008
Posts: 158

Posted: 23 Nov 2009 07:23:40 pm    Post subject:

FloFloFlo, thanks for the idea =D(I think i might work on making that into a SubPrgm).

And heres for my Post:

I am currently doing Graphing in Math, and i figured finding the Length (Distance between the two points), Midpoint and Slope anoying. So, i decided to make a Prgm that takes your two points (X,Y,X,Y) into the stuff. (Its not done yet, ive only had about 15 mins to work on this, so i still need to finish "Length")

!!!- BTW!! When you RUN THE PRGM and get to the Input part that asks.. X,Y,X,Y:... You have to type down "{" (Because this prgm uses the List to store the coordinates, the input has to start off as "{".. So for example.. X,Y,X,Y:{5,3,10,13)


:ClrHome
:Input "X,Y,X,Y:",L1
:ClrHome
:Disp L1 //Just to remind you about the coordinates you put down, and for me to see if the prgm is working correctly..
:Output(2,1,"GRAPH INFO:(5 Spaces)SLOPE:(10 Spaces)MIDPOINT:X=(14spaces)Y=(5 Spaces)LENGTH:"
:Output(4,13,(L1(1)+L1(3))/2
:Output(5,13,(L1(2)+L1(4))/2
:Output(3,13,(L1(4)-L1(2))/L1(3)-L1(1))

=D. If you find any problems in this prgm, tell me, and il just Breakdown whats the prgm doing now (For the people who are currently Starting prgming..)

Input"X,Y,X,Y:" //gets the X and Y coordinates into the List L1.
Disp L1 //shows the Coordinates you have placed into L1
Output(2,1"Graphinfo Ect..) // I just figured i would do this instead of putting down alot of Output( functions..
Output(4,13 Ect.. // Displays the Midpoint Between X1, and X2
Output(5,13 Ect.. // Displays the Midpoint Between Y1 and Y2
Output(3,13 Ect.. // Displays the Slope of the coordinates.


Last edited by Guest on 23 Nov 2009 07:25:11 pm; edited 1 time in total
Back to top
Display posts from previous:   
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
    » Goto page Previous  1, 2, 3, 4, 5, 6, 7  Next
» View previous topic :: View next topic  
Page 5 of 7 » All times are UTC - 5 Hours

 

Advertisement