kids encyclopedia robot

Yabasic facts for kids

Kids Encyclopedia Facts
Quick facts for kids
Yabasic
Samegame yabasic example.png
Yabasic running an implementation of SameGame.
Developer Marc-Oliver Ihm
Stable release
2.91.2 / 23 March 2025; 4 months ago (2025-03-23)
Platform x86, MIPS (EE)
OS Microsoft Windows, Unix, PS2
License MIT License
Filename extensions .bas,.yab
Website Website: Repository:

Yabasic, which stands for Yet Another BASIC, is a special computer program. It's a BASIC interpreter, meaning it understands and runs code written in the BASIC language. Yabasic is free and open-source, so anyone can use it and even help improve it.

This program works on computers using Microsoft Windows and Unix operating systems. Marc-Oliver Ihm first created Yabasic. The most recent stable version, 2.91.2, was released in March 2025. Since version 2.77.1, Yabasic has used the MIT License. Its code is now on GitHub, which helps more people join in its development.

What Yabasic Can Do

Yabasic has many cool features that make it easy to use for programming.

Key Features of Yabasic

  • No Line Numbers Needed: Unlike older BASIC versions, you don't have to put numbers at the start of every line of code. You can use them if you want, but it's not required.
  • Colorful Graphics: You can create simple 2D drawings and shapes using different colors.
  • Organized Code: Yabasic supports structured programming. This means you can organize your code into blocks. You can also create named subroutines (small programs within your main program). These subroutines can have their own special variables and can send back results.
  • Code Modules: You can use separate code modules or libraries. These are like toolboxes with special functions. Each toolbox keeps its tools separate, so they don't get mixed up.
  • Graphical Interfaces: Yabasic can help you build programs with a graphical user interface (GUI). This means your programs can have buttons, menus, and windows, just like the apps you use every day. It uses the GTK library for this.
  • Self-Changing Code: It allows for self-modifying code. This means a program can change its own instructions while it's running.
  • Standalone Programs: You can combine your Yabasic program with the interpreter. This creates a single file that can run on its own, without needing Yabasic installed separately.

Other Yabasic Versions

Over time, different versions of Yabasic have been made for various computer systems.

Yab for BeOS

Yab was a special version of Yabasic. It was made to work best with the BeOS operating system. It also worked with ZETA and Haiku, which are similar systems.

Flyab: A Graphical Version

"Flyab" was a project to make Yabasic work with the Fltk toolkit. This would have let Yabasic programs create native graphical interfaces. It aimed to be compatible with programs written for BeOS. The developers wanted to make it work on Microsoft Windows, Mac OS X, and Linux too. However, this project seems to have stopped development around November 2008.

Yabasic on PlayStation 2

A version of Yabasic was even included with the PlayStation 2 game console. Sony put it on demo discs in some regions. This helped the PS2 be seen as a home computer, not just a game machine. This allowed it to avoid certain import taxes in Europe.

Yabasic 3.0 (Unofficial)

Before the original author made new changes, a team started working on an unofficial Yabasic 3.0. This team included Pedro Sá and Thomas Larsen. However, development on this version has also stopped, and the project now appears to be abandoned.

Yabasic Code Example

Here is an example of what Yabasic code looks like. This program draws a special pattern 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

Kids robot.svg In Spanish: YaBasic para niños

kids search engine
Yabasic Facts for Kids. Kiddle Encyclopedia.