Omnimaga: The Coders Of Tomorrow
Welcome, Guest. Please login or register.
 
Omnimaga: The Coders Of Tomorrow
26 May, 2013, 09:10:45 *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   home   news downloads projects tutorials misc forums rules new posts irc about Login Register  
+-OmnomIRC

You must Register, be logged in and have at least 40 posts to use this shout-box! If it still doesn't show up afterward, it might be that OmnomIRC is disabled for your group or under maintenance.

Note: You can also use an IRC client like mIRC, X-Chat or Mibbit to connect to an EFnet server and #omnimaga.

Pages: [1] 2   Go Down
  Print  
Author Topic: Find the error in a beginner's program -  (Read 655 times) Bookmark and Share
0 Members and 1 Guest are viewing this topic.
persalteas
LV5 Advanced (Next: 300)
*****
Offline Offline

Gender: Male
Last Login: 20 May, 2013, 09:44:41
Date Registered: 10 January, 2011, 22:09:50
Location: Savoie-France
Posts: 202


Topic starter
Total Post Ratings: +33

View Profile WWW
« on: 25 April, 2012, 13:59:41 »
0

Hello, first I have a question: who programs with Grammer here ? Just Xeda ?


Then I would these programers to tell we where are my error(s) in this program:

It's a base converter from decimal. (it is supposed to be  Grin )

The display always starts with a value that I didn't ask for, and then the right value.


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
:.0:Return→B
:ClrDraw
:Line(1,5,9,95,6
:Line(0,6,9,95,6
:Text(8,5,"Base Converter
:/Text(18,0,"Base ?
:DispGraph
:expr(Input →G
:/Text(18,0,"Valeur Décimale ?
:DispGraph
:expr(Input →AC'
:/Text(30,0,"= "
:Text('°AC',G
:DispGraph
:Repeat getkey
:End
:If =15
:Goto B
:ClrDraw:DispGraph
:Stop

And then, I have some questions about the Input command:

- is there a mean to forbid other tokens than alphanumeric ? (like pressing a key [stat],[On] etc...)
- When should the "two-points" appear on the screen ? Before or after pressing the first key ?  (ow my syntax...  <_< )
- The text in the Input is displayed like with /Text(  , letter-by-letter. Is that normal ?
Logged


Sorunome
Muffins
LV11 Super Veteran (Next: 3000)
***********
Offline Offline

Gender: Male
Last Login: Yesterday at 22:05:13
Date Registered: 26 September, 2011, 17:46:38
Location: Ponyville
Posts: 2952


Total Post Ratings: +161

View Profile WWW
« Reply #1 on: 25 April, 2012, 14:11:27 »
0

Damn, grammer changed quite a lot since I last programmed with it O.o
And if these should be commented lines, they need a double-slash (//)
Logged

http://z0r.de/4017
http://www.youtube.com/watch?v=BFOoazEx9lU
http://www.sorunome.de
http://reubenquest.net
+++++++[>++++++++++++<-]>.<+++[>----<-]>.---.<++++[>>++++++++<<-]>>.<++.------.++++++++++++.--------.

++++++[>++++++++++<-]>++++++++.<+++[>+++++++++++<-]>.+++++++++++++.--.<+++[>+++<-]>.<+++[>>++++++++++<<-]>>++.<<+++++++[>-------<-]>.<+++[>+++++++++++++<-]>..+++++++.<+++[>-----<-]>--.<++[>++++++<-]>++.

If OmnomIRC is screwed up, blame me Tongue

Save Derpy!(http://www.youtube.com/watch?v=cg-_HeVNYOk)
Spoiler for spoilers:


Spoiler for languages:
- TI-BASIC
 - TI-Highbrid Basic
 - Grammer
 - Axe
 - HTML
 - JavaScript
 - CSS
 - PHP
 - C++
 - lua
 - Python
 - MYSQL
 - Brainf*ck
 - English
 - German
Spoiler for internet:
/image/36691.png[/img]
Gimme internet NOW
Spoiler for me:
Spoiler for my little game:
my little game...my little game..aaaaaahhhhhh...my little game, i used to wonder how to lose the game, my little game, until you shared its losing with me. take the losing and the game, a beutiful game so losable, sharing losing is a easy sweat and losing makes it aweful neat to have my little game togeather with my very best games.
Spoiler for stuff:
Spoiler for derpy:



jsj795
LV9 Veteran (Next: 1337)
*********
Offline Offline

Gender: Male
Last Login: 26 April, 2013, 03:43:03
Date Registered: 28 July, 2009, 22:10:35
Location: __̴ı̴̴̡̡̡ ̡͌l̡̡̡ ̡͌l̡*̡̡ ̴̡ı̴̴̡ ̡̡͡|̲̲̲͡͡͡ ̲▫̲͡ ̲̲̲͡͡π̲̲͡͡ ̲̲͡▫̲̲͡͡ ̲|̡̡̡ ̡ ̴̡ı̴̡̡ ̡͌l̡̡̡̡.___
Posts: 1087


Total Post Ratings: +81

View Profile
« Reply #2 on: 25 April, 2012, 14:29:15 »
0

I believe Yeong also programs in grammer. I don't, so I can't really help you Sad
Logged



Spoiler for funny life mathematics:
1. ROMANCE MATHEMATICS
Smart man + smart woman = romance
Smart man + dumb woman = affair
Dumb man + smart woman = marriage
Dumb man + dumb woman = pregnancy
2. OFFICE ARITHMETIC
Smart boss + smart employee = profit
Smart boss + dumb employee = production
Dumb boss + smart employee = promotion
Dumb boss + dumb employee = overtime
3. SHOPPING MATH
A man will pay $2 for a $1 item he needs.
A woman will pay $1 for a $2 item that she doesn't need.
4. GENERAL EQUATIONS & STATISTICS
A woman worries about the future until she gets a husband.
A man never worries about the future until he gets a wife.
A successful man is one who makes more money than his wife can spend.
A successful woman is one who can find such a man.
5. HAPPINESS
To be happy with a man, you must understand him a lot and love him a little.
To be happy with a woman, you must love her a lot and not try to understand her at all.
6. LONGEVITY
Married men live longer than single men do, but married men are a lot more willing to die.
7. PROPENSITY TO CHANGE
A woman marries a man expecting he will change, but he doesn't.
A man marries a woman expecting that she won't change, and she does.
8. DISCUSSION TECHNIQUE
A woman has the last word in any argument.
Anything a man says after that is the beginning of a new argument.

Girls = Time * Money (Girls are a combination of time and money)
Time = Money (Time is money)
Girls = Money squared (So, girls are money squared)
Money = sqrt(Evil) (Money is also the root of all evil)
Girls = sqrt(Evil) squared (So, girls are the root of all evil squared)
Girls = Evil (Thus, girls are evil)
*Girls=Evil credit goes to Compynerd255*
Sorunome
Muffins
LV11 Super Veteran (Next: 3000)
***********
Offline Offline

Gender: Male
Last Login: Yesterday at 22:05:13
Date Registered: 26 September, 2011, 17:46:38
Location: Ponyville
Posts: 2952


Total Post Ratings: +161

View Profile WWW
« Reply #3 on: 25 April, 2012, 15:25:06 »
0

Yeah, Yeong is quite good at grammer Smiley
Logged

http://z0r.de/4017
http://www.youtube.com/watch?v=BFOoazEx9lU
http://www.sorunome.de
http://reubenquest.net
+++++++[>++++++++++++<-]>.<+++[>----<-]>.---.<++++[>>++++++++<<-]>>.<++.------.++++++++++++.--------.

++++++[>++++++++++<-]>++++++++.<+++[>+++++++++++<-]>.+++++++++++++.--.<+++[>+++<-]>.<+++[>>++++++++++<<-]>>++.<<+++++++[>-------<-]>.<+++[>+++++++++++++<-]>..+++++++.<+++[>-----<-]>--.<++[>++++++<-]>++.

If OmnomIRC is screwed up, blame me Tongue

Save Derpy!(http://www.youtube.com/watch?v=cg-_HeVNYOk)
Spoiler for spoilers:


Spoiler for languages:
- TI-BASIC
 - TI-Highbrid Basic
 - Grammer
 - Axe
 - HTML
 - JavaScript
 - CSS
 - PHP
 - C++
 - lua
 - Python
 - MYSQL
 - Brainf*ck
 - English
 - German
Spoiler for internet:
/image/36691.png[/img]
Gimme internet NOW
Spoiler for me:
Spoiler for my little game:
my little game...my little game..aaaaaahhhhhh...my little game, i used to wonder how to lose the game, my little game, until you shared its losing with me. take the losing and the game, a beutiful game so losable, sharing losing is a easy sweat and losing makes it aweful neat to have my little game togeather with my very best games.
Spoiler for stuff:
Spoiler for derpy:



Hayleia
Programming Absol
LV11 Super Veteran (Next: 3000)
***********
Offline Offline

Last Login: Today at 07:18:37
Date Registered: 01 June, 2011, 20:12:47
Location: ud-ud ?
Posts: 2059


Total Post Ratings: +256

View Profile
« Reply #4 on: 25 April, 2012, 15:32:45 »
0

I believe Yeong also programs in grammer. I don't, so I can't really help you Sad
Yeah, Yeong is quite good at grammer Smiley
I believe he is also writing a tutorial (but in English), if you need help
(I am talking to persalteas, even if I quoted everyone but him Tongue)
Logged





Spoiler for what I am according to...:
me: useless
Pokemon Test: an Absol
turiqwalrus: an eggplant
p2: A HUMAN BEING !
Blackpilar and p2: iplantonlyplantwantplanttoplantknowplantifplantyouplantareplantaplantboyplantorplantaplantgirlplant
click here to know where you got your last +1s
persalteas
LV5 Advanced (Next: 300)
*****
Offline Offline

Gender: Male
Last Login: 20 May, 2013, 09:44:41
Date Registered: 10 January, 2011, 22:09:50
Location: Savoie-France
Posts: 202


Topic starter
Total Post Ratings: +33

View Profile WWW
« Reply #5 on: 25 April, 2012, 16:04:11 »
0

Okay...

*persalteas poke Yeong...  (or Xeda, sure)
« Last Edit: 25 April, 2012, 16:04:36 by persalteas » Logged


Yeong
Eternally Young Scarlet Moon
LV12 Extreme Poster (Next: 5000)
************
Offline Offline

Gender: Male
Last Login: 20 May, 2013, 01:44:48
Date Registered: 15 October, 2010, 04:29:49
Location: Arden, NC
Posts: 3694


Total Post Ratings: +260

View Profile
« Reply #6 on: 30 April, 2012, 01:54:00 »
0

I just saw this topic.
I'll have to leave soon, but I'll get you the answer by tomorrow Wink
EDIT: Actually, your code is not wrong, but it's input itself. It somehow stores "14" in A when I tried with number 255.
« Last Edit: 30 April, 2012, 02:09:31 by TBO_Yeong » Logged

Project Redemption....

My project progresses:HERE
My Pastebin stuffs:HERE
Check your rate: HERE
My Animations: HERE
Spoiler for Images :D:

ノ◕ヮ◕)ノ:・゚ PENGUIN WAVE!!:„ø¤º°¨ ¨°º¤KEEP THE PENGUIN GOING ¸„ø¤º°¨ ¨°º¤øº LETS GO PENGUIN !¤¤º°¨¨°º¤øº¤ø„¸¸ø¤º°¨„ ø¤º°¨¨°º
persalteas
LV5 Advanced (Next: 300)
*****
Offline Offline

Gender: Male
Last Login: 20 May, 2013, 09:44:41
Date Registered: 10 January, 2011, 22:09:50
Location: Savoie-France
Posts: 202


Topic starter
Total Post Ratings: +33

View Profile WWW
« Reply #7 on: 30 April, 2012, 17:07:11 »
0

Do you know how to solve the problem ?

storing 0 in A before the Input ?
Logged


Xeda112358
Xombie. I am it.
Coder Of Tomorrow
LV12 Extreme Poster (Next: 5000)
*
Offline Offline

Last Login: 23 May, 2013, 22:01:23
Date Registered: 31 October, 2010, 08:46:36
Location: Land of Little Cubes and Tea, NY
Posts: 3760


Total Post Ratings: +611

View Profile
« Reply #8 on: 30 April, 2012, 17:46:34 »
0

Okay, I believe the problem is just that you have :expr(Input →AC' Input will not normally handle numbers >65535 x.x. I also changed a few things:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
:.0:             ;This line gets ignored because it starts with "."
:Return→B
:ClrDraw
:Line(1,5,9,95,6
:Line(0,6,9,95,6
:Text(8,5,"Base Converter
:/Text(18,0,"Base ?
:DispGraph
:expr(Input →G
:/Text(18,0,"Valeur Décimale ?
:DispGraph
:expr(Input →A  ;
:/Text(30,0,"= "
:Text('°A,G
:DispGraph
:Repeat         ;Added a space here. Just a single space means it uses the last value
:getkey         ;"Repeat getKey" does not change ans
:End
:If =15
:Goto B
:ClrDraw:DispGraph
:Stop

By the way, it looks nice o.o
Logged



Grammer Download (2.29.04.12)
Latest update (possibly incomplete)
My pastebin
Spoiler for FileSyst:
FileSyst is an application that provides a folder and filesystem for the TI-83+/84+ calculators. It is designed to be easy to access and use in BASIC, and it can be used to access game files and save data, or to create a command prompt, among other things:

Spoiler for Graphiti:
This is a graph explorer for graph theory. It will require lots of work to finish. Currently you can:
Add/delete vertices
Add edges (direction not shown, but they are directed)
Arrange vertices in a circle (in the future, you will be able to define levels of rings and the number of nodes in each)
Create complete graphs quickly

Plans:
Add adjacency matrix viewer
Deleting edges
Multiple graphs support
Arrows for directed graphs
Planarity testing
Matrix operations
Weighted edges
Chromatic polynomials
Chromatic numbers

Spoiler for Stats:

Samocal             [o---------]
Virtual Processor   [o---------]
EnG                 [oo--------]
Grammer             [ooo-------]
AsmComp             [ooo-------]
Partex              [oooo------]
BatLib              [oooooooo--]
Grammer82           [----------]
Grammer68000        [----------]


Pseudonyms:  Zeda, Xeda, Thunderbolt
Languages:   English, français
Programming: z80 Assmebly
             Grammer
             TI-BASIC (83/84/+/SE, 89/89t/92)
Known For:   -Creator of the Grammer programming language
              (Winning program of zContest2011)
             -BatLib- One of the most feature packed libraries for BASIC programmers available
              with over 100 functions and a simple programming language
             -Learning to program z80 in hexadecimal before using an assembler (no computer was
              available!)
╔═╦╗░╠═╬╣▒║ ║║▓╚═╩╝█


persalteas
LV5 Advanced (Next: 300)
*****
Offline Offline

Gender: Male
Last Login: 20 May, 2013, 09:44:41
Date Registered: 10 January, 2011, 22:09:50
Location: Savoie-France
Posts: 202


Topic starter
Total Post Ratings: +33

View Profile WWW
« Reply #9 on: 30 April, 2012, 18:06:28 »
0

OK, Thanks Smiley

but

1
2
3
:Repeat         ;Added a space here. Just a single space means it uses the last value
:getkey         ;"Repeat getKey" does not change ans
:End

Is one byte heavier...
Logged


Xeda112358
Xombie. I am it.
Coder Of Tomorrow
LV12 Extreme Poster (Next: 5000)
*
Offline Offline

Last Login: 23 May, 2013, 22:01:23
Date Registered: 31 October, 2010, 08:46:36
Location: Land of Little Cubes and Tea, NY
Posts: 3760


Total Post Ratings: +611

View Profile
« Reply #10 on: 30 April, 2012, 18:07:47 »
0

Yeah Undecided But otherwise, your next line would not work:

1
2
If =15
Goto B
Logged



Grammer Download (2.29.04.12)
Latest update (possibly incomplete)
My pastebin
Spoiler for FileSyst:
FileSyst is an application that provides a folder and filesystem for the TI-83+/84+ calculators. It is designed to be easy to access and use in BASIC, and it can be used to access game files and save data, or to create a command prompt, among other things:

Spoiler for Graphiti:
This is a graph explorer for graph theory. It will require lots of work to finish. Currently you can:
Add/delete vertices
Add edges (direction not shown, but they are directed)
Arrange vertices in a circle (in the future, you will be able to define levels of rings and the number of nodes in each)
Create complete graphs quickly

Plans:
Add adjacency matrix viewer
Deleting edges
Multiple graphs support
Arrows for directed graphs
Planarity testing
Matrix operations
Weighted edges
Chromatic polynomials
Chromatic numbers

Spoiler for Stats:

Samocal             [o---------]
Virtual Processor   [o---------]
EnG                 [oo--------]
Grammer             [ooo-------]
AsmComp             [ooo-------]
Partex              [oooo------]
BatLib              [oooooooo--]
Grammer82           [----------]
Grammer68000        [----------]


Pseudonyms:  Zeda, Xeda, Thunderbolt
Languages:   English, français
Programming: z80 Assmebly
             Grammer
             TI-BASIC (83/84/+/SE, 89/89t/92)
Known For:   -Creator of the Grammer programming language
              (Winning program of zContest2011)
             -BatLib- One of the most feature packed libraries for BASIC programmers available
              with over 100 functions and a simple programming language
             -Learning to program z80 in hexadecimal before using an assembler (no computer was
              available!)
╔═╦╗░╠═╬╣▒║ ║║▓╚═╩╝█


persalteas
LV5 Advanced (Next: 300)
*****
Offline Offline

Gender: Male
Last Login: 20 May, 2013, 09:44:41
Date Registered: 10 January, 2011, 22:09:50
Location: Savoie-France
Posts: 202


Topic starter
Total Post Ratings: +33

View Profile WWW
« Reply #11 on: 30 April, 2012, 18:09:22 »
0

euh....

yes, it works... That wasn't a problem, it worked fine...
Logged


Yeong
Eternally Young Scarlet Moon
LV12 Extreme Poster (Next: 5000)
************
Offline Offline

Gender: Male
Last Login: 20 May, 2013, 01:44:48
Date Registered: 15 October, 2010, 04:29:49
Location: Arden, NC
Posts: 3694


Total Post Ratings: +260

View Profile
« Reply #12 on: 30 April, 2012, 21:21:46 »
0

If Grammer works the way that xeda had not intended it to do, just understand: Grammer has its own AI.
Logged

Project Redemption....

My project progresses:HERE
My Pastebin stuffs:HERE
Check your rate: HERE
My Animations: HERE
Spoiler for Images :D:

ノ◕ヮ◕)ノ:・゚ PENGUIN WAVE!!:„ø¤º°¨ ¨°º¤KEEP THE PENGUIN GOING ¸„ø¤º°¨ ¨°º¤øº LETS GO PENGUIN !¤¤º°¨¨°º¤øº¤ø„¸¸ø¤º°¨„ ø¤º°¨¨°º
persalteas
LV5 Advanced (Next: 300)
*****
Offline Offline

Gender: Male
Last Login: 20 May, 2013, 09:44:41
Date Registered: 10 January, 2011, 22:09:50
Location: Savoie-France
Posts: 202


Topic starter
Total Post Ratings: +33

View Profile WWW
« Reply #13 on: 30 April, 2012, 21:23:25 »
0

Just try it, you will see... The getkey is stored in Ans, even with my code... It works.

If you press enter, the program restarts, if you press another key, it exits.
Logged


Yeong
Eternally Young Scarlet Moon
LV12 Extreme Poster (Next: 5000)
************
Offline Offline

Gender: Male
Last Login: 20 May, 2013, 01:44:48
Date Registered: 15 October, 2010, 04:29:49
Location: Arden, NC
Posts: 3694


Total Post Ratings: +260

View Profile
« Reply #14 on: 30 April, 2012, 21:24:03 »
0

I think xeda think it didn't works because the slight hold of the key makes it look like it doesn't work.
Logged

Project Redemption....

My project progresses:HERE
My Pastebin stuffs:HERE
Check your rate: HERE
My Animations: HERE
Spoiler for Images :D:

ノ◕ヮ◕)ノ:・゚ PENGUIN WAVE!!:„ø¤º°¨ ¨°º¤KEEP THE PENGUIN GOING ¸„ø¤º°¨ ¨°º¤øº LETS GO PENGUIN !¤¤º°¨¨°º¤øº¤ø„¸¸ø¤º°¨„ ø¤º°¨¨°º
Pages: [1] 2   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Powered by MySQL Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Powered by PHP
Page created in 0.311 seconds with 31 queries.
Skin by DJ Omnimaga edited from SMF default theme with the help of tr1p1ea.
All programs, games and songs avaliable on this website are property of their respective owners.
Best viewed in Opera, Firefox, Chrome and Safari with a resolution of 1024x768 or above.