Omnimaga

Calculator Community => TI Calculators => Axe => Topic started by: Happybobjr on May 31, 2010, 07:27:12 pm

Title: i am a noob i wish for help
Post by: Happybobjr on May 31, 2010, 07:27:12 pm
ok i am extremely new at thiis
what is wrong with my prog.
all i know so far is that i think prompt is not supported
____________________________________________________
sry parents get on just to bug me and dont let me finish
_______________________________________________
also i am completely new at axe so things will look comppletely wrong
_________________________________________________
Code: [Select]
.AXEEE
0->A
1->B
Prompt {C}r
If {C}r less than or equal to 2
Stop
If Remainder({C}r,2)=(0)
A+1->A
While ({C}r//B)  greater than or equal to  (squareroot({C}r))
If Remainder({C}r,B)=(0)
A+1->A
B+2->B
If A greater than or equal to 2
Goto 1
End
Disp "PRIME"
Stop
Lbl 1
Disp "Composite"
Pause
Disp "BYE"
Title: Re: i am a noob i wish for help
Post by: _player1537 on May 31, 2010, 07:28:17 pm
it certainly is not.  I made an input routine, I forget where it went.  and...where is your program...?  Also, there is a command list in the .zip file, with documentation that will tell you how to get started
Title: Re: i am a noob i wish for help
Post by: LordConiupiter on June 01, 2010, 03:43:32 pm
ok i am extremely new at thiis
what is wrong with my prog.
all i know so far is that i think prompt is not supported
____________________________________________________
sry parents get on just to bug me and dont let me finish
_______________________________________________
also i am completely new at axe so things will look comppletely wrong
_________________________________________________
Code: [Select]
.AXEEE
0->A
1->B
Prompt {C}r
If {C}r less than or equal to 2
Stop
If Remainder({C}r,2)=(0)
A+1->A
While ({C}r//B)  greater than or equal to  (squareroot({C}r))
If Remainder({C}r,B)=(0)
A+1->A
B+2->B
If A greater than or equal to 2
Goto 1
End
Disp "PRIME"
Stop
Lbl 1
Disp "Composite"
Pause
Disp "BYE"
The Disp command does only support pointers, not strings like u did
so
Code: [Select]
Disp "BYE"
should be:
Code: [Select]
"BYE"->Str1
Disp Str1
Title: Re: i am a noob i wish for help
Post by: DJ Omnimaga on June 01, 2010, 03:47:49 pm
What is Remainder()? Also Axe doesn't support the Stop command.

Welcome here by the way :)
Title: Re: i am a noob i wish for help
Post by: Happybobjr on June 01, 2010, 06:49:20 pm
thanks for the help
i really appreciate this great community where people a patient and help others learn.  none of the "go away noob"
i really appreciate it.

the remainder command is a newer command on the ti-84 that came out with the new os that came out early this year ( the one enabling math-print )
basically

Disp Remainder(5,2)          "  5 divided by 2 "  2 and 1 over 2    remainder 1" "stuff in 1st grade"

outcome would be 1
Title: Re: i am a noob i wish for help
Post by: Deep Toaster on June 01, 2010, 07:06:06 pm
I'm new to Axe too, but I'm pretty sure this is the problem:

Axe doesn't just translate BASIC commands. It crates a totally separate language, so it only accepts the ones that it itself supports, and so most of the commands that you'd use in BASIC, like Remainder(, would not work in Axe.

And for those of you more experienced in Axe programming, I have a question too: Is it compatible with OS 2.53?
Title: Re: i am a noob i wish for help
Post by: DJ Omnimaga on June 01, 2010, 07:20:05 pm
thanks for the help
i really appreciate this great community where people a patient and help others learn.  none of the "go away noob"
i really appreciate it.

the remainder command is a newer command on the ti-84 that came out with the new os that came out early this year ( the one enabling math-print )
basically

Disp Remainder(5,2)          "  5 divided by 2 "  2 and 1 over 2    remainder 1" "stuff in 1st grade"

outcome would be 1
No problem,

Omnimaga promotes respect between members and welcome new members to encourage them to program and stuff  ^^

That said, I think what the issue is is what Deep Thought said. Only the commands listed in the "commands.html" file that comes with Axe parser will work.

And to awnser Deep Thought: yes it will work. It also works on TI-Nspire
Title: Re: i am a noob i wish for help
Post by: Ti-newb on June 01, 2010, 07:25:43 pm
Hi Happybobjr, I was new here like .. 8 months ago and im still a newb =D so no problem if ur a starter, lots of people can help you make ur programs.

Welcome to Omnimaga!!! =D
Title: Re: i am a noob i wish for help
Post by: ztrumpet on June 01, 2010, 07:47:36 pm
Welcome here!

Disp Remainder(5,2)          "  5 divided by 2 "  2 and 1 over 2    remainder 1" "stuff in 1st grade"
outcome would be 1
It sounds like modulus, which in Axe is represented with the ^.  For example, 5^2 = 1. ;D
I hope this helped! :D Good luck! :)
Title: Re: i am a noob i wish for help
Post by: Happybobjr on June 01, 2010, 11:02:43 pm
I'm new to Axe too, but I'm pretty sure this is the problem:

Axe doesn't just translate BASIC commands. It crates a totally separate language, so it only accepts the ones that it itself supports, and so most of the commands that you'd use in BASIC, like Remainder(, would not work in Axe.

And for those of you more experienced in Axe programming, I have a question too: Is it compatible with OS 2.53?


i changed to = int(  "interger" for new method that works as well if not better"
............................................
new question
is there any way to have commands such as prompt or input to work
if i have either it will give me err when compiling err.bad symbol
any way i can go around it so i can have a user input a number.
i have gotten this to work (w/o inputing the number) so that is the final step
i will try to add the code tomarrow.  its already 11:00 pm right now.
Title: Re: i am a noob i wish for help
Post by: Ti-newb on June 01, 2010, 11:14:32 pm
Input.. i cant find it in the Commands List.. so it is not supported.. but what u could do.. (a little more advanced..) is use the Getkey command.. im assuming u dont know what it does other then.. it "gets a key".. so heres a little tutorial

In Basic, Getkey would usually be used.. like Getkey-> (any variable.. for me.. i tend to pick G) G.. and if u run that through a loop, and press.. say the button Clear, it will give u a value of 45. in BASIC, the Getkey Command has everything as like.. a graph, but that is irrelevant. in AXE, you'll have to look at this: http://tibasicdev.wdfiles.com/local--files/key-codes/xlib-keys.png  

If ur still confused or uhh.. idk =D ask more questions, but experiment with it..
heres an example..

Repeat G=15 (15 is when u press Clear.. and when u do press 15, it'll exit the loop)
Getkey->G
If G
Output(1,1
Disp G >Decimal   (that > is the black triangle.. "Math, 2")
End
End

This should tell u the Values of the Pressed Buttons.
Title: Re: i am a noob i wish for help
Post by: _player1537 on June 01, 2010, 11:17:29 pm
typically for my code to check key value, I use
Code: [Select]
0-K
repeat K
getkey->K
end
disp K>dec
but yours works too.  Also I made an input routine a while ago, if you'd like I can search for it.

Edit:  here you go http://ourl.ca/4129/80803 (http://ourl.ca/4129/80803)
Title: Re: i am a noob i wish for help
Post by: Deep Toaster on June 01, 2010, 11:58:40 pm
i will try to add the code tomarrow.  its already 11:00 pm right now.

For some reason, the time difference still surprises me (pleasantly). We're all having conversations with people thousands of miles away.

I LOVE THE INTERNET. :D

Anyway, so the only form of input in Axe is through getKey?
Title: Re: i am a noob i wish for help
Post by: DJ Omnimaga on June 02, 2010, 12:03:10 am
yeah. There are two getkey methods too. One is similar to BASIC syntax and one is direct keypresses. getkey alone will return the key pressed code. Getkey(keycode) returns 1 or 0 depending if the key is pressed or not. The later method allows diagonal keypresses and faster keypresses
Title: Re: i am a noob i wish for help
Post by: Happybobjr on June 02, 2010, 03:54:45 pm
ok i looked at these when i was at school but unfortunatly i haven't found a way to bypass the restrictions on installing the ti drivers for the schools computers so i could not add this on but here it is
updated working code for prime and composite
graphics:1/5
working: 4/5  (number must be below 5)
code clean?: 2/5
effort: 3/5

Code: [Select]
.AX3
0=>H
0=>G
3=>B
Lbl 2
getKey=>G
If G=33:H*10H:End
If G=34:H*10=>H:H+1=>H:End
If G=26:H*10=>H:H+2=>H:End
If G=18:H*10=>H:H+3=>H:End
If G=35:H*10=>H:H+4=>H:End
If G=27:H*10=>H:H+5=>H:End
If G=19:H*10=>H:H+6=>H:End
If G=36:H*10=>H:H+7=>H:End
If G=28:H*10=>H:H+8=>H:End
If G=20:H*10=>H:H+9=>H:End
If H (not equal) 0:Output(5,1,H (black triangle) Dec):End
If G (not equal) 9:Goto 2:End
H=>C
If C^2=0:Goto 1:End
While (C/B)(greater than or equal to) squ(C)                 “squ = square root of”
If C^B=0
Goto 1:End
B+2=>B
End
"PRIME"=>Str1
Disp Str1
Goto (theta)
Lbl 1
"Composite"=>Str2
Disp Str2
Lbl (theta)
Pause 999
Title: Re: i am a noob i wish for help
Post by: meishe91 on June 02, 2010, 04:59:06 pm
I'm sorry, but what exactly is your program supposed to do? I haven't quite gotten that yet.

One thing I do notice though is that if this is in Axe then lines 3, 4, and 5 can be simplified to:

Code: [Select]
0→H→G+3→B
Title: Re: i am a noob i wish for help
Post by: Happybobjr on June 02, 2010, 05:15:55 pm
I'm sorry, but what exactly is your program supposed to do? I haven't quite gotten that yet.

One thing I do notice though is that if this is in Axe then lines 3, 4, and 5 can be simplified to:

Code: [Select]
0→H→G+3→B

prime and composite finder
Title: Re: i am a noob i wish for help
Post by: Happybobjr on June 02, 2010, 05:46:13 pm
i am open to any and all suggestions / corrections.
like figuring out if i can find if a number is prime or composite that is above 65000 or whatever the number is
Title: Re: i am a noob i wish for help
Post by: meishe91 on June 02, 2010, 06:09:45 pm
Ah ok, gotcha. Any particular reason you're doing it in Axe? Just curious :P

Also, please watch the double posting. Follow rule #3 (http://www.omnimaga.org/index.php?action=ezportal;sa=page;p=2) please.

I'll look at the code later, though I'm sure someone can do better than me when optimizing Axe.
Title: Re: i am a noob i wish for help
Post by: Happybobjr on June 02, 2010, 07:08:25 pm
the reason i am doing this in axe is because i want to learn axe
this is where most of the learning happens for me

sorry about double posting i didn't realize
i am glad to see i wasn't banned for a mistake :)
Title: Re: i am a noob i wish for help
Post by: ztrumpet on June 02, 2010, 07:13:01 pm
sorry about double posting i didn't realize
i am glad to see i wasn't banned for a mistake :)
Normally there isn't a problem with anything unless you do it on purpose multiple times.  Here you'll never be banned for a simple little "oops" like this. :)

Good luck on the prime and composite finder, and good luck learning Axe! ;D
Title: Re: i am a noob i wish for help
Post by: meishe91 on June 04, 2010, 02:17:32 am
Oh ok, gotcha. Just was curious since Axe is more game oriented, not math. But to each their own :)

Ya, like Z said. You're not going to be banned for stuff like that and I'm fairly sure cases have to be pretty extreme to get banned. DJ could answer that easier than me.
Title: Re: i am a noob i wish for help
Post by: DJ Omnimaga on June 04, 2010, 02:20:33 am
Usually for double-posting members will just tell people to not double post. If someone really abuses it, I can easily reset his post count to zero and rate down all his unnecessary double posts, though :P