Author Topic: Ruben - simple interpreter  (Read 9866 times)

0 Members and 1 Guest are viewing this topic.

Aurel

  • Guest
Ruben - simple interpreter
« on: September 22, 2014, 09:35:44 AM »
Hi to all...
If anyone wish to try how work or to see how is created this small and simple
direct or tokenized interpreter written in Oxygen basic in attachment is complete
release with source code .
Every part of interpreter and code editor is written in Oxygen Basic.
(thanks to Charles ) ..  :) 



.
« Last Edit: February 18, 2015, 01:29:27 AM by Aurel »

Aurel

  • Guest
Re: Ruben - simple interpreter
« Reply #1 on: February 17, 2015, 02:20:39 PM »
..and here is a small screenshot  ( mouse move circles)...

.

Peter

  • Guest
Re: Ruben - simple interpreter
« Reply #2 on: February 18, 2015, 05:37:04 AM »
Hi Aurel,

there comes along an error with ruben2.
if you click onto the window,  then start it again and again.  >:(

is this a new mesh by you?


.

Aurel

  • Guest
Re: Ruben - simple interpreter
« Reply #3 on: February 18, 2015, 06:35:57 AM »
Quote
is this a new mesh by you?
yes Peter it is by me or by strange o2 trigering.... :-[

Aurel

  • Guest
Re: Ruben - simple interpreter
« Reply #4 on: February 18, 2015, 06:59:32 AM »
No i mess up messages... ::)
I hope that is now fixed....
source is updated and is in folder RubSrc

.
« Last Edit: February 18, 2015, 07:57:30 AM by Aurel »

Aurel

  • Guest
Re: Ruben - simple interpreter
« Reply #5 on: February 20, 2015, 05:13:27 AM »
mayaM ...

Code: [Select]
wform 0,0,600,480,#SYS,0,"mayaM"
wcolor 0,0,0
txcolor 200,220,250
defn pi,rr,gg,bb,n
set pi = 3.14
defn level,angle,i
defn insize,x1,y1,x2,y2,d
set level = 300,angle = 0
set x1=200,y1=200

for n,0,100
 set angle=angle + 20

for i,1,9
    set d=9
   set x2 = x1 + cos(angle/d) * (d*10)
   set y2 = y1 + sin(angle*d)*2 * (d*10)
   set rr=RAND(255),gg=RAND(255),bb=250
   txcolor rr,gg,bb
   Line x2,y2,x1,y1
   circle x2,y2,d
   
   set angle=angle - 20
   
   set d=d-1
next i
next n 
 

.

Peter

  • Guest
Re: Ruben - simple interpreter
« Reply #6 on: February 20, 2015, 11:25:10 AM »
Aurel, for what is pi here?

Aurel

  • Guest
Re: Ruben - simple interpreter
« Reply #7 on: February 20, 2015, 12:37:40 PM »
hi Peter
Just for testing ..

Aurel

  • Guest
Re: Ruben - simple interpreter
« Reply #8 on: March 06, 2015, 02:17:06 PM »
I just can confirm that ruben3 work under new oxygen dll
also @mousemove event work fine  :)

Code: [Select]
'@mousemove
wform 0,0,600,400,#MMS,0,"Mouse Move test"
defn y,y2,rr,gg,bb
defn mx,my,rc
'set my = 100


WAIT 0

@MOUSEMOVE

@MOUSEX mx
@MOUSEY my
set rc = RAND(10)
set rr=RAND(255),gg=RAND(155),gg=RAND(255)
txcolor 0,0,0,rr,gg,bb
circle mx,my,rc

@OFF

.

Aurel

  • Guest
Re: Ruben - simple interpreter
« Reply #9 on: March 07, 2015, 04:38:08 PM »
well it looks that left mouse button down work fine

Code: [Select]
'@mousemove + left button down
wform 0,0,600,400,#MMS,0,"Mouse Move test"
defn y,y2,rr,gg,bb
defn mx,my,rc

WAIT 0

@MOUSEMOVE

@MOUSEX mx
@MOUSEY my

set rr=RAND(255),gg=RAND(155),gg=RAND(255)
txcolor 0,0,0,rr,gg,bb
set rc = RAND(10)
circle mx,my,rc

@OFF

@LEFTMBDOWN
txcolor 0,0,200,255,255,255
circle mx,my,30
@OFF


.

Peter

  • Guest
Re: Ruben - simple interpreter
« Reply #10 on: March 08, 2015, 03:19:44 AM »
RubenDev Circles.
Code: [Select]
include "ss.inc"
window 600,400,1
cls 255,255,255

int y,y2,rr,gg,bb
int mx,my,rc

while keydown(27)=0
'cls 255,255,255
mx = xMouse
my = yMouse

rc = rand(8,20)
color rand(32,255),rand(32,155),rand(32,255),255
fillcircle mx,my,rc

if MouseButton()=1
   color 0,0,0,255
   drawcircle mx,my,40
endif

color 0,0,0,255
drawstring 200,16,"RUBENDEV CIRCLES"
redraw
wait 10
wend
winExit
« Last Edit: April 26, 2015, 02:25:36 PM by Peter »

Aurel

  • Guest
Re: Ruben - simple interpreter
« Reply #11 on: March 08, 2015, 10:52:35 AM »
Work great Peter  :D
This is SDL example right ?
it is interesting that your o2 example use 26 GDI objects ad ruben need 48
and is strange that in some cases not work ...looks like DC coruption or something  >:(

Peter
do you can create same program with GDI only ?
if is not problem for you ...
i am interested how pure GDI o2 program work
thnks...

Aurel

  • Guest
Re: Ruben - simple interpreter
« Reply #12 on: April 26, 2015, 09:41:11 AM »
just a small bug-fix ...


.

JRS

  • Guest
Re: Ruben - simple interpreter
« Reply #13 on: April 26, 2015, 10:20:03 AM »
Aurel,

Can you post of list of features you plan to add to your BASIC going forward? It's better to warn folks ahead of time so they aren't disappointed with a surprise. Don't give up on Ruben as it helps Charles make O2 more stable and lets Charles think about alternative ways.

Aurel

  • Guest
Re: Ruben - simple interpreter
« Reply #14 on: April 27, 2015, 09:07:01 AM »
Quote
Aurel,
Can you post of list of features you plan to add to your BASIC going forward? It's better to warn folks ahead of time so they aren't disappointed with a surprise. Don't give up on Ruben as it helps Charles make O2 more stable and lets Charles think about alternative ways.

Hi John
I will continue with ruben...currently i don't have enough free time..
well what i have in plan..hmm i am not sure.
currently ...ruben is very primitive interpreter few graphic commands and just float varible type
math function,few window controls ...
so i must add
 event-messages
more controls & related commands
strings & string operations
(this culd be tricky & little bit in unusual style)  ::)
probably some sort of container/asociative array ..or
(maybe with OOP - i like OOP things in o2)  ;)
html control or something similar
(via EB dll- seems that work so-so)