PC-BASIC

Started by round157, November 25, 2018, 09:09:33

Previous topic - Next topic

round157

I found the software.

This software looks classic and nostalgic.




This software may be suitable for kids to learn programming because of a comprehensive manual.
http://robhagemans.github.io/pcbasic/doc/

The creator of the software has created a true masterpiece.

Pakz

I was kind of happy when I found this basic (here linked) Appearantly it was supplied with the playstation 2 for some kind of tax break.

http://www.mrdictionary.net/yabasic/

The more recent fantasy consoles look kind of interesting also. I have pico-8 from a humble sale and there is a free (basic8) console on the windows store.

col

#2
You have to love just how far BASIC has got itself... incredible achievement :)

Although BlitzMax is not exactly BASIC per se, it does have it's foundation squarely built upon BASIC so here's a quick, hacked up BlitzMax port of the demo that's on the first page on the yabasic link from Pakz.


Strict

SetGraphicsDriver GLMax2DDriver()
Graphics 640,512

Global size:Float = 12
Const points = 8
Const faces = 6

Global dw
Global x[points], y[points], z[points], tx[points], ty[points], tz[points]
Global f1[faces], f2[faces], f3[faces], f4[faces], r[faces], g[faces], b[faces], Cls_[faces]
Global cs:Float[720], sn:Float[720]
Global xr:Float, yr:Float, zr:Float
Global starcount = 100
Global star_x[starcount], star_y[starcount], speed[starcount]
Global style
Global wp, wip:Float

initialise

Repeat
  Flip
  Cls
  If style = 0 stars

rotate
construct

  If style = 1 stars
  ' Make Cube Move
  If wip <= 0 wp = 0
  If wip >= 5 wp = 1
  If wp = 0 wip = wip + 0.05
  If wp = 1 wip = wip - 0.05
  ' Zoom In / Out
  If (size < 24 And KeyDown(KEY_E)) Then size = size + 0.5
  If (size > 1.5 And KeyDown(KEY_D)) Then size = size - 0.5
  ' Change Style
  If KeyHit(key_k) style = 1 - style
Until KeyDown(key_escape)


Function stars()
  For Local i = 0 Until starcount
    star_y[i] = star_y[i] + speed[i]
    If star_y[i] >= 512 Then
      star_x[i] = Rand(640)
      speed[i] = Rand(3) + 1
      star_y[i] = 0
    EndIf
    SetColor 80 * speed[i], 80 * speed[i], 100 * speed[i]
    Plot star_x[i], star_y[i]
  Next
EndFunction


Function construct()
  For Local a = 0 Until faces
    draw(a)
  Next
EndFunction


Function draw(a)
' Draw Faces
Local vx1 = tx[f1[a]] - tx[f2[a]]
Local vy1 = ty[f1[a]] - ty[f2[a]]
Local vx2 = tx[f3[a]] - tx[f2[a]]
Local vy2 = ty[f3[a]] - ty[f2[a]]
Local n = (vx1 * vy2 - vx2 * vy1) + 50
  If n < 0 Then
    n = - (n / 1000)
    SetColor r[a] + n, g[a] + n, b[a] + n

    glBegin(GL_TRIANGLES)
glvertex3f tx[f1[a]], ty[f1[a]], 0
glvertex3f tx[f2[a]], ty[f2[a]], 0
glvertex3f tx[f3[a]], ty[f3[a]], 0

glvertex3f tx[f1[a]], ty[f1[a]], 0
glvertex3f tx[f4[a]], ty[f4[a]], 0
glvertex3f tx[f3[a]], ty[f3[a]], 0
glEnd()

    If Cls_[a] = 1 Then
      SetColor 150, 150, 150

      DrawLine tx[f1[a]], ty[f1[a]], tx[f2[a]], ty[f2[a]]
      DrawLine tx[f2[a]], ty[f2[a]], tx[f3[a]], ty[f3[a]]
      DrawLine tx[f3[a]], ty[f3[a]], tx[f4[a]], ty[f4[a]]
      DrawLine tx[f4[a]], ty[f4[a]], tx[f1[a]], ty[f1[a]]
    EndIf
  EndIf
EndFunction

Function rotate()
Local dv:Float

For Local a = 0 Until points
  Local x1:Float = x[a]
  Local y1:Float = y[a]
  Local z1:Float = z[a]
  ' Rotation and Movement
  Local xx:Float = x1
  Local yy:Float = y1 * cs[xr] + z1 * sn[xr] + wip
  Local zz:Float = z1 * cs[xr] - y1 * sn[xr] + wip
  y1 = yy
  x1 = xx * cs[yr] - zz * sn[yr] + wip
  z1 = xx * sn[yr] + zz * cs[yr] + wip
  zz = z1
  xx = x1 * cs[zr] - y1 * sn[zr] + wip
  yy = x1 * sn[zr] + y1 * cs[zr] + wip
  ' Perspective
  dv = (zz / 40) + 1
  xx = size * (xx / dv) + 320
  yy = size * (yy / dv) + 256
  tx[a] = xx
  ty[a] = yy
  tz[a] = zz
Next
xr = xr + 3
yr = yr + 2
zr = zr + 5
If xr >= 720 xr = xr - 720
If yr >= 720 yr = yr - 720
If zr >= 720 zr = zr - 720
EndFunction

Function initialise()
' Get Star Position and Speed
  For Local i = 0 Until starcount
    Flip
    Cls
    star_x[i] = Rand(640); star_y[i] = Rand(512)
    speed[i] = Rand(3) + 1
    DrawText "STARS: " + i, 10, 20
    DrawRect 100, 247, i * 4, 16
    DrawLine 100, 247, 500, 247
DrawLine 500, 247, 500, 263
DrawLine 500, 263, 100, 263
DrawLine 100, 263, 100, 247
  Next

' Cube Initialise
  For Local ang = 0 Until 720
    cs[ang] = Cos(ang / 2)
    sn[ang] = Sin(ang / 2)
  Next
  ' Get Cube Points
  For Local a = 0 Until points
    ReadData x[a], y[a], z[a]
  Next
  ' Get Face Parameters and Connections
  For Local a = 0 Until faces
    ReadData f1[a]
    ReadData f2[a]
    ReadData f3[a]
    ReadData f4[a]
    ReadData r[a], g[a], b[a], Cls_[a]
  Next
EndFunction

' Objects X, Y, Z Points
DefData -10, 10, 10, 10, 10, 10, 10,-10, 10,-10,-10, 10
DefData -10, 10,-10, 10, 10,-10, 10,-10,-10,-10,-10,-10
' Connections, Colour and Shaded
DefData 0, 1, 2, 3, 30, 0, 0, 1
DefData 4, 7, 6, 5, 30, 0, 0, 1
DefData 5, 1, 0, 4, 0, 30, 0, 1
DefData 7, 3, 2, 6, 0, 30, 0, 1
DefData 1, 5, 6, 2, 0, 0, 30, 1
DefData 7, 4, 0, 3, 0, 0, 30, 1

https://github.com/davecamp

"When you observe the world through social media, you lose your faith in it."

round157

Quote from: Pakz on November 25, 2018, 10:58:17
The more recent fantasy consoles look kind of interesting also. I have pico-8 from a humble sale and there is a free (basic8) console on the windows store.

Hello,

I try to look for information of Pico-8 and BASIC8 after reading your introduction post.

"PICO-8 is a fantasy console for making, sharing and playing tiny games and other computer programs. When you turn it on, the machine greets you with a shell for typing in Lua commands and provides simple built-in tools for creating your own cartridges."
https://www.lexaloffle.com/pico-8.php

"BASIC8 is an integrated Fantasy Computer for game and other program development. You can create, share and play disks in a modern BASIC dialect, with built-in tools for editing sprite, tiles, map, quantized, etc."
https://paladin-t.github.io/b8/

Both softwares are similar products. They are very innovative tools. Thanks for telling our members and me these two fascinating programs.   ^-^





round157

Quote from: col on November 25, 2018, 21:50:25
You have to love just how far BASIC has got itself... incredible achievement :)



Yes, it is great achievement.
^-^