* *

Coding

Welcome, Guest. Please login or register.
Did you miss your activation email?
December 15, 2017, 05:04:53 AM

Login with username, password and session length

Menu

Members
Stats
  • Total Posts: 12183
  • Total Topics: 1737
  • Online Today: 41
  • Online Ever: 195
  • (February 11, 2014, 01:46:08 PM)
Users Online
Users: 0
Guests: 26
Total: 31
Yahoo!
Sogou
Google (2)
Baidu

Author Topic: OxygenBasic: New OOP BASIC like language that is also much much more  (Read 3202 times)

0 Members and 1 Guest are viewing this topic.

Offline kryton9

  • Hero Member
  • *****
  • Posts: 971
  • Bananas: 6
  • Gender: Male
Charles Pegge, has gotten his Oxygen thinBasic module out as its own stand alone language now.
You can code in object oriented or procedurally in a BASIC syntax. It understands c headers, you can write in assembly, it can assemble changes on the fly.
It does more than I can give justice to by describing it here.


Here is the download link site: http://sourceforge.net/projects/oxygenbasic/files/


Here is a description and forum for support.
http://www.oxygenbasic.org/forum/index.php


Charles is currently working on making an editor for it based on opengl. This will make it one of the most interesting code editors for those into graphics.
It comes with an SciTe editor right now, that you will probably want to customize with a user properties file.


Here is one that I used as a starting point to tweak and am still tweaking:
http://andrewhutchings.com/scite-user-properties

Offline zlatkoCB

  • Sr. Member
  • ****
  • Posts: 473
  • Bananas: 2
  • Gender: Male
Re: OxygenBasic: New OOP BASIC like language that is also much much more
« Reply #1 on: January 12, 2014, 03:40:48 AM »
This example represent how is easy to
use OOP in Oxygen Basic.

Code: [Select]
include "..\GDIWindow\window.inc"
Window "Consume Grow and Multiply", 640, 480, 2
sys xscreen =640, yscreen =480, i, sz
'Font 12,24,0,"courier"
sys anzahl=300

single xmitte = xscreen/2, ymitte = yscreen/2

'=================
class UnitParticle
'=================

single x,y,xv,yv,ra
sys    sz,bou,mark
byte   red,green,blue,alpha

end class


'==============
class Particles
'==============

  UnitParticle
  '
  '
  'BASE PARTICLE ONLY
  '
  sys    pob,popn
  string sbuf

method index(sys i)
  pob=strptr(sbuf)+i*sizeof UnitParticle
end method

method populate(sys e)
  sys i,b
  popn=e
  sbuf=nuls e*sizeof UnitParticle
  pob=strptr sbuf
  for i=0 to <e
    rebirth
    pob+=sizeof UnitParticle
  next
end method

method rebirth()
  single r,a
  @this = pob
  x     = xmitte
  y     = ymitte
  a     = rand(1,628)*.01
  r     = rand(20,100)*.02
  xv    = r*cos(a)*.5
  yv    = r*sin(a)*.5
  ra    = rand(9,12)
  red   = rand(0,60)
  green = rand(100,250)
  blue  = rand(160,250)
  bou   = 0
  mark  = 0
end method

method outside() as sys
  @this=pob
  if x<0 or y<0 or x>=xscreen or y>=yscreen then return 1
end method

method MergeContact(sys j) as sys
  sys k=strptr sbuf
  particles *p
  float c,g
  sys i,e=popn-1
  @this=pob
  if bou=0 then return 0 'no interaction
  if mark then return 0
  '
   for i=0 to e
   if i<>j
    @p=k+i*sizeof UnitParticle
    if p.mark=0 and p.bou=1
     c=hypot(x-p.x, y-p.y)
     if c<ra then
      g=hypot( ra, p.ra )
      if ra>=p.ra then
       p.mark=1 'off field
       ra=g     'grow
      else
       mark=1   'off field
       p.ra=g   'grow
       exit for 'early exit
      end if
     end if
    end if
   end if
  next
end method

method progeny(sys j)
  sys i,c,q
  sys id=@this, e=popn-1, k=strptr sbuf
  @this=pob
  particles *p
  if bou=0 or mark=1 then return
  if ra>50 then 'size threshhold
   for i=0 to e
    if i<>j
     @p=k+i*sizeof UnitParticle
     if p.mark then
      c++
      if c >30 then exit for 'limit progeny
      @this=id
      q=pob
      pob=@p
      rebirth
      pob=q
      @this=pob
      p.x=x : p.y=y
      ra=10 'remaining size after giving birth
     end if
    end if
   next
  end if
end method

method setmark(sys a)
  @this=pob
  mark=a
end method

method move()
  @this=pob
  x += xv
  y += yv
  sz=ra*2
end method

method bounce()
  sys c
  @this=pob
  if x>=xscreen
    xv=-xv : x=xscreen-1 : c=1
  elseif x<=0
    xv=-xv : x=1 : c=2
  end if
  if y>=yscreen
    yv=-yv : y=yscreen-1 : c=3
  elseif y<=0
    yv=-yv : y=1 : c=4
  end if
  if c
    bou=1 'activate
  end if
end method

method show()
  @this=pob
  if bou=0 then
    Oval x-ra, y-ra, sz, sz, 0, red+120, 0
  else
    Oval x-ra, y-ra, sz, sz, red, green, blue
  end if
end method

method act(sys i)
  index i
  move
  if outside then
    bounce
  end if
  progeny i
  MergeContact i
  show
end method

end class

sys c
particles pa
pa.populate anzahl


While Key(27)=0
ClsColor 80,0,0
for i=0 to <anzahl
  pa.act i
next
Events
FlipBuffer
WaitFPS 80
Wend
WinEnd


 

To link to us use this code/button on your site

http://www.codingmonkeys.com/images/cm_link.gif

ShoutBox!

 

Blue Steel

December 09, 2017, 02:46:53 AM
:) ty fingers crossed
 

Larry McCaughn

December 08, 2017, 04:10:56 PM
I'll give you a Shout out in the Shout Box for being able to put it back up.
 

lurkalot

September 20, 2017, 01:57:54 PM
Hey that's my job. Didn't choose this username for nothing you know.  :)
 

Larry McCaughn

September 19, 2017, 12:24:13 AM
lurking in the shadows, lurkalot.
 

lurkalot

September 16, 2017, 04:39:43 PM
Good evening all.  Where is everyone?
 

lurkalot

September 12, 2017, 12:57:36 PM
Good to hear, it's nice to see a empty error log. ;)
 

Blue Steel

September 12, 2017, 05:04:25 AM
running sites log files overnight heres the result (I know mainly spiners) "There are currently no error log entries." :)
 

lurkalot

September 12, 2017, 03:19:33 AM
Morning all.  :)
 

Blue Steel

September 12, 2017, 01:12:33 AM
Let it all out ..
these are the things I can't do without  ;)

MikeHart

September 11, 2017, 11:14:22 PM
SHOUT SHOUT  :)
 

GWS

September 11, 2017, 08:16:02 PM
Shouting is Go !  ;D
 

Blue Steel

September 11, 2017, 06:54:02 PM
gradually getting there
 

lurkalot

September 11, 2017, 05:22:46 PM
Yay, you found it.  ;)
 

Larry McCaughn

September 11, 2017, 01:07:13 PM
looks like you're making good progress
 

Blue Steel

September 07, 2017, 10:34:19 PM
yay recent topics are working again in the center of the home page :)
 

Larry McCaughn

July 12, 2017, 05:46:33 PM
Blue Steel is back running the show.  Maybe he'll be able to build some steam in the ole place!
 

Blue Steel

June 26, 2017, 04:58:41 AM
hope i didn't scare too many of you
 

Blue Steel

June 26, 2017, 04:58:12 AM
Boo, i'm still here alive and well , see my post in introductions

MikeHart

July 25, 2016, 01:43:24 AM
That sounds cool. Have to chekc out IWBasic in the next days.
 

Larry McCaughn

July 22, 2016, 11:47:00 PM
I'm hoping to issue a new maintenance release to the IWBasic 3.x IDE in the next few weeks and Larry Sikes has released an update to the Linux version of IWBasic and is currently working on the 64bit version of IWBasic.  Progress should speed up since he has retired and has apparently resolved his m

MikeHart

July 19, 2016, 02:53:02 PM
Anything interesting going on around BASIC?
 

Larry McCaughn

July 18, 2016, 09:14:12 AM
Hello Mike

MikeHart

July 16, 2016, 04:33:25 PM
Hi there all!
 

pistol350

June 24, 2016, 03:41:10 AM
Hello all!
I'm still around although less active!