Yabasic facts for kids
![]() Yabasic running an implementation of SameGame.
|
|
Developer(s) | Marc-Oliver Ihm |
---|---|
Stable release |
2.90.4 / 17 September 2023
|
Operating system | Microsoft Windows, Unix |
Type | Programming |
License | MIT License |
Yabasic (which stands for Yet Another BASIC) is a special program. It helps computers understand and run code written in the BASIC programming language. Yabasic is available for free and anyone can see and change its code because it's open-source. You can use it on computers that run Microsoft Windows or Unix systems.
Marc-Oliver Ihm first created Yabasic. He released many versions, with the last stable one being 2.77.3 in 2016. Later, starting with version 2.77.1, the project began using the MIT License. This license makes it easier for other people to help improve Yabasic. Its code was also moved to GitHub, a place where programmers share their work. This helps more people join in and develop Yabasic further.
Contents
What can Yabasic do?
Yabasic has many cool features that make it easy to use for programming:
- No line numbers: Unlike older BASIC versions, you don't need to put numbers at the start of every line of code. This makes your programs much easier to read and write.
- Colorful graphics: You can draw simple pictures and lines in different colors. This is great for making games or visual projects.
- Organized code: Yabasic lets you write code in a structured way. This means you can break your program into smaller, organized parts called "subroutines." These parts can have their own special variables and give back results, making big programs easier to manage.
- Code modules: You can create separate files of code, like building blocks. These blocks can be reused in different programs. This saves time and keeps your projects tidy.
- Graphical interfaces: Yabasic can help you create programs with buttons, menus, and windows, just like the apps you use every day. It uses a special tool called GTK for this.
- Self-modifying code: This advanced feature allows a program to change its own instructions while it's running.
- Standalone programs: You can combine your Yabasic program with the Yabasic interpreter into one single file. This means you can share your program with others, and they can run it without needing to install Yabasic separately.
Other Yabasic versions
Over the years, different versions of Yabasic have been created for various computer systems.
Yab: A version for BeOS
There was a special version of Yabasic called Yab. It was made to work best on operating systems like BeOS, ZETA, and Haiku.
PlayStation 2 Yabasic
Did you know Yabasic even appeared on a game console? Sony included a version of Yabasic on a demo disc for the PlayStation 2 in some parts of the world. This was a clever way to make the PlayStation 2 seem like a home computer, not just a game machine. This helped Sony avoid certain import taxes in Europe.
Yabasic example code
Here is a small example of what Yabasic code looks like. This program draws a simple shape on the screen.
#!/usr/bin/yabasic
REM Program Name: cbm-mtudemo.yab
REM Author: mtu
REM
REM Purpose: demonstration for their CBM-PET graphics card 320x200
open window 320, 200
20 P=160: Q=100
30 XP=144: XR=1.5*3.1415927
40 YP=56: YR=1: ZP=64
50 XF=XR/XP: YF=YP/YR: ZF=XR/ZP
60 FOR ZI=-Q TO Q-l
70 IF ZI<-ZP OR ZI>ZP GOTO 150
80 ZT=ZI*XP/ZP: ZZ=ZI
90 XL=INT(0.5+SQRT(XP*XP-ZT*ZT))
100 FOR XI=-XL TO XL
110 XT=SQRT(XI*XI+ZT*ZT)*XF: XX=XI
120 YY=(SIN(XT)+0.4*SIN(3.0*XT))*YF
130 GOSUB 170
140 NEXT XI
150 NEXT ZI
160 PAUSE 10
END
170 X1=XX+ZZ+P
180 Y1=YY-ZZ+Q:Y1=199-Y1
190 LINE X1,Y1,X1,Y1-1
200 IF Y1=0 GOTO 220
210 CLEAR LINE X1,Y1+1,X1,199
220 RETURN
See also
- In Spanish: YaBasic para niños