Author Topic: jBasic  (Read 28155 times)

0 Members and 1 Guest are viewing this topic.

Offline Eeems

  • Mr. Dictator
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6265
  • Rating: +318/-36
  • little oof
    • View Profile
    • Eeems
jBasic
« on: April 30, 2010, 06:33:00 pm »
http://future_history.freehostia.com/jBasic/jBasic.html
I am working on making a JavaScript library to help people transition from TI-Basic to JavaScript. I have only made a text() command and a dispScrn() command. dispScrn() is used to create the screen area so all other commands work.
I'll work on a tutorial soon, well after I make a few more commands.
/e

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55941
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: jBasic
« Reply #1 on: April 30, 2010, 06:34:58 pm »
nice will this be some new language that is parsed as javascript but has a syntax like TI-BASIC? It would be nice to be able to do web apps this way

Offline Eeems

  • Mr. Dictator
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6265
  • Rating: +318/-36
  • little oof
    • View Profile
    • Eeems
Re: jBasic
« Reply #2 on: April 30, 2010, 06:39:14 pm »
no, its a JavaScript library, so kind of like added commands that are more familiar to TI-Basic users. It will also have it's own look and everything that will remind you of the TI-Screen.

EDIT: added a pixelOn() command, so now you have basic drawing capabilities :D
EDIT2: added a sprite() command for displaying images anywhere and at any size.
« Last Edit: April 30, 2010, 06:59:54 pm by Eeems »
/e

Offline Eeems

  • Mr. Dictator
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6265
  • Rating: +318/-36
  • little oof
    • View Profile
    • Eeems
Re: jBasic
« Reply #3 on: April 30, 2010, 07:12:57 pm »

Tutorial

Code: [Select]
<html>
 <head>
  <title>
   Page Title
  </title>
  <script src="jBasic.js"></script>
  <script>
   function setup(){
    //Place code here.
   }
  </script>
 </head>
 <body onload="gScreen = document.getElementById('window');setup();">
  <div id="window">
  </div>
 </body>
</html>
Use this basic setup and place any JavaScript in the '//Place code here.' line. Add any content you want between the <body> tags

Commands

dispScrn(w,h,x,y)
creates the window that the content is displayed in.
w = width in pixels
h = height in pixels
x = x location from the left of the screen in pixels
y = y location from the top of the screen in pixels

text(x,y,size,text)
Writes text on the screen.
x = x location from the left of the screen in pixels.
y = y location from the top of the screen in pixels.
size = text size in pixels
text = text content, can include html code for more advanced purposes.

pixelOn(x,y,color,w,h)
creates a block on the screen.
x = x location from the left of the screen in pixels.
y = y location from the top of the screen in pixels.
color = color of the block, can be in hex or named.
w = width in pixels
h = height in pixels

sprite(x,y,w,h,src)
places an image on the screen.
x = x location from the left of the screen in pixels.
y = y location from the top of the screen in pixels.
w = width in pixels
h = height in pixels
src = the source of the image, can be a relative URL or a direct link.

jBasic.js can be found here:  http://future_history.freehostia.com/jBasic/jBasic.js
« Last Edit: April 30, 2010, 07:23:43 pm by Eeems »
/e

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55941
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: jBasic
« Reply #4 on: April 30, 2010, 07:37:30 pm »
Nice, seems like it could do some interesting stuff :)

Offline Eeems

  • Mr. Dictator
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6265
  • Rating: +318/-36
  • little oof
    • View Profile
    • Eeems
Re: jBasic
« Reply #5 on: April 30, 2010, 08:07:13 pm »
Thanks :) I've put way too much time into figuring out the basic stuff x.x
I'll be adding more later, and I'll probably make an extended set for more functionality as well
/e

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55941
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: jBasic
« Reply #6 on: April 30, 2010, 08:46:23 pm »
Cool :D
* DJ Omnimaga hopes Eeems didn't kill his calc projects including ADE, tho o.o

Offline Eeems

  • Mr. Dictator
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6265
  • Rating: +318/-36
  • little oof
    • View Profile
    • Eeems
Re: jBasic
« Reply #7 on: April 30, 2010, 10:00:33 pm »
Well ADE kind of already died, but i haven't killed my mario physics engine yet. I'm just focusing on projects that get me marks at school right now.
/e

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55941
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: jBasic
« Reply #8 on: April 30, 2010, 10:08:30 pm »
aw sorry to hear :/ why did you kill it btw? I hope you aren't slowly quitting calc stuff x.x

Offline Eeems

  • Mr. Dictator
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6265
  • Rating: +318/-36
  • little oof
    • View Profile
    • Eeems
Re: jBasic
« Reply #9 on: April 30, 2010, 10:25:02 pm »
I killed it because i needed to get on to more projects so i can get my full credits in computers. I may come back to it later though.
No I'm still into programming calcs, but i dont have the time to do it much right now.
/e

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55941
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: jBasic
« Reply #10 on: April 30, 2010, 11:04:31 pm »
Oooh ok phew, I was getting worried since most of your posts in the last month were non calc related. I hope when school is finished that you can do calc stuff again (and get your calc back)

Offline Eeems

  • Mr. Dictator
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6265
  • Rating: +318/-36
  • little oof
    • View Profile
    • Eeems
Re: jBasic
« Reply #11 on: May 01, 2010, 12:52:38 am »
Don't worry, I'll code for calcs for a very long time. Its what got me started on programming after all :p

I just added a line() command and a clrGraph() command as well.

line(Ax,Ay,Bx,By,w,color)
Draws a line on the screen.
Ax = the initial x location in pixels
Ay = the initial y location in pixels
Bx = the second x location in pixels
By = the second y location in pixels
w = the width of each line piece on the line
color = the color of the line. Can be hex or color name.
/e

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55941
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: jBasic
« Reply #12 on: May 01, 2010, 01:16:25 am »
nice :D

Offline Galandros

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1140
  • Rating: +42/-10
    • View Profile
Re: jBasic
« Reply #13 on: May 01, 2010, 03:25:44 am »
Interesting. For now the code will look much like JavaScript but later when you added most stuff, it will be similar to BASIC, I think.
Don't forget to bring the Math.functions to a normal function.

I will keep updated about this.
Hobbing in calculator projects.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55941
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: jBasic
« Reply #14 on: May 01, 2010, 11:05:54 am »
I wonder, in Javascript, are there any possibility of interaction from the user by pressing keys? Otherwise I guess a point and click game could be awesome too when it has more commands