CEMETECH
Leading The Way To The Future
Login [Register]
Username:
Password:
Autologin:

Don't have an account? Register now to chat, post, use our tools, and much more.
Latest Headlines
Online Users
There are 128 users online: 12 members, 86 guests and 30 bots.
Members: Ashbad, Carlos, geekboy1011, HOMER-16, JamesV, Link, matrefeytontias, souvik1997, xologist.
Bots: VoilaBot (1), MSN/Bing (1), Magpie Crawler (6), VoilaBot (4), Yahoo! Slurp (1), Googlebot (16), MSN/Bing (1).
RSS & Social Media
SAX
You must log in to view the SAX chat widget
    » Goto page Previous  1, 2, 3
» View previous topic :: View next topic  
Author Message
KermMartian


Site Admin


Joined: 14 Mar 2005
Posts: 55763
Location: Earth, Sol, Milky Way

Posted: 21 Feb 2012 10:26:42 pm    Post subject:

They being the programs that you compile from Grammer source code into Grammer executables. Also, I'm grading a Cemetech Contest 8 entry that uses Grammer! Huzzah.
_________________


Back to top
Xeda112358


Power User


Joined: 09 Nov 2010
Posts: 354

Posted: 22 Feb 2012 03:33:21 pm    Post subject:

Awesome! Also, Grammer does not compile source (yet) into executables. For Grammer, source==executable, (which is why you need the Grammer app on the calc, as well). Speaking of Grammer 2, I have an update. I am currently working on even better implementations of grayscale and it works nicely already. Actually, I rewrote the routine to update the LCD and it is now faster and updates in 3-level gray at all times. As default, though, the gray buffer and black buffer pointers point to the graph buffer to maintain a black/white appearance. To change the buffers:

Disp <<address>> will point the gray and black buffers pointers to <<address>>. This is to maintain back compatibility. Essentially, this exits grayscale.
Disp '<<address>> will point the black buffer to <<address>>.
Disp o<<address>> will point the gray buffer to <<address>>.
ClrDraw[<<address>>] will clear the black buffer if the <<address>> argument is not present, else it will clear the 768-byte buffer at <address>>.
Adding an extra argument to the Line( routine will draw a rectangle at that buffer. I plan to add this ability to all the other drawing commands as well, so they can draw to the gray or black buffers as needed.

Also, I added in two new options for Fill( to either set the screen or part of the screen "on fire."
Grammer 2


So now I have combined particles+fire, now I need to combine that with grayscale >.>
Back to top
Sorunome


Expert


Joined: 22 Feb 2011
Posts: 636
Location: Somewhere out there

Posted: 23 Feb 2012 03:45:27 am    Post subject:

That is....cool! Smile
_________________



Back to top
flyingfisch


Super-Expert


Joined: 02 Feb 2012
Posts: 896
Location: Akron, OH

Posted: 23 Feb 2012 10:02:58 am    Post subject:

would it be hard to get a grammar like programming language on the prizm?
_________________



Back to top
KermMartian


Site Admin


Joined: 14 Mar 2005
Posts: 55763
Location: Earth, Sol, Milky Way

Posted: 23 Feb 2012 10:48:11 am    Post subject:

flyingfisch wrote:
would it be hard to get a grammar like programming language on the prizm?
For the Prizm, I feel like we'd almost be better off with a very lightweight Python interpreter or something, since we have the processing power and the memory to fit such things.

Edit: Also, Xeda, thanks for keeping up your hard work, and thanks for ceding to my screenshot request. Smile
_________________


Back to top
Xeda112358


Power User


Joined: 09 Nov 2010
Posts: 354

Posted: 23 Feb 2012 10:47:50 pm    Post subject:

I have wanted and intended to port Grammer to the Prizm, but I am making no promises.

@Kerm: It was no problem, I understand Smile Is linking to images on other sites any kind of burden? I often link to lots of screenies :/
Back to top
yeongJIN_COOL


Member


Joined: 28 Apr 2011
Posts: 161

Posted: 24 Feb 2012 07:08:04 am    Post subject:

This code seems to not work and I can't see anything wrong I have done. Sad


Code:

0→B
ClrDraw
Repeat getKey=15
If !randInt(0,4
Then
randInt(0,11→C
For(A,0,C
Pxl-On(0,randInt(0,92
End
End
Text('50,0,B
DispGraph
Tangent(1,1
B+1→B
End
Stop


it works for a while and it kinda stops (idk if it froze or not, but it let me quit vio ON button)
Back to top
KermMartian


Site Admin


Joined: 14 Mar 2005
Posts: 55763
Location: Earth, Sol, Milky Way

Posted: 24 Feb 2012 08:19:08 am    Post subject:

Xeda112358 wrote:
I have wanted and intended to port Grammer to the Prizm, but I am making no promises.

@Kerm: It was no problem, I understand Smile Is linking to images on other sites any kind of burden? I often link to lots of screenies :/
No, linking is great and not a problem at all. I'm miserly with the disk space on my shared hosting; I've managed to keep Cemetech around just over a gigabyte of data for over a year now.
_________________


Back to top
Xeda112358


Power User


Joined: 09 Nov 2010
Posts: 354

Posted: 24 Feb 2012 08:12:39 pm    Post subject:

Ah, nice Smile And for Yeong, the issue is that C is sometimes 0. To fix it, try randInt(1,12 and For(A,1,C Smile I added in an error handler so that when it got stuck and you break it with ON, it stores the value of C to the OS var C so you can check it out Smile To set up the error handler, use solve(3,Lbl "<<labelname>> and at label name you can do this:

Code:

solve(3,Lbl "ERRHANDLE ;initiates the error handler
<<program code>>
Stop
.ERRHANDLE    ;label name is ERRHANDLE
→θ'           ;Ans will be initiated with the error code
C→iC          ;Stores C to the OS var C
solve(4,θ'    ;Lets Grammer run it from here
End           ;Not really needed, since solve(4 will exit the parser
Back to top
Xeda112358


Power User


Joined: 09 Nov 2010
Posts: 354

Posted: 29 Apr 2012 11:16:05 am    Post subject:

I am now working on the last stretch of Grammer 2. I will not have internet in one week, so i hope to have everything tidied up by then Smile

-I am rewriting the readme and tutorial
-I am making any final additions and bug fixes
-I have to finish the documentation for assembly programmers who want to use the Grammer calls

So for the past few hours, I have been working on the main menu. The menu items now all do something, so they aren't just place holders.
Exit will exit.
Hook will toggle the token hook
Appv will toggle between showing programs or appvars
Asm will only display programs with an assembly header (only compiled assembly programs).
Gram will show only programs with a Grammer header. For interpreted programs, this is .0: and for assembly, it is BB6D55C9.

As a note, this will not run BASIC programs. If it runs a non-asm program, it is run as a Grammer program, regardless of the header (this is because you can create subprograms for Grammer programs that don't have the header).

So here is a sloppy screenie:

And the download: (just the .8kx)
Grammer.8xk
Back to top
Xeda112358


Power User


Joined: 09 Nov 2010
Posts: 354

Posted: 06 Jun 2012 08:02:05 pm    Post subject:

Some more work that I have done with Grammer lets you draw lines using patterns. Merth has been bugging me to add these, so I rewrote the line drawing routine to allow patterns and support full clipping Very Happy I finished it yesterday and I have since found out that raycasting in Grammer code is not very fast :/



No release quite yet, though, the internet is rather buggy for me and uploading takes close to forever :/
Back to top
Xeda112358


Power User


Joined: 09 Nov 2010
Posts: 354

Posted: 06 Oct 2012 08:12:52 am    Post subject:

I remembered a feature yesterday that I never added to Grammer 2, so I am trying to figure out how to implement it. Basically, the feature is just a parser hook for Grammer. I have two ideas for implementing it:

1) Make it so that apps can install such hooks to Grammer. This way, apps can extend the command set.

2) Make it so that unrecognised tokens are directed to program code (similar to how errors can be redirected and handled by the program). If I do this option, I will use the token "?" as a pointer to the program code so that the programmer can parse arguments as needed. If I do this, programmers will be able to use functions that can have arguments passed to them easier.

Also, I have about 100 more bytes to work with. I am going to work on option 2 first, but if there is overwhelming requests for option 1, I will try to add that, too Smile
Back to top
KermMartian


Site Admin


Joined: 14 Mar 2005
Posts: 55763
Location: Earth, Sol, Milky Way

Posted: 06 Oct 2012 09:41:36 am    Post subject:

Xeda112358 wrote:
[...]I finished it yesterday and I have since found out that raycasting in Grammer code is not very fast :/

That looks more like Mode7 than raycasting to me, to be honest. Smile But still cool stuff.

With regards to your last post, option 2 sounds good enough to me; good luck implementing it.
_________________


Back to top
Xeda112358


Power User


Joined: 09 Nov 2010
Posts: 354

Posted: 06 Oct 2012 11:49:49 am    Post subject:

Ah, okay. If I had turned those squares into cubes, then would it have been raycasting? (That was what I was working towards when I made that, originally)

As to the option 2, I have it almost working. You can now treat a subroutine as a function that you can pass arguments to by using prgm( instead of prgm. I am having a slight problem with passing the unrecognised tokens to the error handler. Well, actually, I am having issues with exiting the error handler because Grammer backs up Ans and restores it. This means that you cannot return a result in Ans :/ I am trying to make some way to signal Grammer not to restore Ans.
Back to top
Xeda112358


Power User


Joined: 09 Nov 2010
Posts: 354

Posted: 09 Oct 2012 11:23:13 am    Post subject:

I have completed the features mentioned before, but I also realised that I never showed off one of my other commands that I added at the end of May. The Input command looks very snazzy at this point (a huge improvement over the original). You can add an argument to the Input command to draw text after what you are inputting. Since Input starts taking input at the last on screen text location, input looks great for functions! Also, I added in highlighting, DEL and Clear now delete the whole token, and only keys that correspond to a token register.



Anyways, I thought it was worth some eyecandy Smile
The code for that program in the screenie is:

Code:

.0:Return
ClrDraw
Text(°"(x,y)=(           ;ClrDraw sets the cursor to (0,0), so I can use °
expr(Input ",)→X         ;I get the next input here. The string is ,)
Text(,+1                 ;This increments the X coordinate.
expr(Input ")→Y          ;This gets the Y value.
Pxl-On(Y,X               ;Or whatever you want to do with the coordinates.
DispGraph
Stop
Back to top
KermMartian


Site Admin


Joined: 14 Mar 2005
Posts: 55763
Location: Earth, Sol, Milky Way

Posted: 10 Oct 2012 12:17:13 am    Post subject:

Some eye-candy indeed! I'd like to know more about how you wrote that variable-width font text input routine, especially considering how many headaches I dealt with the summer that I wrote the DCS GUI API and had to wrestle with the intricacies of backspacing a character in the middle of a line that might affect several lines down the screen. It looks great as shown.
_________________


Back to top
Xeda112358


Power User


Joined: 09 Nov 2010
Posts: 354

Posted: 11 Oct 2012 06:01:22 pm    Post subject:

Oh, there is no handling for variable width font. That will be for a future version, but I didn't even attempt it here. This routine just sticks with the fixed width font (4x6). However, since Grammer stores the string in a buffer, it can check what token it is deleting, find the width and height of the string in pixels, then it could simply erase that region of the screen. Since Grammer uses its own font routines and syntax for storing fonts, this wouldn't be difficult except for the fact that there is about 30 bytes of code space left.
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
» View previous topic :: View next topic  
Page 3 of 3 » All times are GMT - 5 Hours

 
Jump to:  
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

© Copyright 2000-2013 Cemetech & Kerm Martian :: Page Execution Time: 0.043958 seconds.