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 1, 2, 3, 4, 5, 6, 7  Next
» View previous topic :: View next topic  
Author Message
nitacku


Advanced Member


Joined: 23 Aug 2005
Posts: 408

Posted: 10 Feb 2009 06:57:10 pm    Post subject:

As a student, I find myself creating many small programs during my classes. Some are games and others are just random curiosities, but they are all small and can be coded in about 5 minutes or less. After being a student for so long, I've had the time, or rather unfortunate opportunity (i should be listening to the teacher right?) to accumulate many of these programs. Now years later, and still a student (just with little less free time as before), I am sharing these programs. Every day, or at least every week, I intend to post the code to a random 5 minute program. As I do not have an infinite supply of 5 minute programs, I am also taking suggestions, just to keep my programming thinking active. If I can create your suggestion in less than 30 minutes, I'll post it. After all, it's the coding part that takes 5 minutes, not necessarily the design part.

Since everyone here is also a student (or was at one time), you are free to post your 5 minute programs as well.
I look forward to sharing some creative ideas and seeing some of your creations!

Here is the index of current Five Minute Programs:
  1. Racer [nitacku]
  2. 15 #'s [nitacku]
  3. Snake [[color=#696969]home screen][/color] [color=#c0c0c0]— [/color][nitacku]
  4. Chat Messenger [nitacku]
  5. Button Masher [luby] 84+/SE only
  6. Snake [[color=#696969]graph Screen][/color] [nitacku]
  7. Analog Clock [nitacku] 84+/SE only
  8. Graph Screen Menu [nitacku]
  9. TinyMine [color=#c0c0c0]— [/color][nitacku]
  10. Reflex [color=#c0c0c0]— [/color][ztrumpet]
  11. Whack A Mole [[color=#696969]home screen][/color] [color=#c0c0c0]— [/color][woodswolf] 84+/SE only
  12. Whack A Mole [[color=#696969]graph screen][/color] [color=#c0c0c0]— [/color][ztrumpet]
  13. Pig [color=#c0c0c0]— [/color][dxfan101010]
  14. Text Messenger [color=#c0c0c0]— [/color][shadowking]
  15. Logic Simplifier [color=#c0c0c0]— [/color][Weregoose]
  16. Roman Numeral Converter [color=#c0c0c0]— [/color][Ed H]



Racer
ClrHome
For(θ,0,13
Disp "//no space
Output(8,5,"*░░░░░░* //6 spaces
End
SetUpEditor L1 //this is the list
7→dim(L1
Fill(5.7,L1
8→X
5→Y
7→θ
DelVar Z
Repeat X≤int(Ans) or X≥int(Ans)+10fPart(Ans
Z+1→Z
θ-not(fPart(.03Ans→θ
getKey
X+(Ans=26)-(Ans=24→X
Y+int(2-3rand
Ans-(Ans+θ>16)+not(Ans→Y
Disp "//no space
Output(1,X,8
Output(8,Ans,"*
Output(8,Ans+θ,"*
∆List(cumSum(augment(L1,{Ans+.1θ→L1
Ans(1
End
Output(4,1,"Crash! Score:
Output(4,14,Z


Last edited by Guest on 21 Jun 2010 11:50:34 pm; edited 1 time in total
Back to top
nitacku


Advanced Member


Joined: 23 Aug 2005
Posts: 408

Posted: 12 Feb 2009 04:24:10 pm    Post subject:

Today's five minute program is:

15 #'s
ClrHome
seq(X,X,1,15→L1
rand(15→L2
SortA(L2,L1
DelVar [A]
{4,4→dim([A]
[A]→[B]
For(X,1,4
For(Y,1,4-(X>3
L1(4X+Y-4→[A](X,Y
Output(X,3Y,Ans
4X+Y-4→[B](X,Y
End
End
4→X
Repeat [A]=[B] or Ans=45
If max(Ans={24,25,26,34
Then
Ans→θ
X→A
Y→B
X+(θ=26 and X<4)-(θ=24 and X>1→X
Y+(θ=34 and Y<4)-(θ=25 and Y>1→Y
If A≠X or B≠Y
Then
[A](B,A→θ
[A](Y,X→[A](B,A
Output(B,3A,"
░░ //2 spaces
Output(B,3A,Ans
θ→[A](Y,X
Output(Y,3X,"░░
//2 spaces
End
End
getKey
End


Last edited by Guest on 21 Jun 2010 11:51:35 pm; edited 1 time in total
Back to top
TI-newb


Member


Joined: 24 Dec 2008
Posts: 158

Posted: 14 Feb 2009 08:49:16 pm    Post subject:

Can you make a Snake Game?

that would actually be pretty cool.

Using the Graph or Homescreen, i want to learn from the programs you make xD so that would be cool
Back to top
TI-newb


Member


Joined: 24 Dec 2008
Posts: 158

Posted: 14 Feb 2009 09:19:33 pm    Post subject:

Repeat X≤int(Ans) or X≥int(Ans)+10fPart(Ans

On the Racer game, i have found that even if u are far away from the wall. you still lose, so i decided to go through your code and see what went wrong, turns out "this is like one of the only things i know about ur program" at the part where it has "Repeat X≤int(Ans) or X≥int(Ans)+10fPart(Ans" it would be better to have it "Repeat X≤int(Ans) or X≥int(Ans)+70fPart(Ans
Back to top
nitacku


Advanced Member


Joined: 23 Aug 2005
Posts: 408

Posted: 16 Feb 2009 01:52:51 am    Post subject:

A snake game you say?
Alright a snake game it is!

The nice feature about this code is it allows the snake to "wrap" around the boundaries, so when you exit the right side of the screen it reappears at the left side! It really adds a nice twist to an old classic.

Snake [Homescreen]
ClrHome
6→X
4→Y
0→Z
4.06→θ
SetUpEditor L1 //this is the list
{Ans,Ans,Ans→L1
26
Repeat max(Y+.01X=L1
If Ans=24 or Ans=26
Then
Ans-25→A
DelVar B
End
If Ans=34 or Ans=25
Then
int(.25(Ans-29→B
DelVar A
End
If Y+.01X=θ
Then
Z+1→Z
Repeat not(max(Ans=L1
randInt(1,8)+.01randInt(1,16
End
Ans→θ
Output(int(Ans),E2fPart(Ans),"*
augment(L1,{Y+.01X→L1
End
Output(int(L1(1)),E2fPart(L1(1)),"░ //1 space
∆List(cumSum(augment(L1,{Y+.01X→L1
Y+B
Ans-8((Ans>8)-not(Ans→Y
X+A
Ans-16((Ans>16)-not(Ans→X
Output(Y,X,"M
getKey
End
ClrHome
Disp "CRASHED!","SCORE:
Output(2,8,Z


btw, my highscore is 44. It starts to become really challenging when the snake grows to about 30 links.


Last edited by Guest on 21 Jun 2010 11:52:29 pm; edited 1 time in total
Back to top
N.cruz


Newbie


Joined: 17 Feb 2009
Posts: 7

Posted: 17 Feb 2009 03:10:57 pm    Post subject:

HI nitacku

i'm from Portugal and I think ur programs are realy great.... and i would like to know if u have any messenger trade program...

like I have my calc and want to comunicate with another calc using a cable....


I love the snake program

but I put, in the place where shoud be a "M" ( the snake ), an "*" and where shoud be an "*"(the feed) I put a "º"...


keep with ur programs, they are realy great....

A question... where can I learn how to do those things? ^^

CUMPS Smile
Back to top
Harrierfalcon
The Raptor of Calcs


Super Elite (Last Title)


Joined: 25 Oct 2006
Posts: 2535

Posted: 17 Feb 2009 09:24:08 pm    Post subject:

Hello N.Cruz, and welcome to United-TI!

It's always nice to see new people interested in this stuff, A good place to start is TI Basic Developer, more commonly referred to as TI|BD.

A lot of other things can be found out in this forum. Keep your head up, look in the Undocumented Tricks thread, and you're bound to pick up something sooner or later.

And on a more offtopic note, (try to stay on topic as much as possible >_<), would the "N" in your name possibly stand for "Noel"?
Back to top
nitacku


Advanced Member


Joined: 23 Aug 2005
Posts: 408

Posted: 17 Feb 2009 11:16:05 pm    Post subject:

N. Cruz, here is the Messenger program you requested.
It took me forever to figure out how to get the calcs to communicate back and forth. In order for one calc to access the other, the sending calc has to be in an idle mode (pause, input, promt, ect...). This means that the calcs have to alternate being in idle mode and receiving mode, but how do you tell the calculator which one is supposed to receive at the start of the program? The solution arrived out of the problem itself. When one calculator is in receive mode, a Get( command to that calculator will not modify the variable of the calculator performing the command. In other words, the calculator who's variable is unchanged at the start of the program is the idle calculator and the other one becomes the receiving calculator. It's sort of confusing, so see the code below as well.

The site that Harrierfalcon linked to is an excellent source for beginners and experts alike. I myself visit there to learn about functions/methods. In fact, I referenced TI|BD on using the Get( command in the code below Very Happy.

Chat Messenger
ClrHome
πe→X //pi * e (Euler's constant)
Get(X
If X=πe //pi * e (Euler's constant)
Then
0→X
Else
X=ππ→X //pi * pi
End
Repeat 0
"*→Str1
not(X→X
If Ans
Then
ππ→X //pi * pi
Input "Send: ",Str1
ClrHome
Disp "","Please wait a","moment and then","press enter
0→X
Get(X
If X
Disp "","and tell other","user to press","enter //yes, you can put the smiley face in the code too!
1→X
Pause
Else
ClrHome
Output(7,1,"Waiting
Output(8,1,"for reply...
Repeat Str1≠"*
Get(Str1
End
ClrHome
Output(5,1,"Received: "+Str1
End
End


Last edited by Guest on 21 Jun 2010 11:53:45 pm; edited 1 time in total
Back to top
Galandros


Active Member


Joined: 29 Aug 2008
Posts: 565

Posted: 18 Feb 2009 10:15:04 am    Post subject:

Bem-vindo N.Cruz para o fórum da UnitedTI!!!
Surpreendido?

hahaha just saying welcome. Very Happy "It is a small world, after all!" - Disney

I also have some "5" minutes programs floating. And some are made during math classes. They are mostly math stuff:
I figured out an way to discover the monotony of a function ("monotonia" is the name I say in classes), this is, if it increases or decreases in y. Quite fast and simple. I also made a fasssst way to see a function parity, made some time ago.
Concluding, I have lots of useful math programs but I am lazzy to translate and finish the reunion on 1 program. I have to finish it this weekend.

PS: N.Cruz qualquer ajuda em português podes mandar por MP (ou PM em inglês)
Back to top
thornahawk
μολών λαβέ


Active Member


Joined: 27 Mar 2005
Posts: 569

Posted: 18 Feb 2009 11:50:38 am    Post subject:

@Galandros: "monotonicity" is the English word you're looking for. :)

Do post your math programs, I'd like to see 'em (and maybe even offer some suggestions).

thornahawk
Back to top
Galandros


Active Member


Joined: 29 Aug 2008
Posts: 565

Posted: 18 Feb 2009 03:21:16 pm    Post subject:

thornahawk wrote:
@Galandros: "monotonicity" is the English word you're looking for. :)

Do post your math programs, I'd like to see 'em (and maybe even offer some suggestions).

thornahawk
Thanks. I will need help to translate all the terms and feedback is very welcome. Honestly, I haven't tried to search them in google or wolfram but it should be hard, I suppose. I wrote some of them way back to my not optimized coding days. So I am also in process of find them and optimize.
But I will make a post for my math stuff soon. Right now I am in a wave of organizing folders and sync pc files in order to uncover some more math things from ticalc downloads days. hehehehe And making a recent backup of everything so far.
Back to top
N.cruz


Newbie


Joined: 17 Feb 2009
Posts: 7

Posted: 19 Feb 2009 05:51:06 pm    Post subject:

hi again...


to Galandros

well as u guys see my english its not good so try to understand me pls ^^

first The "N" in my name comes from my first name ( Nichollas ) its a greek name ;)

second yes I will try to stay in the topic because i'm realy facinated about this stuf...

A question... ( how do you know portuguese? )

ant now to nitacku

thanks for the program... i don´t test it yet but i will whem I can :)

Cumps...

I'm working on a program... i will post it as soon as I can...

^^ thks again


Last edited by Guest on 19 Feb 2009 05:54:34 pm; edited 1 time in total
Back to top
Galandros


Active Member


Joined: 29 Aug 2008
Posts: 565

Posted: 20 Feb 2009 04:01:00 pm    Post subject:

errr... I am Portuguese. If you see in the left of my replies, in my quick profile "From: Portugal".
And from the fact of needing help to translate math terms you could induce that I am Portuguese.
Do I could pass as natural English speaker? :ninja:

Anyway I am writing my topic about math. And my simpler unoptimized snake: (in 5 minutes rushed so no big thing)
[quote name='"BASIC Code"']::
:"COBRA
:ClrHome
:4→A
:4→B
:0→C
:0→D
:0→F
:Repeat F
:Output(A,B,"O
:getKey→K
:If K
:Then
: (K=26)-(K=24→C
:‾(K=25)+(K=34→D
:End
:Output(A,B,"
:A+D→A
:B+C→B
:If B=17 or B=0
:Then
: (B=17)+16(B=0→B
:End
:If A=0 or A=9
:Then
: (A=9)+8not(A→A
:End
:rand(5
:End
Generated by SourceCoder, © 2005 Cemetech[/quote]
EDIT: solved a smile issue


Last edited by Guest on 20 Feb 2009 04:01:49 pm; edited 1 time in total
Back to top
N.cruz


Newbie


Joined: 17 Feb 2009
Posts: 7

Posted: 20 Feb 2009 04:13:29 pm    Post subject:

Since my English is worse than yours... you pass as a natural English speaker ^^

by the way... if you're Portuguese you can teach me how to made programs ... or teach me the basics... ( em portugues claro =P ).
I already tried to learn from the TI|BD but ... bad english ... ^^

I'll see your snake game (cobra ^^ lol), Then I will coment it ^^ :)


Cumps
Back to top
TI-newb


Member


Joined: 24 Dec 2008
Posts: 158

Posted: 21 Feb 2009 09:20:11 pm    Post subject:

i can't wait to try out the snake program, and the messenger one, this is awsome!

your really good with the 5 min programs. -im a fan of Nitacku now xDDD Nita
Back to top
N.cruz


Newbie


Joined: 17 Feb 2009
Posts: 7

Posted: 22 Feb 2009 06:40:36 am    Post subject:

RE: TI-newb

I had to tell you that the snake program surprised me .... its really simple and give you perfect times in math class :D

the messenger, despite of being me who request it, I had no time to test it yet. but I believe thats great like the others one

CUMPS ^^
Back to top
luby
I want to go back to Philmont!!


Calc Guru


Joined: 23 Apr 2006
Posts: 1477

Posted: 22 Feb 2009 12:32:09 pm    Post subject:

I've got a five minute program that seems to have captured the attention of everybody in my calc class.
(actually, it's like 15 because I went back and added the highscore and false start thing later)
BUTTON MASHER:

SetUpEditor LKEY
If 2=dim(LKEY:Then
LKEY(1→rand:rand:rand
if Ans!=LKEY(2
0→LKEY(2
End
Disp "Get Ready
rand(30
Disp "Set
Repeat 20=randInt(10,30
If getKey:Then
Disp "False Start
Stop
End
End
StartTmr→A
0:Repeat 1=checkTmr(A
getkey
end
if Ans:Then:Disp "False Start
Stop:End
Disp "GO!!
Repeat 11=checkTmr(A) //need to leave the last parenthesis on
If getKey
Ans+1
End
Disp Ans
Ans→X
if not(dim(LKEY
{0→LKEY
if X>LKEY(1:Then
Disp "HIGH SCORE!!!!!!
X→rand:rand:rand
{X,Ans→LKEY
End
rand(40
"


Last edited by Guest on 11 Jul 2010 06:19:35 pm; edited 1 time in total
Back to top
N.cruz


Newbie


Joined: 17 Feb 2009
Posts: 7

Posted: 22 Feb 2009 03:55:53 pm    Post subject:

RE: Luby

hi

The linerider its really funny...
Looks like some games we find in the INTERNET xD



I have a doubt... where can I fond the "LKEY" ...

is it the letter "L" ??

thks


Last edited by Guest on 22 Feb 2009 04:03:09 pm; edited 1 time in total
Back to top
Snipes17


Advanced Newbie


Joined: 07 May 2008
Posts: 62

Posted: 22 Feb 2009 04:01:22 pm    Post subject:

Quote:
RE: Luby

hi I have a doubt... where can I fond the "LKEY" ...

is it the letter "L" ??

thks


The "LKey" is a list. The little L in front of Key is found in the list menu (2nd+Stat) under the "Ops" header. Then spell out "Key". Does that help?
Back to top
lordofthegeeks


Advanced Member


Joined: 13 Jul 2007
Posts: 280

Posted: 22 Feb 2009 05:01:04 pm    Post subject:

@luby... That game looks very familiar... I rember seeing it in a old basic programs book from the 80s
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 1, 2, 3, 4, 5, 6, 7  Next
» View previous topic :: View next topic  
Page 1 of 7 » All times are UTC - 5 Hours

 

Advertisement