GLScriptBasic

Previous topic - Next topic

metzzo

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/

bigsofty

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)

bigsofty

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)

bigsofty

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)

metzzo

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/

bigsofty

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)

WPShadow

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

Schranz0r

Was meinst du ist der Sinn einer Scriptsprache? :D
I <3 DGArray's :D

PC:
AMD Ryzen 7 3800X 16@4.5GHz, 16GB Corsair Vengeance LPX DDR4-3200 RAM, ASUS Dual GeForce RTX™ 3060 OC Edition 12GB GDDR6, Windows 11 Pro 64Bit, MSi Tomahawk B350 Mainboard

WPShadow

#53
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???
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

bigsofty

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)

metzzo

#55
@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.
That's no Bug, that's my project!

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

bigsofty

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)

Albert

Wow!
I really like that pong.txt script!
Is there a newer version of this script!

Albert

#58
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?

Albert

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?