Author Topic: GLScriptBasic  (Read 94870 times)

Offline metzzo

  • Mr. Polyvector
  • ***
  • Posts: 140
  • Coolo ist cool!
    • View Profile
    • programming with design
Re: GLScriptBasic
« Reply #45 on: 2010-Aug-20 »
Sry für Doppelpost...

Aber hier ist der aktuelle (verbuggte) Stand. Den Fehler sieht man nicht sofort, aber wenn man genau hinsieht werden ein paar Funktionen/Subs nicht korrekt aufgerufen:
http://coolo.kilu.de/files/GLScriptBasic.rar
That's no Bug, that's my project!

http://programming-with-design.at/

Offline bigsofty

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 2750
    • View Profile
Re: GLScriptBasic
« Reply #46 on: 2010-Aug-20 »
Very impressive!  :nw:

Recht schönen Dank!


Ian
Cheers,

Ian.

“It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration.”
(E. W. Dijkstra)

Offline bigsofty

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 2750
    • View Profile
Re: GLScriptBasic
« Reply #47 on: 2010-Nov-11 »
War der Fehler jemals behoben Coolo?

Cheers,


Ian
Cheers,

Ian.

“It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration.”
(E. W. Dijkstra)

Offline bigsofty

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 2750
    • View Profile
Re: GLScriptBasic
« Reply #48 on: 2010-Nov-13 »
Did I say it wrong? I was trying to ask if Coolo ever managed to find the bug that halted development, Googletranslate is not always great at translating?

Cheers,


Ian
Cheers,

Ian.

“It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration.”
(E. W. Dijkstra)

Offline metzzo

  • Mr. Polyvector
  • ***
  • Posts: 140
  • Coolo ist cool!
    • View Profile
    • programming with design
Re: GLScriptBasic
« Reply #49 on: 2010-Nov-13 »
Nope, I tried to find the bug really long (one week), but i really did not find it.

But maybe i will make GLSB2 :D. I'm really sad, because GLSB is a really nice code...
That's no Bug, that's my project!

http://programming-with-design.at/

Offline bigsofty

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 2750
    • View Profile
Re: GLScriptBasic
« Reply #50 on: 2010-Nov-14 »
Ah, that's a real pity, I really liked the syntax and the extendablity Coola, it would have been great to use it. I am sorry I cannot help, I know nothing about virtual machines and scripting. :(

I would be very interest in GLSB2 though!  :D

Cheers,


Ian
Cheers,

Ian.

“It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration.”
(E. W. Dijkstra)

Offline WPShadow

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1667
    • View Profile
    • http://lostrevenant.blogspot.com
Re: GLScriptBasic
« Reply #51 on: 2010-Nov-20 »
Hi,

ich habe nur eine ganz kurze Frage:

Ist es im Script eigentlich möglich selbst hinterlegte Funktionen aus dem compilierten Code aufzurufen und aufarbeiten zu lassen?

z.B. set_position(x, y, z)

LG

W.
AMD X2 4600, 2 GB Ram, ATI X1950 XTX, XP PRO SP2: GLB Premium 10.beta_dingsi, <(´.´<) Kirby Dance (>`.`)>
http://lostrevenant.blogspot.com
alea iacta est

Offline Schranz0r

  • Premium User :)
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 5111
  • O Rly?
    • View Profile
Re: GLScriptBasic
« Reply #52 on: 2010-Nov-20 »
Was meinst du ist der Sinn einer Scriptsprache? :D
I <3 DGArray's :D

PC:
AMD Ryzen 7 1700 @3.9GHz, 16GB HyperX Fury 3000MHz Ram, ASUS ROG GTX 1060 STRIX 6GB, Windows 10 Pro 64Bit, MSi Tomahawk B350 Mainboard

Offline WPShadow

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1667
    • View Profile
    • http://lostrevenant.blogspot.com
Re: GLScriptBasic
« Reply #53 on: 2010-Nov-20 »
Das weiß ich auch!  =D

Mir geht es nur darum, daß es auch fehlerfrei funktioniert!

Frage: Gibt's zu den Funktionen irgendwo ein Tutorial oder was ähnliches, wo beschrieben wird, wie ich die einzelnen Daten von außen rein hole???
« Last Edit: 2010-Nov-20 by WPShadow »
AMD X2 4600, 2 GB Ram, ATI X1950 XTX, XP PRO SP2: GLB Premium 10.beta_dingsi, <(´.´<) Kirby Dance (>`.`)>
http://lostrevenant.blogspot.com
alea iacta est

Offline bigsofty

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 2750
    • View Profile
Re: GLScriptBasic
« Reply #54 on: 2010-Nov-22 »
Is there a piece of script code available that quickly shows the error?

Cheers,


Ian
Cheers,

Ian.

“It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration.”
(E. W. Dijkstra)

Offline metzzo

  • Mr. Polyvector
  • ***
  • Posts: 140
  • Coolo ist cool!
    • View Profile
    • programming with design
Re: GLScriptBasic
« Reply #55 on: 2010-Nov-22 »
@WPShadow: Mit der ursprünglich hochgeladenen Variante ging das Aufrufen von im Skript deklarierten Funktionen nicht direkt (man hätte mit der internen Funktionspointer ID arbeiten müssen, welche zur OpCode Position führt).
Dies habe ich nun erleichtert, nun gibt es die Funktion "CallFunction". Erster Parameter ist die VM, zweiter der Name der Funktion und dritter die Anzahl der Parameter (Die braucht es, da ja anhand dieser auch überladen werden kann). Der Link ist derselbe.

Um Daten drauf zu geben, gibt es die Funktionen StackPushNumber/String/NumberArray/StringArray. Um sie vom "Stack" wieder zurück zu bekommen gibt es die StackPopNumber/String/NumberArray/StringArray pedante. Um Funktionen (von GLb aus) hinzuzufügen muss man erstens eine SUB namens "SCRIPT_NAMEDERSUB" definieren, danach in der InitStdFunction() Funktion noch "CreateFunction("NAMEDERSUB",ANZAHLDERPARAMETER)" hinzuschreiben.

@bigsofty: Yes, the problem is already in the current code. If you look closer into the code, you notice, that some Opcodes are not callen. I really don't know why. It happens in the function funk(). If you uncomment the STDOUT you get an error. I think it has its source anywhere at the "optional function parameter parser" but i am not sure about this.
« Last Edit: 2010-Nov-22 by coolo »
That's no Bug, that's my project!

http://programming-with-design.at/

Offline bigsofty

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 2750
    • View Profile
Re: GLScriptBasic
« Reply #56 on: 2010-Nov-22 »
Thanks Coolo, I'll have a wee look, no harm in trying I suppose.  :)
Cheers,

Ian.

“It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration.”
(E. W. Dijkstra)

Offline Albert

  • Dr. Type
  • ****
  • Posts: 257
    • View Profile
    • Blog
Re: GLScriptBasic
« Reply #57 on: 2011-May-02 »
Wow!
I really like that pong.txt script!
Is there a newer version of this script!

Offline Albert

  • Dr. Type
  • ****
  • Posts: 257
    • View Profile
    • Blog
Re: GLScriptBasic
« Reply #58 on: 2011-May-03 »
I've successfully compiled glScriptBasic to Android! Now I can code in glBasicScript on the go (editing a txt file) and then run directly on my device  8)
Functions with referenced parameters (BYREF) will be supported?
For example there is a way to support commands like GETSCREENSIZE w%%, h%% or MOUSESTATE?
« Last Edit: 2011-May-03 by Albert »

Offline Albert

  • Dr. Type
  • ****
  • Posts: 257
    • View Profile
    • Blog
Re: GLScriptBasic
« Reply #59 on: 2011-May-04 »
There was a bug in Pong.txt: the ball stuck if it touch the pad from the left or right side.
Here is the fixed version:
Quote
GLOBAL SpielerX=100, BallX=100, BallY=100,Angle=RND(360), Life

Life=4

CREATESCREEN 2, 1, 320, 200

WHILE TRUE
   USESCREEN 2
   CLEARSCREEN RGB(10,10,10)
   DRAWRECT SpielerX,20,40,10,RGB(255,50,50)
   IF KEY(205)
      SpielerX=SpielerX+4
   ENDIF
   IF KEY(203)
      SpielerX=SpielerX-4
   ENDIF
   BallX=BallX+COS(Angle)*2
   BallY=BallY+SIN(Angle)*2
   IF BOXCOLL(SpielerX,20,40,10,BallX,BallY,16,16)
      BallX=BallX-COS(Angle)*2
      BallY=BallY-SIN(Angle)*2
      IF BallY-30>0
         Angle=360-Angle
      ELSE
         Angle=180-Angle
      ENDIF
         
   ENDIF
   
   IF BallX>320-16 OR BallX<0
      Angle=180-Angle
   ENDIF
   IF BallY>200-16
      Angle=360-Angle
   ENDIF
   
   IF BallY<0
      Life=Life-1
      BallX=100
      BallY=100
      Angle=RND(360)
   ENDIF
   
   DRAWRECT BallX,BallY,16,16,RGB(0,255,0)
   
   PRINT "Life: "+Life,10,180
   PRINT "Angle: "+Angle,150,180
   IF Life<1
      END
   ENDIF
   
   USESCREEN -1
   STRETCHSPRITE 1, 0, 0, 800, 480
   SHOWSCREEN
WEND
It also for testing some commands I added to it: CREATESCREEN, USESCREEN, STRETCHSPRITE

I see that nobody interested for glScriptBasic anymore. There is a better solution?
Should I make a new thread in the English boards?