├── .gitignore ├── Basic1 ├── IotBasic │ ├── IoTBasic.ino │ ├── MANUAL.md │ ├── README.md │ ├── basic.h │ ├── font │ │ ├── README.md │ │ └── firasans.h │ ├── hardware-arduino.h │ └── wifisettings.h ├── TinyVT52 │ ├── README.md │ ├── TinyVT52.ino │ ├── basic.h │ └── hardware-arduino.h ├── TinybasicArduino │ ├── README.md │ ├── TinybasicArduino.ino │ ├── basic.h │ ├── hardware-arduino.h │ └── wifisettings.h ├── basic.c ├── basic.h ├── hardware-arduino.h └── hardware-posix.h ├── Basic2 ├── IoTBasic │ ├── IoTBasic.ino │ ├── Makefile │ ├── basic.h │ ├── boards │ │ ├── README.md │ │ ├── aim65.h │ │ ├── avrlcd.h │ │ ├── avrmcufriend.h │ │ ├── duetft.h │ │ ├── dummy.h │ │ ├── esp01board.h │ │ ├── esp32board.h │ │ ├── esp32cam.h │ │ ├── megaboard.h │ │ ├── megashield.h │ │ ├── megatft.h │ │ ├── mkr1010board.h │ │ ├── nanoboard.h │ │ ├── rp2040board.h │ │ ├── rp2040board2.h │ │ ├── tdeck.h │ │ ├── ttgovga.h │ │ ├── unoboard.h │ │ └── wemosshield.h │ ├── buildin │ │ ├── buildin-arduinotest.h │ │ ├── buildin-games.h │ │ ├── buildin-tutorial.h │ │ └── buildin.h │ ├── font │ │ ├── README.md │ │ └── firasans.h │ ├── hardware.h │ ├── language.h │ ├── runtime.cpp │ ├── runtime.h │ ├── src │ │ ├── FlashStorage_SAMD │ │ │ ├── FlashAsEEPROM_SAMD.h │ │ │ ├── FlashAsEEPROM_SAMD.hpp │ │ │ ├── FlashStorage_SAMD.h │ │ │ ├── FlashStorage_SAMD.hpp │ │ │ ├── FlashStorage_SAMD21.h │ │ │ ├── FlashStorage_SAMD51.h │ │ │ ├── FlashStorage_SAMD_Impl.h │ │ │ └── README.md │ │ ├── README.md │ │ ├── Runtime │ │ │ ├── README.md │ │ │ └── esp32cam.h │ │ └── XMCEEPROMLib │ │ │ ├── README.md │ │ │ └── XMCEEPROMLib.h │ └── wifisettings.h ├── MSDOS │ ├── README.md │ ├── basic.c │ ├── basic.h │ ├── dosify │ ├── getcode │ ├── hardware.h │ ├── language.h │ ├── runtime.c │ └── runtime.h ├── Posix │ ├── basic.c │ ├── basic.h │ ├── buildin.h │ ├── buildin │ │ ├── buildin-arduinotest.h │ │ ├── buildin-games.h │ │ ├── buildin-tutorial.h │ │ └── buildin.h │ ├── hardware.h │ ├── language.h │ ├── runtime.c │ ├── runtime.h │ └── src │ │ └── Runtime │ │ └── esp32cam.h ├── README.md ├── RaspPi │ ├── README.md │ ├── basic.c │ ├── basic.h │ ├── hardware.h │ ├── language.h │ ├── runtime.c │ └── runtime.h ├── Windows │ ├── README.md │ ├── basic.c │ ├── basic.h │ ├── hardware.h │ ├── language.h │ ├── runtime.c │ └── runtime.h └── examples │ └── 00tutorialBasic2 │ └── eliza2.bas ├── IotBasic └── README.md ├── LICENSE ├── MANUAL.md ├── README.md ├── TinybasicArduino └── README.md ├── docs ├── BASICs │ ├── 101_BASIC_Computer_Games_Mar75.pdf │ ├── AltairBasic_1275.pdf │ ├── Apple2AppleSoftBASICRef1977.pdf │ ├── Creative_Computing_v10_n03_1984_Mar_0007.jpeg │ ├── ECMA-55_1st_edition_january_1978.pdf │ ├── Kilobaud_1977_June.pdf │ ├── README.md │ ├── TinyBASIC-2.0.pdf │ ├── aim65_basic.pdf │ └── apple1_basic_manual.pdf ├── components │ ├── ABX00053-datasheet.pdf │ ├── Atmel-8869-SEEPROM-AT24CS32-Datasheet.pdf │ ├── BMP280datasheet.pdf │ ├── BST-BME280_DS001-10.pdf │ ├── DS1307.pdf │ ├── DS3231 Real Time Clock Connection Diagrams.pdf │ ├── DS3231 Real Time Clock Datenblatt AZ-Delivery Vertriebs GmbH.pdf │ ├── DS3231.pdf │ ├── DS3232.pdf │ ├── DUE_Shield_schematic.pdf │ ├── Digispark.pdf │ ├── ESP8266-01 USB-Stick DE.pdf │ ├── KeyboardController.pages │ ├── KeyboardController.pdf │ ├── PS2Keyboard Library, Connect a keyboard for user input.pdf │ ├── Pinout-NANOevery_latest.pdf │ ├── Programming+the+Wemos+Mega+Wifi+Board.pdf │ ├── RK-10290_410.pdf │ ├── SSD1306.pdf │ ├── SSD1963_v1.6.pdf │ ├── ThermalprinterSpecs.pdf │ ├── doc0336.pdf │ └── vga32_v1.4.pdf ├── img │ ├── Aim-65.jpeg │ ├── CoolTerm1.png │ ├── CoolTerm2.png │ ├── CoolTerm3.png │ ├── ESP8266-NodeMCU-kit-12-E-pinout-gpio-pin.png │ ├── IMG_0128.png │ ├── IMG_0479.png │ ├── IMG_3135.png │ ├── IMG_3158.png │ ├── IMG_3843.png │ ├── IMG_3846.png │ ├── IMG_3882.png │ ├── IMG_3920.png │ ├── IMG_3995.png │ ├── IMG_4020.png │ ├── IMG_4043.png │ ├── IMG_4044.png │ ├── IMG_4089.png │ ├── IMG_4210.png │ ├── IMG_4211.png │ ├── IMG_4212.png │ ├── IMG_4213.png │ ├── IMG_4214.png │ ├── IMG_4215.png │ ├── IMG_4216.png │ ├── IMG_4217.png │ ├── IMG_4219.png │ ├── IMG_4220.png │ ├── IMG_4221.png │ ├── IMG_4223.png │ ├── IMG_4226.png │ ├── IMG_4228.png │ ├── IMG_4229.png │ ├── IMG_4230.png │ ├── IMG_4231.png │ ├── IMG_4232.png │ ├── IMG_4233.png │ ├── IMG_4234.png │ ├── IMG_4236.png │ ├── IMG_4248.png │ ├── IMG_4249.png │ ├── IMG_4271.png │ ├── IMG_4272.png │ ├── IMG_4284.png │ ├── IMG_4285.png │ ├── IMG_4286.png │ ├── IMG_4287.png │ ├── IMG_4288.png │ ├── IMG_4289.png │ ├── IMG_4290.png │ ├── IMG_4291.png │ ├── IMG_4296.png │ ├── IMG_4297.png │ ├── IMG_4299.png │ ├── IMG_4305.png │ ├── IMG_4306.png │ ├── IMG_4308.png │ ├── IMG_4315.png │ ├── IMG_4316.png │ ├── IMG_4317.png │ ├── IMG_4331.png │ ├── IMG_4375.png │ ├── IMG_4376.png │ ├── IMG_4378.png │ ├── IMG_4382.png │ ├── IMG_4403.png │ ├── IMG_4415-1.png │ ├── IMG_4415.png │ ├── IMG_4417.png │ ├── IMG_4418.png │ ├── IMG_4426.png │ ├── IMG_4428.png │ ├── IMG_4487.png │ ├── IMG_4488.png │ ├── IMG_4489.png │ ├── IMG_4491.png │ ├── IMG_4492.png │ ├── IMG_4493.png │ ├── IMG_4494.png │ ├── IMG_4498.png │ ├── IMG_4499.png │ ├── IMG_4500.png │ ├── IMG_4501.png │ ├── IMG_4663.png │ ├── IMG_4669.png │ ├── IMG_4671.png │ ├── IMG_5001.png │ ├── IMG_5002.png │ ├── IMG_5003.png │ ├── IMG_5613.png │ ├── IMG_5638.png │ ├── IMG_5701.png │ ├── IMG_5703.png │ ├── IMG_5704.png │ ├── IMG_5705.png │ ├── IMG_5768.png │ ├── IMG_5888.png │ ├── IMG_5893.png │ ├── IMG_6817.png │ ├── IMG_7220.mov │ ├── Readme.md │ ├── TTGO-VGA-HW.jpeg │ ├── TTGOVGA-Specs.jpeg │ ├── nrf24l01_pinout_qfp5d3C9qD.jpeg │ └── shieldmod1_Steckplatine.png ├── tutorial │ ├── BASIC on Arduinos - Introduction.epub │ └── BASIC on Arduinos - Introduction.pages └── wire │ ├── AIM65.fzz │ ├── TFTcomputer.fzz │ ├── shieldmod1.fzz │ └── shieldmod2.fzz ├── examples ├── 00tutorial │ ├── README.md │ ├── arch.bas │ ├── archvt52.bas │ ├── array.bas │ ├── calc.bas │ ├── calcs.bas │ ├── clock.bas │ ├── clrvar.bas │ ├── cond.bas │ ├── convert.bas │ ├── cpinew1.bas │ ├── cpinew2.bas │ ├── debug.bas │ ├── dump.bas │ ├── eeprom.bas │ ├── eliza-org.bas │ ├── eliza.bas │ ├── endme.bas │ ├── energie.bas │ ├── euler.bas │ ├── euler9.bas │ ├── eval.bas │ ├── fibo.bas │ ├── fileio.bas │ ├── find.bas │ ├── func.bas │ ├── hello.bas │ ├── hinv.bas │ ├── logic.bas │ ├── loop.bas │ ├── malloc.bas │ ├── mandel.bas │ ├── mandelv.bas │ ├── math.bas │ ├── memory.bas │ ├── mkbuildin.bas │ ├── nullbuffer.bas │ ├── ongo.bas │ ├── parable.bas │ ├── plot.bas │ ├── primes.bas │ ├── primesl.bas │ ├── putget.bas │ ├── random.bas │ ├── readdata.bas │ ├── serial1.bas │ ├── shinv.bas │ ├── sort.bas │ ├── splitstr.bas │ ├── stir.bas │ ├── stopcont.bas │ ├── string1.bas │ ├── string2.bas │ ├── string3.bas │ ├── string4.bas │ ├── sysinf.bas │ ├── table.bas │ ├── tictac.bas │ ├── timer.bas │ ├── timestop.bas │ ├── tinybasic-ms.bas │ ├── tinybasic-s.bas │ ├── tinybasic.bas │ └── trig.bas ├── 01basics │ ├── README.md │ ├── analogrs.bas │ ├── baremin.bas │ ├── blink.bas │ ├── digitrs.bas │ ├── fade.bas │ ├── readav1.bas │ └── readav2.bas ├── 02digital │ ├── README.md │ ├── blinkwod.bas │ ├── button.bas │ ├── debounce.bas │ ├── digitip.bas │ ├── melody.bas │ ├── melodys.bas │ ├── pitches.bas │ ├── statecd.bas │ └── tonepf.bas ├── 03analog │ ├── README.md │ ├── analogin.bas │ ├── analogios.bas │ ├── analogwm.bas │ ├── calib.bas │ ├── fading.bas │ └── smooth.bas ├── 04communication │ ├── README.md │ ├── dimmer.bas │ ├── graph.bas │ ├── midi.bas │ ├── multiser.bas │ ├── physpix.bas │ ├── sercs.bas │ ├── sercsa.bas │ └── virtcm.bas ├── 05control │ ├── README.md │ ├── arrays.bas │ ├── forloop.bas │ ├── ifstatc.bas │ ├── switch.bas │ ├── switch2.bas │ └── whilest.bas ├── 06sensors │ ├── README.md │ ├── adxl3.bas │ ├── knock.bas │ ├── memsic.bas │ └── ping.bas ├── 07display │ ├── README.md │ ├── bargraph.bas │ └── rowcol.bas ├── 08strings │ ├── README.md │ ├── charan.bas │ ├── stradd.bas │ ├── strapp.bas │ ├── strcase.bas │ └── strchar.bas ├── 11stefans │ ├── README.md │ ├── array2d.bas │ ├── bench.bas │ ├── bench.txt │ ├── creative.bas │ ├── cubes.bas │ ├── energie.bas │ ├── gbench.bas │ ├── rfbench.txt │ ├── rfbench1.bas │ ├── rfbench2.bas │ ├── rfbench3.bas │ ├── rfbench4.bas │ ├── rfbench5.bas │ ├── rfbench6.bas │ ├── rfbench7.bas │ ├── rfbench8.bas │ ├── root.bas │ ├── string.bas │ ├── testfor.bas │ └── timetest.bas ├── 12systems │ ├── 23matchl.bas │ ├── README.md │ ├── blink.bas │ ├── dispbuf.bas │ ├── eeprom.bas │ ├── flame.bas │ ├── graph.bas │ ├── hello.bas │ ├── lcdlight.bas │ ├── lcdpulse.bas │ ├── minmax.bas │ ├── pircount.bas │ ├── pulse.bas │ ├── shield.bas │ └── stopw.bas ├── 13wire │ ├── README.md │ ├── analogm.bas │ ├── analogm2.bas │ ├── analogr.bas │ ├── analogr2.bas │ ├── clock.bas │ ├── eeprom.bas │ ├── ident.bas │ ├── masterr.bas │ ├── masterw.bas │ ├── register.bas │ ├── scan.bas │ ├── slaver.bas │ └── slaves.bas ├── 14games │ ├── 23match.bas │ ├── README.md │ ├── aceyduc.bas │ ├── amazing.bas │ ├── animal.bas │ ├── awari.bas │ ├── bagels.bas │ ├── banner.bas │ ├── basket.bas │ ├── batnum.bas │ ├── battle.bas │ ├── blackjk.bas │ ├── bomb.bas │ ├── bombsaw.bas │ ├── bounce.bas │ ├── bowling.bas │ ├── boxing.bas │ ├── bug.bas │ ├── bullfight.bas │ ├── bullseye.bas │ ├── buzzword.bas │ ├── calendar.bas │ ├── change.bas │ ├── checkers.bas │ ├── chemist.bas │ ├── chief.bas │ ├── chomp.bas │ ├── civilwar.bas │ ├── combat.bas │ ├── craps.bas │ ├── cube.bas │ ├── depthcha.bas │ ├── diamond.bas │ ├── dice.bas │ ├── digits.bas │ ├── evenwins.bas │ ├── flipflop.bas │ ├── football.bas │ ├── ftball.bas │ ├── furtrade.bas │ ├── gevenwin.bas │ ├── golf.bas │ ├── gomoko.bas │ ├── guess.bas │ ├── gunner.bas │ ├── hamurabi.bas │ ├── hangman.bas │ ├── hello.bas │ ├── hexapawn.bas │ ├── hi-lo.bas │ ├── highiq.bas │ ├── hockey.bas │ ├── horserace.bas │ ├── hurkle.bas │ ├── kinema.bas │ ├── king.bas │ ├── lem.bas │ ├── letter.bas │ ├── life.bas │ ├── lifefortwo.bas │ ├── litquiz.bas │ ├── love.bas │ ├── lunar.bas │ ├── mastermind.bas │ ├── mathdice.bas │ ├── mkbuildin.bas │ ├── mugwump.bas │ ├── nicomach.bas │ ├── nim.bas │ ├── number.bas │ ├── onecheck.bas │ ├── orbit.bas │ ├── pizza.bas │ ├── poetry1.bas │ ├── poetry2.bas │ ├── poker.bas │ ├── qubic.bas │ ├── queen.bas │ ├── reverse.bas │ ├── rocket.bas │ ├── rockscis.bas │ ├── roulette.bas │ ├── russian.bas │ ├── salvo.bas │ ├── sinewave.bas │ ├── slalom.bas │ ├── slots.bas │ ├── stars.bas │ ├── stocks.bas │ ├── superstartrek.bas │ ├── superstartrekins.bas │ ├── synonym.bas │ ├── target.bas │ ├── tictac.bas │ ├── tictac2.bas │ ├── tictacf.bas │ ├── tower.bas │ ├── train.bas │ ├── trap.bas │ ├── trek.bas │ ├── war.bas │ ├── weekday.bas │ └── word.bas ├── 15radio │ ├── README.md │ ├── rf24rdr.bas │ ├── rf24rdra.bas │ ├── rf24wrt.bas │ └── rf24wrta.bas ├── 16mqtt │ ├── README.md │ ├── analog.bas │ ├── digital.bas │ └── mqttmod.bas ├── 17robot │ ├── echo.bas │ ├── firsttest.bas │ ├── look.bas │ ├── remote.bas │ ├── servo.bas │ ├── turtle.bas │ ├── turtleb.bas │ ├── turtleesp32.bas │ ├── turtlemqtt32.bas │ ├── turtlex.bas │ └── turtlexesp32.bas ├── 98testsArduino │ ├── corep.bas │ └── mkbuildin.bas ├── 99tests │ ├── 01hello.bas │ ├── 01hello.bas.res │ ├── 02print.bas │ ├── 02print.bas.res │ ├── 03let.bas │ ├── 03let.bas.res │ ├── 04goto.bas │ ├── 04goto.bas.res │ ├── 05gosub.bas │ ├── 05gosub.bas.res │ ├── 06for.bas │ ├── 06for.bas.res │ ├── 07array.bas │ ├── 07array.bas.res │ ├── 08string1.bas │ ├── 08string1.bas.res │ ├── 09string2.bas │ ├── 09string2.bas.res │ ├── 10string3.bas │ ├── 10string3.bas.res │ ├── 11string4.bas │ ├── 11string4.bas.res │ ├── 12clrvars.bas │ ├── 12clrvars.bas.res │ ├── 13cond.bas │ ├── 13cond.bas.res │ ├── 14fibo.bas │ ├── 14fibo.bas.res │ ├── 15logic.bas │ ├── 15logic.bas.res │ ├── 16parable.bas │ ├── 16parable.bas.res │ ├── 17fileio.bas │ ├── 17fileio.bas.res │ ├── 18func.bas │ ├── 18func.bas.res │ ├── 19readdata.bas │ ├── 19readdata.bas.res │ ├── 20ongo.bas │ ├── 20ongo.bas.res │ ├── 21ongosub.bas │ ├── 21ongosub.bas.res │ ├── 22trig.bas │ ├── 22trig.bas.res │ ├── 23stir.bas │ ├── 23stir.bas.res │ ├── 24mandel.bas │ ├── 24mandel.bas.res │ ├── 25malloc.bas │ ├── 25malloc.bas.res │ ├── 26eval.bas │ ├── 26eval.bas.res │ ├── 27splitstr.bas │ ├── 27splitstr.bas.res │ ├── 28convert.bas │ ├── 28convert.bas.res │ ├── 29timestop.bas │ ├── 29timestop.bas.res │ ├── 30every.bas │ ├── 30every.bas.res │ ├── 31error.bas │ ├── 31error.bas.res │ ├── 32euler9.bas │ ├── 32euler9.bas.res │ ├── 33primes.bas │ ├── 33primes.bas.res │ ├── 34primesl.bas │ ├── 34primesl.bas.res │ ├── 35math.bas │ ├── 35math.bas.res │ ├── 36tictac.bas │ ├── 36tictac.bas.res │ ├── 37love.bas │ ├── 37love.bas.res │ ├── 38poetry.bas │ ├── 38poetry.bas.res │ ├── 39eliza.bas │ ├── 39eliza.bas.res │ ├── 40forfor.bas │ ├── 40forfor.bas.res │ ├── 41arrayfun.bas │ ├── 41arrayfun.bas.res │ ├── 42gosub.bas │ ├── 42gosub.bas.res │ ├── 45ongo.bas │ ├── 45ongo.bas.res │ ├── 46output.bas │ ├── 46output.bas.res │ ├── 47while.bas │ ├── 47while.bas.res │ ├── 48until.bas │ ├── 48until.bas.res │ ├── 49switch.bas │ ├── 49switch.bas.res │ ├── 50teststruct.bas │ ├── 50teststruct.bas.res │ ├── 51rocket.bas │ ├── 51rocket.bas.inp │ ├── 51rocket.bas.res │ ├── README.md │ └── testscript ├── 99testsBasic2 │ ├── 01hello.bas │ ├── 01hello.bas.res │ ├── 02print.bas │ ├── 02print.bas.res │ ├── 03let.bas │ ├── 03let.bas.res │ ├── 04goto.bas │ ├── 04goto.bas.res │ ├── 05gosub.bas │ ├── 05gosub.bas.res │ ├── 06for.bas │ ├── 06for.bas.res │ ├── 07array.bas │ ├── 07array.bas.res │ ├── 08string1.bas │ ├── 08string1.bas.res │ ├── 09string2.bas │ ├── 09string2.bas.res │ ├── 10string3.bas │ ├── 10string3.bas.res │ ├── 11string4.bas │ ├── 11string4.bas.res │ ├── 12clrvars.bas │ ├── 12clrvars.bas.res │ ├── 13cond.bas │ ├── 13cond.bas.res │ ├── 14fibo.bas │ ├── 14fibo.bas.res │ ├── 15logic.bas │ ├── 15logic.bas.res │ ├── 16parable.bas │ ├── 16parable.bas.res │ ├── 17fileio.bas │ ├── 17fileio.bas.res │ ├── 18func.bas │ ├── 18func.bas.res │ ├── 19readdata.bas │ ├── 19readdata.bas.res │ ├── 20ongo.bas │ ├── 20ongo.bas.res │ ├── 21ongosub.bas │ ├── 21ongosub.bas.res │ ├── 22trig.bas │ ├── 22trig.bas.res │ ├── 23stir.bas │ ├── 23stir.bas.res │ ├── 24mandel.bas │ ├── 24mandel.bas.res │ ├── 25malloc.bas │ ├── 25malloc.bas.res │ ├── 26eval.bas │ ├── 26eval.bas.res │ ├── 27splitstr.bas │ ├── 27splitstr.bas.res │ ├── 28convert.bas │ ├── 28convert.bas.res │ ├── 29timestop.bas │ ├── 29timestop.bas.res │ ├── 30every.bas │ ├── 30every.bas.res │ ├── 31error.bas │ ├── 31error.bas.res │ ├── 32euler9.bas │ ├── 32euler9.bas.res │ ├── 33primes.bas │ ├── 33primes.bas.res │ ├── 34primesl.bas │ ├── 34primesl.bas.res │ ├── 35math.bas │ ├── 35math.bas.res │ ├── 36tictac.bas │ ├── 36tictac.bas.res │ ├── 37love.bas │ ├── 37love.bas.res │ ├── 38poetry.bas │ ├── 38poetry.bas.res │ ├── 39eliza.bas │ ├── 39eliza.bas.res │ ├── 40forfor.bas │ ├── 40forfor.bas.res │ ├── 41arrayfun.bas │ ├── 41arrayfun.bas.res │ ├── 42gosub.bas │ ├── 42gosub.bas.res │ ├── 43gogogo.bas │ ├── 43gogogo.bas.res │ ├── 44deffn.bas │ ├── 44deffn.bas.res │ ├── 45ongo.bas │ ├── 45ongo.bas.res │ ├── 46output.bas │ ├── 46output.bas.res │ ├── 47while.bas │ ├── 47while.bas.res │ ├── 48until.bas │ ├── 48until.bas.res │ ├── 49switch.bas │ ├── 49switch.bas.res │ ├── 50teststruct.bas │ ├── 50teststruct.bas.res │ ├── 51rocket.bas │ ├── 51rocket.bas.inp │ ├── 51rocket.bas.res │ ├── 52eliza-org.bas │ ├── 52eliza-org.bas.inp │ ├── 52eliza-org.bas.res │ ├── 54word.bas │ ├── 54word.bas.inp │ ├── 54word.bas.res │ ├── 55valtest.bas │ ├── 55valtest.bas.res │ ├── 56tinybasic.bas │ ├── 56tinybasic.bas.inp │ ├── 56tinybasic.bas.res │ ├── 57multifunc.bas │ ├── 57multifunc.bas.res │ ├── 58longnames.bas │ ├── 58longnames.bas.res │ ├── 59trek.bas │ ├── 59trek.bas.inp │ ├── 59trek.bas.res │ ├── 60rantest.bas │ ├── 60rantest.bas.res │ ├── 61euler.bas │ ├── 61euler.bas.res │ ├── 62testvalandstr.bas │ ├── 62testvalandstr.bas.res │ ├── README.md │ └── testscript └── README.md ├── misc ├── BASIC.sublime-syntax ├── PS2Keyboard.zip ├── PicoSerial-master.zip ├── UTFT.pdf ├── stefansbasic.stc └── trek.bas.org ├── test ├── aled.bas ├── bench.bas ├── bench.txt ├── bench2.bas ├── bench2.txt ├── clock.bas ├── clock1.bas ├── clock2.bas ├── clock3.bas ├── clock4.bas ├── tread1.bas ├── vt52test.bas └── vt52test2.bas └── utility ├── arduinoterm ├── dosify ├── monitor.py └── tc201.zip /.gitignore: -------------------------------------------------------------------------------- 1 | **/build/ 2 | **/.DS_Store 3 | tinybasic.geany 4 | 5 | -------------------------------------------------------------------------------- /Basic1/IotBasic/README.md: -------------------------------------------------------------------------------- 1 | # IoT BASIC for Arduino 2 | 3 | Use the files in this folder in your Arduino IDE. This is the development code. Use the folder IoTBASIC for the stable code. 4 | 5 | ## The files 6 | 7 | TinybasicArduino.ino is the sketch file with the main interpreter code. 8 | 9 | basic.h is the header file with the function prototypes and static variables of BASIC. 10 | 11 | hardware-arduino.h is the hardware abstraction library. 12 | 13 | ## How to compile the code 14 | 15 | Before building BASIC, edit TinybasicArduino.ino and the select the language set you want to compile. Follow the instructions in the wiki https://github.com/slviajero/tinybasic/wiki in "How to compile". 16 | 17 | You also need to edit hardware-arduino.h and select the hardware options. This is explained in the wiki as well. 18 | -------------------------------------------------------------------------------- /Basic1/IotBasic/font/README.md: -------------------------------------------------------------------------------- 1 | Only needed for EPaper - currently test code 2 | -------------------------------------------------------------------------------- /Basic1/IotBasic/wifisettings.h: -------------------------------------------------------------------------------- 1 | const char* ssid = "myssid"; 2 | const char* password = "mypasswd"; 3 | const char* mqtt_server = "test.mosquitto.org"; 4 | const short mqtt_port = 1883; 5 | byte mac[] = {0xDE, 0xAD, 0xBE, 0xE9, 0xE9, 0xE9}; 6 | -------------------------------------------------------------------------------- /Basic1/TinybasicArduino/README.md: -------------------------------------------------------------------------------- 1 | # IoT BASIC for Arduino 2 | 3 | Use the files in this folder in your Arduino IDE. This is the development code. Use the folder IoTBASIC for the stable code. 4 | 5 | ## The files 6 | 7 | TinybasicArduino.ino is the sketch file with the main interpreter code. 8 | 9 | basic.h is the header file with the function prototypes and static variables of BASIC. 10 | 11 | hardware-arduino.h is the hardware abstraction library. 12 | 13 | ## How to compile the code 14 | 15 | Before building BASIC, edit TinybasicArduino.ino and the select the language set you want to compile. Follow the instructions in the wiki https://github.com/slviajero/tinybasic/wiki in "How to compile". 16 | 17 | You also need to edit hardware-arduino.h and select the hardware options. This is explained in the wiki as well. 18 | -------------------------------------------------------------------------------- /Basic1/TinybasicArduino/wifisettings.h: -------------------------------------------------------------------------------- 1 | const char* ssid = "daheim-iot"; 2 | const char* password = "xacobeo7"; 3 | const char* mqtt_server = "test.mosquitto.org"; 4 | const short mqtt_port = 1883; 5 | byte mac[] = {0xDE, 0xAD, 0xBE, 0xE9, 0xE9, 0xE9}; 6 | -------------------------------------------------------------------------------- /Basic2/IoTBasic/boards/aim65.h: -------------------------------------------------------------------------------- 1 | /* the AIM 65 lookalike */ 2 | #define ARDUINOPS2 3 | #define DISPLAYCANSCROLL 4 | #define ARDUINOLCDI2C 5 | #define ARDUINOEEPROM 6 | #define STANDALONE 7 | -------------------------------------------------------------------------------- /Basic2/IoTBasic/boards/avrlcd.h: -------------------------------------------------------------------------------- 1 | /* an AVR ARDUINO (UNO or MEGA) with the classical LCD shield */ 2 | #define DISPLAYCANSCROLL 3 | #define LCDSHIELD 4 | -------------------------------------------------------------------------------- /Basic2/IoTBasic/boards/avrmcufriend.h: -------------------------------------------------------------------------------- 1 | /* an AVR ARDUINO (UNO or MEGA) with a parallel TFT */ 2 | #define DISPLAYCANSCROLL 3 | #define ARDUINOMCUFRIEND 4 | -------------------------------------------------------------------------------- /Basic2/IoTBasic/boards/duetft.h: -------------------------------------------------------------------------------- 1 | /* 2 | * DUE with a TFT shield, standalone by default 3 | */ 4 | #undef ARDUINOEEPROM 5 | #define ARDUINOPS2 6 | #undef ARDUINOUSBKBD 7 | #define DISPLAYCANSCROLL 8 | #define ARDUINOTFT 9 | #define ARDUINOSD 10 | #define ARDUINOWIRE 11 | #define ARDUINOPRT 12 | #define ARDUINORTC 13 | #define PS2DATAPIN 9 14 | #define PS2IRQPIN 8 15 | #define SDPIN 53 16 | #define STANDALONE 17 | -------------------------------------------------------------------------------- /Basic2/IoTBasic/boards/dummy.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/Basic2/IoTBasic/boards/dummy.h -------------------------------------------------------------------------------- /Basic2/IoTBasic/boards/esp32board.h: -------------------------------------------------------------------------------- 1 | /* an ESP32 board with an ILI9488 display, 2 | some SD problems here with some hardware */ 3 | #define ILI_CS 12 4 | #define ILI_DC 27 5 | #define ILI_RST 14 6 | #define ILI_LED 26 7 | #undef ARDUINOPICOSERIAL 8 | #define ESPSPIFFS 9 | #define DISPLAYCANSCROLL 10 | #define ARDUINOILI9488 11 | #define ARDUINOEEPROM 12 | #define ARDUINOMQTT 13 | #define ARDUINOWIRE 14 | -------------------------------------------------------------------------------- /Basic2/IoTBasic/boards/esp32cam.h: -------------------------------------------------------------------------------- 1 | /* the ESP32 camera */ 2 | /* needs an MMC SD card and has its own drivers */ 3 | #define ESPSDCAM 4 | -------------------------------------------------------------------------------- /Basic2/IoTBasic/boards/megaboard.h: -------------------------------------------------------------------------------- 1 | /* 2 | * A board for the MEGA with 64 kB RAM, SD Card, and real time clock 3 | */ 4 | #undef ARDUINOPICOSERIAL 5 | #define DISPLAYCANSCROLL 6 | #define ARDUINOLCDI2C 7 | #define ARDUINOEEPROM 8 | #define ARDUINOPRT 9 | #define ARDUINOSD 10 | #define ARDUINOWIRE 11 | #define ARDUINORTC 12 | #define ARDUINOSPIRAM 13 | #define RAMPIN 53 14 | #define SDPIN 49 15 | -------------------------------------------------------------------------------- /Basic2/IoTBasic/boards/megashield.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Mega with a Ethernet shield 3 | * standalone capable, Ethernet is not enabled by default 4 | */ 5 | #define ARDUINOEEPROM 6 | #define ARDUINOPS2 7 | #define DISPLAYCANSCROLL 8 | #define ARDUINOLCDI2C 9 | #define ARDUINOSD 10 | #define ARDUINOWIRE 11 | #define ARDUINOPRT 12 | #define SDPIN 4 13 | //#define ARDUINOETH 14 | -------------------------------------------------------------------------------- /Basic2/IoTBasic/boards/megatft.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MEGA with a TFT shield, standalone by default 3 | */ 4 | #define ARDUINOEEPROM 5 | #define ARDUINOPS2 6 | #define DISPLAYCANSCROLL 7 | #define ARDUINOTFT 8 | #define ARDUINOSD 9 | #define ARDUINOWIRE 10 | #define ARDUINOPRT 11 | #define PS2DATAPIN 18 12 | #define PS2IRQPIN 19 13 | #define SDPIN 53 14 | #define STANDALONE 15 | -------------------------------------------------------------------------------- /Basic2/IoTBasic/boards/mkr1010board.h: -------------------------------------------------------------------------------- 1 | /* a board based on the Arduino MKR 1010 Wifi 2 | * made for low energy games 3 | */ 4 | #define ILI_CS 7 5 | #define ILI_DC 4 6 | #define ILI_RST 6 7 | #define ILI_LED A3 8 | #undef ARDUINOPICOSERIAL 9 | #define DISPLAYCANSCROLL 10 | #define ARDUINOILI9488 11 | #define ARDUINOEFS 12 | #define ARDUINOMQTT 13 | #define ARDUINOWIRE 14 | /* EEPROM emulation is possible, takes 2k of memory */ 15 | #undef ARDUINOEEPROM 16 | /* careful with the setting, lockout possible easily */ 17 | #undef ARDUINOUSBKBD 18 | #undef STANDALONE 19 | -------------------------------------------------------------------------------- /Basic2/IoTBasic/boards/nanoboard.h: -------------------------------------------------------------------------------- 1 | /* 2 | *Arduino Nano Every board with PS2 keyboard and sensor 3 | */ 4 | #undef ARDUINOPICOSERIAL 5 | #define ARDUINOPS2 6 | #define DISPLAYCANSCROLL 7 | #define ARDUINOLCDI2C 8 | #define ARDUINOEEPROM 9 | #define ARDUINOPRT 10 | #define ARDUINOEFS 11 | #define ARDUINORTC 12 | #define ARDUINOWIRE 13 | #define EFSEEPROMADDR 0x050 /* use clock EEPROM 0x057, set to 0x050 for external EEPROM */ 14 | #define STANDALONE 15 | -------------------------------------------------------------------------------- /Basic2/IoTBasic/boards/rp2040board.h: -------------------------------------------------------------------------------- 1 | /* an RP2040 based board with an ILI9488 display */ 2 | #undef ARDUINOPICOSERIAL 3 | #define DISPLAYCANSCROLL 4 | #define ARDUINOILI9488 5 | #undef ARDUINOEEPROM 6 | #define ARDUINOI2CEEPROM 7 | #define ARDUINOPRT 8 | #define ARDUINOSD 9 | #undef RP2040LITTLEFS 10 | #define ARDUINOWIRE 11 | #define ARDUINORTC 12 | #define ARDUINOPS2 13 | #define ARDUINOMQTT 14 | #define STANDALONE 15 | -------------------------------------------------------------------------------- /Basic2/IoTBasic/boards/rp2040board2.h: -------------------------------------------------------------------------------- 1 | /* an RP2040 Raspberry Pi Pico based board with an ILI9488 display */ 2 | #undef ARDUINOPICOSERIAL 3 | #define DISPLAYCANSCROLL 4 | #define ARDUINOILI9488 5 | #undef ARDUINOEEPROM 6 | #undef ARDUINOPRT 7 | #undef ARDUINOSD 8 | #define RP2040LITTLEFS 9 | #undef ARDUINOWIRE 10 | #undef ARDUINORTC 11 | #undef ARDUINOPS2 12 | #undef ARDUINOMQTT 13 | #undef STANDALONE 14 | #define ILI_LED A2 15 | #define ILI_CS 15 16 | #define ILI_RST 14 17 | #define ILI_DC 13 18 | -------------------------------------------------------------------------------- /Basic2/IoTBasic/boards/unoboard.h: -------------------------------------------------------------------------------- 1 | /* a UNO shield with memory and EFS EEPROM */ 2 | #define ARDUINOEEPROM 3 | #define ARDUINOSPIRAM 4 | #define ARDUINOEFS 5 | #define ARDUINOWIRE 6 | #define EFSEEPROMADDR 0x050 7 | #define EFSEEPROMSIZE 65534 8 | -------------------------------------------------------------------------------- /Basic2/IoTBasic/boards/wemosshield.h: -------------------------------------------------------------------------------- 1 | /* 2 | * a Wemos ESP8266 with a mdified datalogger shield 3 | * standalone capable, with Wire and MQTT. 4 | */ 5 | #define ARDUINOEEPROM 6 | #define ARDUINOPS2 7 | #define DISPLAYCANSCROLL 8 | #define ARDUINOLCDI2C 9 | #define ARDUINOSD 10 | #define ARDUINORTC 11 | #define ARDUINOWIRE 12 | #define SDPIN D8 13 | #define PS2DATAPIN D2 14 | #define PS2IRQPIN D9 15 | #define ARDUINOMQTT 16 | -------------------------------------------------------------------------------- /Basic2/IoTBasic/font/README.md: -------------------------------------------------------------------------------- 1 | Only needed for EPaper - currently test code 2 | -------------------------------------------------------------------------------- /Basic2/IoTBasic/src/FlashStorage_SAMD/README.md: -------------------------------------------------------------------------------- 1 | Flash EEPROM libray for SAMD from 2 | https://github.com/khoih-prog/FlashStorage_SAMD 3 | written by Christian Maglie and Khoi Huang. 4 | Licence: GPL as defined in the original repo. 5 | -------------------------------------------------------------------------------- /Basic2/IoTBasic/src/Runtime/README.md: -------------------------------------------------------------------------------- 1 | These are libaries taken out of the runtime.cpp main code 2 | and encapsulated to make the code simpler. 3 | -------------------------------------------------------------------------------- /Basic2/IoTBasic/wifisettings.h: -------------------------------------------------------------------------------- 1 | const char* ssid = ""; 2 | const char* password = ""; 3 | const char* mqtt_server = "test.mosquitto.org"; 4 | const char* mqtt_user = ""; 5 | const char* mqtt_passwd = ""; 6 | const short mqtt_port = 1883; 7 | byte mac[] = {0xDE, 0xAD, 0xBE, 0xE9, 0xE9, 0xE9}; 8 | -------------------------------------------------------------------------------- /Basic2/MSDOS/README.md: -------------------------------------------------------------------------------- 1 | The MSDOS code. 2 | 3 | Largely identical to Posix, CR added at the end of each line and hardware settings done right. 4 | 5 | Compile with Turbo C 2.x using 6 | 7 | tcc basic.c runtime.c -lm 8 | -------------------------------------------------------------------------------- /Basic2/MSDOS/dosify: -------------------------------------------------------------------------------- 1 | cat $1 | sed 's/\/\/.*$//g' | perl -pe 's/\r\n|\n|\r/\r\n/g' | sed 's/^#undef.*MSDOS/#define MSDOS/' | sed 's/^#define.*POSIX/#undef POSIX/' 2 | -------------------------------------------------------------------------------- /Basic2/MSDOS/getcode: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | SOURCE=../Posix/ 4 | # Put your DOSEMU folder here 5 | DOSDIR=/Users/stefan/Documents/DOS/B20 6 | files="basic.c basic.h language.h runtime.c runtime.h hardware.h" 7 | 8 | for file in $files 9 | do 10 | ./dosify $SOURCE/$file > $file 11 | cp $file $DOSDIR 12 | done 13 | -------------------------------------------------------------------------------- /Basic2/Posix/src/Runtime/esp32cam.h: -------------------------------------------------------------------------------- 1 | /* 2 | * the commands and includes needed for the esp32 camera 3 | * - first set of runtime routines to be encapsulated 4 | * on POSIx this is a dummy to help with development 5 | */ 6 | 7 | 8 | extern void outsc(char*); 9 | 10 | void camerabegin() { 11 | outsc("esp32cam: camera begin\n"); 12 | } 13 | 14 | void cameraget() { 15 | outsc("esp32cam: camera get\n"); 16 | } 17 | 18 | void camerasave() { 19 | outsc("esp32cam: camera save\n"); 20 | } 21 | 22 | void cameraset() { 23 | outsc("esp32cam: camera set\n"); 24 | } 25 | 26 | -------------------------------------------------------------------------------- /Basic2/RaspPi/README.md: -------------------------------------------------------------------------------- 1 | The Raspberry PI fileset of BASIC. 2 | 3 | Largely identical to Posix. 4 | 5 | Settings here are active framebuffer and PIGPIO support. 6 | 7 | Compile with 8 | 9 | gcc basic.c runtime.c -lm -lpipgpiod_lf2 10 | 11 | and start pigpiod before using BASIC. 12 | 13 | If Wiring is activated in hardware.h compile with 14 | 15 | gcc basic.c runtime.c -lm -lwiringPi 16 | -------------------------------------------------------------------------------- /Basic2/Windows/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/Basic2/Windows/README.md -------------------------------------------------------------------------------- /IotBasic/README.md: -------------------------------------------------------------------------------- 1 | The files in this folder has been moved to the folder Basic1. 2 | The 1.x version of Stefan's Basic is no longer actively developed. 3 | Please use the 2.x version in Basic2 instead. 4 | -------------------------------------------------------------------------------- /TinybasicArduino/README.md: -------------------------------------------------------------------------------- 1 | The files in this folder has been moved to the folder Basic1. 2 | The 1.x version of Stefan's Basic is no longer actively developed. 3 | Please use the 2.x version in Basic2 instead. 4 | -------------------------------------------------------------------------------- /docs/BASICs/101_BASIC_Computer_Games_Mar75.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/BASICs/101_BASIC_Computer_Games_Mar75.pdf -------------------------------------------------------------------------------- /docs/BASICs/AltairBasic_1275.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/BASICs/AltairBasic_1275.pdf -------------------------------------------------------------------------------- /docs/BASICs/Apple2AppleSoftBASICRef1977.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/BASICs/Apple2AppleSoftBASICRef1977.pdf -------------------------------------------------------------------------------- /docs/BASICs/Creative_Computing_v10_n03_1984_Mar_0007.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/BASICs/Creative_Computing_v10_n03_1984_Mar_0007.jpeg -------------------------------------------------------------------------------- /docs/BASICs/ECMA-55_1st_edition_january_1978.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/BASICs/ECMA-55_1st_edition_january_1978.pdf -------------------------------------------------------------------------------- /docs/BASICs/Kilobaud_1977_June.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/BASICs/Kilobaud_1977_June.pdf -------------------------------------------------------------------------------- /docs/BASICs/TinyBASIC-2.0.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/BASICs/TinyBASIC-2.0.pdf -------------------------------------------------------------------------------- /docs/BASICs/aim65_basic.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/BASICs/aim65_basic.pdf -------------------------------------------------------------------------------- /docs/BASICs/apple1_basic_manual.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/BASICs/apple1_basic_manual.pdf -------------------------------------------------------------------------------- /docs/components/ABX00053-datasheet.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/components/ABX00053-datasheet.pdf -------------------------------------------------------------------------------- /docs/components/Atmel-8869-SEEPROM-AT24CS32-Datasheet.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/components/Atmel-8869-SEEPROM-AT24CS32-Datasheet.pdf -------------------------------------------------------------------------------- /docs/components/BMP280datasheet.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/components/BMP280datasheet.pdf -------------------------------------------------------------------------------- /docs/components/BST-BME280_DS001-10.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/components/BST-BME280_DS001-10.pdf -------------------------------------------------------------------------------- /docs/components/DS1307.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/components/DS1307.pdf -------------------------------------------------------------------------------- /docs/components/DS3231 Real Time Clock Connection Diagrams.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/components/DS3231 Real Time Clock Connection Diagrams.pdf -------------------------------------------------------------------------------- /docs/components/DS3231 Real Time Clock Datenblatt AZ-Delivery Vertriebs GmbH.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/components/DS3231 Real Time Clock Datenblatt AZ-Delivery Vertriebs GmbH.pdf -------------------------------------------------------------------------------- /docs/components/DS3231.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/components/DS3231.pdf -------------------------------------------------------------------------------- /docs/components/DS3232.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/components/DS3232.pdf -------------------------------------------------------------------------------- /docs/components/DUE_Shield_schematic.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/components/DUE_Shield_schematic.pdf -------------------------------------------------------------------------------- /docs/components/Digispark.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/components/Digispark.pdf -------------------------------------------------------------------------------- /docs/components/ESP8266-01 USB-Stick DE.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/components/ESP8266-01 USB-Stick DE.pdf -------------------------------------------------------------------------------- /docs/components/KeyboardController.pages: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/components/KeyboardController.pages -------------------------------------------------------------------------------- /docs/components/KeyboardController.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/components/KeyboardController.pdf -------------------------------------------------------------------------------- /docs/components/PS2Keyboard Library, Connect a keyboard for user input.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/components/PS2Keyboard Library, Connect a keyboard for user input.pdf -------------------------------------------------------------------------------- /docs/components/Pinout-NANOevery_latest.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/components/Pinout-NANOevery_latest.pdf -------------------------------------------------------------------------------- /docs/components/Programming+the+Wemos+Mega+Wifi+Board.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/components/Programming+the+Wemos+Mega+Wifi+Board.pdf -------------------------------------------------------------------------------- /docs/components/RK-10290_410.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/components/RK-10290_410.pdf -------------------------------------------------------------------------------- /docs/components/SSD1306.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/components/SSD1306.pdf -------------------------------------------------------------------------------- /docs/components/SSD1963_v1.6.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/components/SSD1963_v1.6.pdf -------------------------------------------------------------------------------- /docs/components/ThermalprinterSpecs.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/components/ThermalprinterSpecs.pdf -------------------------------------------------------------------------------- /docs/components/doc0336.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/components/doc0336.pdf -------------------------------------------------------------------------------- /docs/components/vga32_v1.4.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/components/vga32_v1.4.pdf -------------------------------------------------------------------------------- /docs/img/Aim-65.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/Aim-65.jpeg -------------------------------------------------------------------------------- /docs/img/CoolTerm1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/CoolTerm1.png -------------------------------------------------------------------------------- /docs/img/CoolTerm2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/CoolTerm2.png -------------------------------------------------------------------------------- /docs/img/CoolTerm3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/CoolTerm3.png -------------------------------------------------------------------------------- /docs/img/ESP8266-NodeMCU-kit-12-E-pinout-gpio-pin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/ESP8266-NodeMCU-kit-12-E-pinout-gpio-pin.png -------------------------------------------------------------------------------- /docs/img/IMG_0128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_0128.png -------------------------------------------------------------------------------- /docs/img/IMG_0479.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_0479.png -------------------------------------------------------------------------------- /docs/img/IMG_3135.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_3135.png -------------------------------------------------------------------------------- /docs/img/IMG_3158.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_3158.png -------------------------------------------------------------------------------- /docs/img/IMG_3843.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_3843.png -------------------------------------------------------------------------------- /docs/img/IMG_3846.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_3846.png -------------------------------------------------------------------------------- /docs/img/IMG_3882.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_3882.png -------------------------------------------------------------------------------- /docs/img/IMG_3920.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_3920.png -------------------------------------------------------------------------------- /docs/img/IMG_3995.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_3995.png -------------------------------------------------------------------------------- /docs/img/IMG_4020.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_4020.png -------------------------------------------------------------------------------- /docs/img/IMG_4043.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_4043.png -------------------------------------------------------------------------------- /docs/img/IMG_4044.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_4044.png -------------------------------------------------------------------------------- /docs/img/IMG_4089.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_4089.png -------------------------------------------------------------------------------- /docs/img/IMG_4210.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_4210.png -------------------------------------------------------------------------------- /docs/img/IMG_4211.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_4211.png -------------------------------------------------------------------------------- /docs/img/IMG_4212.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_4212.png -------------------------------------------------------------------------------- /docs/img/IMG_4213.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_4213.png -------------------------------------------------------------------------------- /docs/img/IMG_4214.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_4214.png -------------------------------------------------------------------------------- /docs/img/IMG_4215.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_4215.png -------------------------------------------------------------------------------- /docs/img/IMG_4216.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_4216.png -------------------------------------------------------------------------------- /docs/img/IMG_4217.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_4217.png -------------------------------------------------------------------------------- /docs/img/IMG_4219.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_4219.png -------------------------------------------------------------------------------- /docs/img/IMG_4220.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_4220.png -------------------------------------------------------------------------------- /docs/img/IMG_4221.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_4221.png -------------------------------------------------------------------------------- /docs/img/IMG_4223.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_4223.png -------------------------------------------------------------------------------- /docs/img/IMG_4226.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_4226.png -------------------------------------------------------------------------------- /docs/img/IMG_4228.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_4228.png -------------------------------------------------------------------------------- /docs/img/IMG_4229.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_4229.png -------------------------------------------------------------------------------- /docs/img/IMG_4230.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_4230.png -------------------------------------------------------------------------------- /docs/img/IMG_4231.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_4231.png -------------------------------------------------------------------------------- /docs/img/IMG_4232.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_4232.png -------------------------------------------------------------------------------- /docs/img/IMG_4233.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_4233.png -------------------------------------------------------------------------------- /docs/img/IMG_4234.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_4234.png -------------------------------------------------------------------------------- /docs/img/IMG_4236.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_4236.png -------------------------------------------------------------------------------- /docs/img/IMG_4248.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_4248.png -------------------------------------------------------------------------------- /docs/img/IMG_4249.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_4249.png -------------------------------------------------------------------------------- /docs/img/IMG_4271.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_4271.png -------------------------------------------------------------------------------- /docs/img/IMG_4272.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_4272.png -------------------------------------------------------------------------------- /docs/img/IMG_4284.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_4284.png -------------------------------------------------------------------------------- /docs/img/IMG_4285.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_4285.png -------------------------------------------------------------------------------- /docs/img/IMG_4286.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_4286.png -------------------------------------------------------------------------------- /docs/img/IMG_4287.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_4287.png -------------------------------------------------------------------------------- /docs/img/IMG_4288.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_4288.png -------------------------------------------------------------------------------- /docs/img/IMG_4289.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_4289.png -------------------------------------------------------------------------------- /docs/img/IMG_4290.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_4290.png -------------------------------------------------------------------------------- /docs/img/IMG_4291.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_4291.png -------------------------------------------------------------------------------- /docs/img/IMG_4296.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_4296.png -------------------------------------------------------------------------------- /docs/img/IMG_4297.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_4297.png -------------------------------------------------------------------------------- /docs/img/IMG_4299.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_4299.png -------------------------------------------------------------------------------- /docs/img/IMG_4305.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_4305.png -------------------------------------------------------------------------------- /docs/img/IMG_4306.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_4306.png -------------------------------------------------------------------------------- /docs/img/IMG_4308.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_4308.png -------------------------------------------------------------------------------- /docs/img/IMG_4315.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_4315.png -------------------------------------------------------------------------------- /docs/img/IMG_4316.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_4316.png -------------------------------------------------------------------------------- /docs/img/IMG_4317.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_4317.png -------------------------------------------------------------------------------- /docs/img/IMG_4331.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_4331.png -------------------------------------------------------------------------------- /docs/img/IMG_4375.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_4375.png -------------------------------------------------------------------------------- /docs/img/IMG_4376.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_4376.png -------------------------------------------------------------------------------- /docs/img/IMG_4378.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_4378.png -------------------------------------------------------------------------------- /docs/img/IMG_4382.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_4382.png -------------------------------------------------------------------------------- /docs/img/IMG_4403.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_4403.png -------------------------------------------------------------------------------- /docs/img/IMG_4415-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_4415-1.png -------------------------------------------------------------------------------- /docs/img/IMG_4415.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_4415.png -------------------------------------------------------------------------------- /docs/img/IMG_4417.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_4417.png -------------------------------------------------------------------------------- /docs/img/IMG_4418.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_4418.png -------------------------------------------------------------------------------- /docs/img/IMG_4426.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_4426.png -------------------------------------------------------------------------------- /docs/img/IMG_4428.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_4428.png -------------------------------------------------------------------------------- /docs/img/IMG_4487.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_4487.png -------------------------------------------------------------------------------- /docs/img/IMG_4488.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_4488.png -------------------------------------------------------------------------------- /docs/img/IMG_4489.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_4489.png -------------------------------------------------------------------------------- /docs/img/IMG_4491.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_4491.png -------------------------------------------------------------------------------- /docs/img/IMG_4492.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_4492.png -------------------------------------------------------------------------------- /docs/img/IMG_4493.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_4493.png -------------------------------------------------------------------------------- /docs/img/IMG_4494.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_4494.png -------------------------------------------------------------------------------- /docs/img/IMG_4498.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_4498.png -------------------------------------------------------------------------------- /docs/img/IMG_4499.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_4499.png -------------------------------------------------------------------------------- /docs/img/IMG_4500.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_4500.png -------------------------------------------------------------------------------- /docs/img/IMG_4501.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_4501.png -------------------------------------------------------------------------------- /docs/img/IMG_4663.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_4663.png -------------------------------------------------------------------------------- /docs/img/IMG_4669.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_4669.png -------------------------------------------------------------------------------- /docs/img/IMG_4671.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_4671.png -------------------------------------------------------------------------------- /docs/img/IMG_5001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_5001.png -------------------------------------------------------------------------------- /docs/img/IMG_5002.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_5002.png -------------------------------------------------------------------------------- /docs/img/IMG_5003.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_5003.png -------------------------------------------------------------------------------- /docs/img/IMG_5613.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_5613.png -------------------------------------------------------------------------------- /docs/img/IMG_5638.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_5638.png -------------------------------------------------------------------------------- /docs/img/IMG_5701.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_5701.png -------------------------------------------------------------------------------- /docs/img/IMG_5703.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_5703.png -------------------------------------------------------------------------------- /docs/img/IMG_5704.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_5704.png -------------------------------------------------------------------------------- /docs/img/IMG_5705.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_5705.png -------------------------------------------------------------------------------- /docs/img/IMG_5768.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_5768.png -------------------------------------------------------------------------------- /docs/img/IMG_5888.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_5888.png -------------------------------------------------------------------------------- /docs/img/IMG_5893.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_5893.png -------------------------------------------------------------------------------- /docs/img/IMG_6817.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_6817.png -------------------------------------------------------------------------------- /docs/img/IMG_7220.mov: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/IMG_7220.mov -------------------------------------------------------------------------------- /docs/img/Readme.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/Readme.md -------------------------------------------------------------------------------- /docs/img/TTGO-VGA-HW.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/TTGO-VGA-HW.jpeg -------------------------------------------------------------------------------- /docs/img/TTGOVGA-Specs.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/TTGOVGA-Specs.jpeg -------------------------------------------------------------------------------- /docs/img/nrf24l01_pinout_qfp5d3C9qD.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/nrf24l01_pinout_qfp5d3C9qD.jpeg -------------------------------------------------------------------------------- /docs/img/shieldmod1_Steckplatine.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/img/shieldmod1_Steckplatine.png -------------------------------------------------------------------------------- /docs/tutorial/BASIC on Arduinos - Introduction.epub: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/tutorial/BASIC on Arduinos - Introduction.epub -------------------------------------------------------------------------------- /docs/tutorial/BASIC on Arduinos - Introduction.pages: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/tutorial/BASIC on Arduinos - Introduction.pages -------------------------------------------------------------------------------- /docs/wire/AIM65.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/wire/AIM65.fzz -------------------------------------------------------------------------------- /docs/wire/TFTcomputer.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/wire/TFTcomputer.fzz -------------------------------------------------------------------------------- /docs/wire/shieldmod1.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/wire/shieldmod1.fzz -------------------------------------------------------------------------------- /docs/wire/shieldmod2.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/docs/wire/shieldmod2.fzz -------------------------------------------------------------------------------- /examples/00tutorial/arch.bas: -------------------------------------------------------------------------------- 1 | 10 CLS 2 | 20 A=0.5 3 | 30 L=8 4 | 40 S=2 5 | 50 X0=40 6 | 60 Y0=15 7 | 70 DEF FN X(W)=S*A*W*SIN(W)+X0 8 | 80 DEF FN Y(W)=A*W*COS(W)+Y0 9 | 100 FOR W=0 TO 3.14*L STEP 0.1 10 | 110 LOCATE FN X(W),FN Y(W) 11 | 120 PUT "x" 12 | 130 NEXT 13 | 300 PRINT 14 | -------------------------------------------------------------------------------- /examples/00tutorial/archvt52.bas: -------------------------------------------------------------------------------- 1 | 10 PUT 27, "E" 2 | 20 A=0.5 3 | 30 L=8 4 | 40 S=2 5 | 50 X0=40 6 | 60 Y0=15 7 | 70 DEF FN X(W)=S*A*W*SIN(W)+X0 8 | 80 DEF FN Y(W)=A*W*COS(W)+Y0 9 | 100 FOR W=0 TO 3.14*L STEP 0.1 10 | 110 PUT27, "Y", 31+FN Y(W),31+FN X(W) 11 | 120 PUT "x" 12 | 130 NEXT 13 | 300 PRINT 14 | -------------------------------------------------------------------------------- /examples/00tutorial/clock.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Show the time and date of the real time clock" 2 | 20 REM "" 3 | 100 REM "The day is never 0 if the clock runs" 4 | 110 IF @T(3)=0 THEN PRINT "No clock active" : END 5 | 200 PRINT @T(2);":";@T(1);":";@T(0) 6 | 210 PRINT @T(3);"/";@T(4);"/";@T(5) 7 | 230 PRINT "Temp:",@T(7)/100 8 | 240 PRINT "Clock string value" 9 | 250 PRINT @T$ 10 | 11 | -------------------------------------------------------------------------------- /examples/00tutorial/clrvar.bas: -------------------------------------------------------------------------------- 1 | 10 M=USR(0, 9) 2 | 20 PRINT "Memory size is ";M 3 | 30 PRINT "Himem is "; HIMEM 4 | 40 PRINT "Heap size is "; M-HIMEM-1 5 | 110 DIM A(8) 6 | 120 FOR I=1 TO 8: A(I)=I: NEXT 7 | 130 FOR I=1 TO 8: PRINT I, A(I): NEXT 8 | 140 A$="Hello World" 9 | 150 PRINT "Heap size is "; M-HIMEM-1 10 | 200 PRINT "A$ is ";A$ 11 | 210 CLR A() 12 | 220 PRINT "A$ is ";A$ 13 | 230 PRINT "Heap size is "; M-HIMEM-1 14 | 300 DIM A(20) 15 | 310 FOR I=1 TO 20: A(I)=I: NEXT 16 | 320 FOR I=1 TO 20: PRINT I, A(I): NEXT 17 | 330 PRINT "Heap size is "; M-HIMEM-1 18 | -------------------------------------------------------------------------------- /examples/00tutorial/cond.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Conditions if then else demo" 2 | 20 REM "" 3 | 100 A=10 4 | 110 IF A=10 THEN 130 5 | 120 PRINT "This code is never reached" 6 | 130 IF A=10 THEN PRINT "A is 10" ELSE PRINT "A is not 10" 7 | 140 IF A=20 ELSE PRINT "A is not 20" 8 | 200 END 9 | 10 | -------------------------------------------------------------------------------- /examples/00tutorial/convert.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Convert strings to numbers and vice versa" 2 | 20 REM "" 3 | 100 INPUT "Input a number: ", A$ 4 | 110 REM "Clear the error flag" 5 | 120 @S=0 6 | 130 A=VAL(A$) 7 | 140 IF @S=0 THEN PRINT "Conversion successful, number is ", A ELSE PRINT "Number error" 8 | 200 INPUT "Input a number: ", A 9 | 210 A$=STR(A) 10 | 220 PRINT "The number is '";A$;"' " 11 | 300 END 12 | -------------------------------------------------------------------------------- /examples/00tutorial/debug.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Debug mode settings" 2 | 20 REM "" 3 | 100 PRINT "Runtime debug a BASIC program" 4 | 110 SET 0,1 5 | 120 FOR I=1 TO 4: PRINT I : NEXT 6 | 130 SET 0,0 7 | 140 PRINT "For more features of SET -> Wiki" 8 | 150 END 9 | -------------------------------------------------------------------------------- /examples/00tutorial/dump.bas: -------------------------------------------------------------------------------- 1 | 10 REM "DUMP demo program" 2 | 20 REM "" 3 | 100 PRINT "This is how the BASIC memory and EEPROM looks like" 4 | 110 T=HIMEM-SIZE 5 | 120 PRINT "The end of the program is at", T 6 | 130 DUMP 0, T 7 | 140 END 8 | -------------------------------------------------------------------------------- /examples/00tutorial/eeprom.bas: -------------------------------------------------------------------------------- 1 | 10 REM "EEPROM demo" 2 | 20 REM "@E, and the array @E()" 3 | 100 PRINT "Size of EEPROM", @E 4 | 110 IF @E>0 GOTO 200 5 | 120 PRINT "No EEPROM found - test skipped" 6 | 130 STOP 7 | 200 PRINT "Storing numbers to eeprom array, size =", @E 8 | 210 FOR I=1 TO 10 9 | 220 @E(I)=I*I 10 | 230 NEXT I 11 | 240 PRINT "Recalling numbers from eeprom" 12 | 250 FOR I=1 TO 10 13 | 260 PRINT I, @E(I) 14 | 270 NEXT 15 | 300 PRINT "Restart BASIC later and check @E(10)" 16 | 17 | -------------------------------------------------------------------------------- /examples/00tutorial/endme.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Ending the interpreter and flushing" 2 | 20 REM "" 3 | 100 PRINT "bye bye" 4 | 110 CALL 0 5 | 6 | -------------------------------------------------------------------------------- /examples/00tutorial/euler.bas: -------------------------------------------------------------------------------- 1 | 10 REM 'Function to calculate the greatest common divisor (GCD)' 2 | 20 REM "Demo for a multipline function" 3 | 100 DEF FNG() 4 | 110 WHILE B <> 0 5 | 120 T = B 6 | 130 B = A % B 7 | 140 A = T 8 | 150 WEND 9 | 160 RETURN A 10 | 170 FEND 11 | 200 WHILE -1 12 | 210 READ A,B 13 | 220 IF @S<>0 THEN BREAK 14 | 230 PRINT "The greatest common denominator of",A,"and",B,"is: ";FNG() 15 | 240 WEND 16 | 250 END 17 | 300 DATA 18,27,54,63,128,371,34,85 18 | -------------------------------------------------------------------------------- /examples/00tutorial/eval.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Demo for the EVAL command" 2 | 20 REM "" 3 | 30 DIM A$(80) 4 | 100 INPUT "Enter a function (y=x): ",A$ 5 | 110 EVAL 1010,A$ 6 | 200 PRINT "X Y" 7 | 210 FOR X=-4 TO 4.001 STEP 0.5 8 | 220 GOSUB 1000: PRINT #4, X, Y 9 | 230 NEXT 10 | 300 END 11 | 1000 REM "The function at the end" 12 | 1010 Y=X 13 | 1020 RETURN 14 | -------------------------------------------------------------------------------- /examples/00tutorial/fibo.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Calculates the Fibonacci numbers" 2 | 20 REM "And the Golden Ratio on an Integer BASIC" 3 | 200 REM "Main program" 4 | 210 N=19 5 | 220 DIM A(N) 6 | 230 A(1)=1 7 | 240 A(2)=1 8 | 250 FOR I=3 TO N 9 | 260 IF A(I)>16000 THEN BREAK 10 | 270 A(I)=A(I-1)+A(I-2) 11 | 280 Q=A(I): D=A(I-1) 12 | 290 PRINT #4;I,Q,D; 13 | 300 GOSUB 500 14 | 310 NEXT 15 | 320 END 16 | 500 REM "Print a decimal ratio of a fraction" 17 | 520 Z=INT(Q/D) 18 | 530 PRINT " ";Z;"."; 19 | 540 FOR J=1 TO 10 20 | 550 Z=Q%D 21 | 560 Q=Z*10 22 | 570 Z=INT(Q/D) 23 | 580 PRINT Z; 24 | 590 NEXT 25 | 600 PRINT " " 26 | 610 RETURN 27 | -------------------------------------------------------------------------------- /examples/00tutorial/find.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Elementary find demo" 2 | 20 REM "" 3 | 30 A0=10 4 | 40 DIM B(8) 5 | 50 DIM A$(20) 6 | 100 PRINT "Find variable on heap" 7 | 110 PRINT "Address of A0 is", FIND(A0) 8 | 120 PRINT "Find array on heap" 9 | 130 PRINT "Address of B() is", FIND(B()) 10 | 140 PRINT "Find string on heap" 11 | 150 PRINT "Address of A$ is", FIND(A$) 12 | 200 PRINT "Variables A-Z are not on heap" 13 | 210 PRINT "Try to find A gives", FIND (A) 14 | 300 PRINT "String representation in memory" 15 | 310 B$="ABCDEFGH" 16 | 320 B=FIND(B$) 17 | 330 FOR I=B TO B+7+2 18 | 340 PRINT PEEK(I);" "; 19 | 350 NEXT 20 | 360 PRINT 21 | 400 END 22 | -------------------------------------------------------------------------------- /examples/00tutorial/func.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Function definitions" 2 | 20 REM "" 3 | 100 DEF FNS(X)=X*X 4 | 200 INPUT "Input a number: ", N 5 | 210 PRINT "The square of the number is: "; FN S(N) 6 | 220 END 7 | -------------------------------------------------------------------------------- /examples/00tutorial/hello.bas: -------------------------------------------------------------------------------- 1 | 10 REM "The inevitable Hello World" 2 | 100 PRINT "Hello World" 3 | -------------------------------------------------------------------------------- /examples/00tutorial/logic.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Logical expressions" 2 | 20 REM "" 3 | 100 A=10 4 | 110 B=20 5 | 120 PRINT "A="; A, "; B=";B, "; C=";C 6 | 130 IF A=10 THEN PRINT "A is 10" 7 | 140 IF NOT A=20 THEN PRINT "A is not 20" 8 | 150 IF A=10 AND B=20 THEN PRINT "A is 10 and B is 20" 9 | 160 IF A=10 OR C=10 THEN PRINT "A is 10 or C is 10" 10 | 200 PRINT "Expressions" 11 | 210 L=(A=10 AND B=20) 12 | 220 PRINT "L=(A=10 AND B=20)" 13 | 230 PRINT "L =",L 14 | 240 K=NOT L 15 | 250 PRINT "NOT L =",K 16 | 260 K=NOT NOT L 17 | 270 PRINT "NOT NOT L =",K 18 | 280 END 19 | 20 | -------------------------------------------------------------------------------- /examples/00tutorial/loop.bas: -------------------------------------------------------------------------------- 1 | 10 REM "(Advanced) Loops in BASIC" 2 | 20 REM "" 3 | 100 PRINT "FOR loop" 4 | 110 FOR I=0 TO 4 STEP 2 5 | 120 PRINT I 6 | 130 NEXT 7 | 200 PRINT "BREAK in a loop" 8 | 210 FOR I=1 TO 4 9 | 220 IF I=3 THEN BREAK 10 | 230 PRINT I 11 | 240 NEXT 12 | 300 PRINT "CONT in a loop" 13 | 310 FOR I=1 TO 4 14 | 320 IF I=3 THEN CONT 15 | 330 PRINT I 16 | 340 NEXT 17 | 400 PRINT "while" 18 | 410 FOR I 19 | 420 IF I>5 THEN BREAK 20 | 430 PRINT I, I*I 21 | 440 NEXT 22 | 500 PRINT "until" 23 | 510 FOR I 24 | 520 PRINT I, I*I 25 | 530 IF I>5 THEN BREAK 26 | 540 NEXT 27 | 600 END 28 | 29 | -------------------------------------------------------------------------------- /examples/00tutorial/malloc.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Elementary malloc demo" 2 | 20 REM "" 3 | 100 PRINT "Allocate 16 bytes of memory with identifier 1" 4 | 110 M=MALLOC(1, 16) 5 | 120 PRINT "Address of memory segment", M 6 | 200 PRINT "Storing data" 7 | 210 FOR I=0 TO 15 8 | 220 POKE M+I, I*2 9 | 230 NEXT I 10 | 300 PRINT "Retrieving data" 11 | 310 FOR I=0 TO 15 12 | 320 PRINT I, PEEK(M+I) 13 | 330 NEXT I 14 | 400 END 15 | -------------------------------------------------------------------------------- /examples/00tutorial/mandel.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Caculate the mandelbrot set" 2 | 20 REM "The iteration cutoff, threshold, and resolution" 3 | 30 N=10 4 | 40 T=4 5 | 50 R=20 6 | 100 C0=0: C1=0 7 | 200 REM "walk through the grid" 8 | 210 FOR J=2*R+1 TO 1 STEP -1 9 | 220 FOR I=1 TO 3*R+1 10 | 230 C0=-2+(I-1)/R: C1=-1+(J-1)/R 11 | 240 GOSUB 4000 12 | 250 GOSUB 5000 13 | 280 NEXT 14 | 290 PRINT 15 | 300 NEXT 16 | 999 END 17 | 4000 REM "do an iteration on c" 18 | 4010 Z0=C0: Z1=C1 19 | 4020 FOR K=1 TO N 20 | 4030 S0=Z0*Z0: S1=Z1*Z1 21 | 4040 IF S0+S1>T THEN BREAK 22 | 4050 X0=S0-S1+C0 23 | 4060 X1=2*Z0*Z1+C1 24 | 4070 Z0=X0: Z1=X1 25 | 4080 NEXT 26 | 4090 RETURN 27 | 5000 REM "plot a point" 28 | 5010 IF K>N THEN PRINT "X"; : RETURN 29 | 5020 IF K>N/2 THEN PRINT "."; : RETURN 30 | 5030 PRINT " "; 31 | 5040 RETURN 32 | -------------------------------------------------------------------------------- /examples/00tutorial/mandelv.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Caculate the mandelbrot set" 2 | 20 REM "The iteration cutoff, threshold, and resolution" 3 | 30 N=24 4 | 40 T=4 5 | 50 R=100 6 | 100 C0=0: C1=0 7 | 110 CLS 8 | 200 REM "walk through the grid" 9 | 210 FOR J=2*R+1 TO 1 STEP -1 10 | 220 FOR I=1 TO 3*R+1 11 | 230 C0=-2+(I-1)/R: C1=-1+(J-1)/R 12 | 240 GOSUB 4000 13 | 250 GOSUB 5000 14 | 280 NEXT 15 | 300 NEXT 16 | 310 FOR I=1 TO 12: PUT 27, "B": NEXT 17 | 999 END 18 | 4000 REM "do an iteration on c" 19 | 4010 Z0=C0: Z1=C1 20 | 4020 FOR K=1 TO N 21 | 4030 S0=Z0*Z0: S1=Z1*Z1 22 | 4040 IF S0+S1>T THEN BREAK 23 | 4050 X0=S0-S1+C0 24 | 4060 X1=2*Z0*Z1+C1 25 | 4070 Z0=X0: Z1=X1 26 | 4080 NEXT 27 | 4090 RETURN 28 | 5000 REM "plot a point" 29 | 5010 IF K>N: COLOR 0: PLOT I,J: RETURN 30 | 5020 COLOR 255-INT(K/N*255) 31 | 5030 PLOT I,J 32 | 5040 RETURN 33 | -------------------------------------------------------------------------------- /examples/00tutorial/math.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Extended math functions" 2 | 20 REM "" 3 | 100 INPUT "Number= ",A 4 | 110 PRINT "The square root of", A, "is", SQR(A) 5 | 200 INPUT "Base= ", B 6 | 210 INPUT "Exponent= ", E 7 | 220 PRINT B, "to the power of", E, "is", POW(B, E) 8 | 300 INPUT "Value between 0 and 1000= ", V 9 | 310 IF V<0 OR V>1000 THEN PRINT "Range Error" : GOTO 300 10 | 320 M=MAP(V, 1000, 0, 200, 100) 11 | 330 PRINT "V mapped to the range of 200 and 100 is", M 12 | 400 END 13 | -------------------------------------------------------------------------------- /examples/00tutorial/nullbuffer.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Demo of the BASIC nullbuffer feature" 2 | 20 REM "The variable @$ is the input buffer and used as I/O channel" 3 | 100 PRINT "ibuffer is", @$ 4 | 110 @="" 5 | 120 PRINT "ibuffer is now", @$ 6 | 130 A=10: B=20 7 | 140 PRINT &0,A,",",B 8 | 150 PRINT "ibuffer is now", @$ 9 | 160 INPUT &0, C, D 10 | 170 PRINT "Read ", C, D, "from ibuffer" 11 | 200 END 12 | -------------------------------------------------------------------------------- /examples/00tutorial/ongo.bas: -------------------------------------------------------------------------------- 1 | 10 REM "ON GOSUB/GOTO demo program" 2 | 20 REM "" 3 | 100 PRINT "For the solution to all problems" 4 | 110 INPUT "Type a number between 1-3?", I 5 | 200 ON I GOTO 250, 260, 270 6 | 210 REM "default" 7 | 220 PRINT "Wrong number" : GOTO 110 8 | 230 REM "The cases" 9 | 250 PRINT "Meditations"; : GOTO 300 10 | 260 PRINT "Alcohol"; : GOTO 300 11 | 270 PRINT "Chocolate"; : GOTO 300 12 | 300 PRINT " is the solution" 13 | 400 END 14 | -------------------------------------------------------------------------------- /examples/00tutorial/parable.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Draw a parable" 2 | 20 REM "" 3 | 100 PRINT "Y=X*X" 4 | 110 FOR X=-8 TO 8 5 | 120 IF X<>0 PRINT "!"; 6 | 130 IF X=0 PRINT "+";: FOR I=2 TO 8*8/2: PRINT "-";: NEXT: PRINT : GOTO 160 7 | 140 TAB(X*X/2-1) 8 | 150 PRINT "*" 9 | 160 NEXT X 10 | 200 END -------------------------------------------------------------------------------- /examples/00tutorial/plot.bas: -------------------------------------------------------------------------------- 1 | 100 REM "Test the graphics" 2 | 110 A=640: B=480 3 | 200 T=MILLIS(100) 4 | 210 FOR I=1 TO 1000 5 | 220 X=RND(A) 6 | 230 Y=RND(B) 7 | 240 R=RND(40) 8 | 250 C=RND(16) 9 | 260 COLOR C 10 | 270 FCIRCLE X,Y,R 11 | 280 NEXT 12 | 290 COLOR 15 13 | 300 S=MILLIS(100)-T 14 | 310 PRINT "1000 Random circles drawn in", INT(S/10);".";INT(S%10);" seconds" 15 | -------------------------------------------------------------------------------- /examples/00tutorial/primes.bas: -------------------------------------------------------------------------------- 1 | 100 REM "Calculate the first N prime numbers" 2 | 110 REM "and output them!" 3 | 200 CLR 4 | 210 INPUT "How many primes (0=stop)? ", N 5 | 220 IF N=0 THEN 500 6 | 230 DIM P(N): P(1)=2: P(2)=3: I=2 7 | 240 IF I=N THEN 360 8 | 250 K=P(I) 9 | 260 K=K+2 10 | 270 L=SQR(K) 11 | 280 J=1 12 | 290 D=P(J) 13 | 310 M=K%D 14 | 320 IF M=0 THEN 260 15 | 330 IF D@ THEN PRINT "Maximum is ", @ : GOTO 200 9 | 230 @(1)=2: @(2)=3 10 | 240 FOR I=3 TO N 11 | 250 K=@(I-1)+2 12 | 260 L=SQR(K) 13 | 270 FOR J=1 14 | 280 IF K%@(J)=0 THEN K=K+2 : GOTO 260 15 | 290 IF @(J)>L THEN BREAK 16 | 300 NEXT J 17 | 310 @(I)=K 18 | 320 NEXT I 19 | 360 PRINT "The first", N, "primes are:" 20 | 370 FOR J=1 TO N 21 | 380 PRINT J, @(J) 22 | 390 NEXT 23 | 400 GOTO 200 24 | 500 END 25 | -------------------------------------------------------------------------------- /examples/00tutorial/putget.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Demo of the PUT and GET command" 2 | 20 REM "" 3 | 100 PUT "H", 101, "l", 108, "o", 32, "W", 108, "r", 108, "d", 10 4 | 110 PRINT "Press any key to continue" 5 | 120 REM "GET is non blocking in Arduinos and blocking in POSIX" 6 | 130 GET C : IF C=0 THEN GOTO 120 7 | 140 PRINT "Key '"; 8 | 150 PUT C 9 | 160 PRINT "' pressed" 10 | 170 END 11 | -------------------------------------------------------------------------------- /examples/00tutorial/random.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Analyses the distribution of a set of random numbers" 2 | 100 INPUT "Number of samples? ", N 3 | 110 INPUT "Range of numbers? ", R 4 | 120 REM "Preallocate vars before using @" 5 | 130 S=0: A=0: B=0: I=0 6 | 200 FOR I=1 TO R 7 | 210 @(I)=0 8 | 220 NEXT 9 | 230 A=N 10 | 240 B=0 11 | 300 FOR I=1 TO N 12 | 310 S=INT(RND(R))+1 13 | 320 @(S)=@(S)+1 14 | 330 NEXT 15 | 400 PRINT "Distribution:" 16 | 410 PRINT "Value", "Frequency" 17 | 420 FOR I=1 TO R 18 | 430 PRINT #6, I, @(I) 19 | 440 IF @(I)B LET B=@(I) 21 | 460 NEXT 22 | 470 PRINT "Minimum= ", A 23 | 480 PRINT "Maximum= ", B 24 | -------------------------------------------------------------------------------- /examples/00tutorial/readdata.bas: -------------------------------------------------------------------------------- 1 | 10 REM "READ and DATA test code" 2 | 20 REM "" 3 | 100 PRINT "Reading strings" 4 | 110 READ A$ 5 | 120 IF A$="" THEN GOTO 150 6 | 130 PRINT A$; " "; 7 | 140 GOTO 110 8 | 150 PRINT 9 | 200 PRINT "Reading numbers and putting characters" 10 | 200 FOR I=1 TO 11 11 | 210 READ A 12 | 220 PUT A 13 | 230 NEXT 14 | 240 PRINT 15 | 300 PRINT "Reading beyond the end" 16 | 310 PRINT "Status byte is", @S 17 | 320 PRINT "Attempting to read" 18 | 330 READ A 19 | 370 PRINT "Status byte is", @S, "now" 20 | 380 PRINT "Read data was", A 21 | 400 END 22 | 500 DATA "the", "quick", "brown", "fox", "jumps" 23 | 510 DATA "over", "the", "lazy", "dog", "" 24 | 520 DATA 72, 69, 76, 76, 79, 32, 87, 79, 82, 76, 68 25 | 26 | -------------------------------------------------------------------------------- /examples/00tutorial/serial1.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Serial monitor in second serial port" 2 | 20 REM "" 3 | 30 DIM A$(80),B$(80) 4 | 200 REM "The loop() function" 5 | 210 INPUT A$ 6 | 220 IF A$="end" THEN END 7 | 230 PRINT &4,A$ 8 | 240 DELAY 100 9 | 250 FOR I=0 10 | 260 GET &4,A 11 | 270 IF A=0 OR I=80 THEN BREAK 12 | 280 B$(I+1)=A 13 | 290 NEXT 14 | 300 PRINT I,"bytes received" 15 | 310 PRINT B$ 16 | 320 GOTO 200 17 | 400 END 18 | -------------------------------------------------------------------------------- /examples/00tutorial/sort.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Sort a set of numbers" 2 | 100 INPUT "How many numbers? ", N 3 | 110 REM "Preallocate all local vars before using @()" 4 | 120 I=0: J=0: T=0 5 | 200 PRINT "Original order" 6 | 210 FOR I=1 TO N 7 | 220 @(I)=INT(RND(10)) 8 | 230 PRINT I, @(I) 9 | 240 NEXT 10 | 300 FOR I=1 TO N-1 11 | 310 FOR J=I+1 TO N 12 | 320 IF @(I)<=@(J) GOTO 360 13 | 330 T=@(I) 14 | 340 @(I)=@(J) 15 | 350 @(J)=T 16 | 360 NEXT 17 | 370 NEXT 18 | 400 PRINT "Sorted list" 19 | 410 FOR I=1 TO N 20 | 420 PRINT I, @(I) 21 | 430 NEXT 22 | -------------------------------------------------------------------------------- /examples/00tutorial/splitstr.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Split a string into substrings" 2 | 20 REM "" 3 | 100 DIM A$(80) 4 | 110 A$="the quick brown fox jumps over the lazy dog" 5 | 200 FOR I 6 | 210 A=INSTR(A$," ") 7 | 220 IF A=0 THEN PRINT A$: BREAK 8 | 230 PRINT A$(1,A-1) 9 | 240 A$=A$(A+1) 10 | 250 NEXT 11 | 300 END 12 | -------------------------------------------------------------------------------- /examples/00tutorial/stir.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Calculate Factorial and Stirlings function" 2 | 20 REM "" 3 | 100 REM "Factorial" 4 | 110 L=20 5 | 120 DIM F(L) 6 | 130 F(1)=1 7 | 140 FOR I=2 TO L 8 | 150 F(I)=F(I-1)*I 9 | 160 NEXT 10 | 200 REM "Stirling" 11 | 210 P1=4*ATAN(1) 12 | 220 DEF FNS(N)=SQR(2*P1*N)*EXP(N*(LOG(N)-1)) 13 | 300 REM "Print table" 14 | 305 PRINT "N";: TAB(4) 15 | 310 PRINT "FACT(N)";: TAB(6) 16 | 315 PRINT "STIR(N)";: TAB(6) 17 | 320 PRINT "Accuracy (%)" 18 | 330 FOR I=1 TO L 19 | 340 PRINT #4, I, #12, F(I), FNS(I), (F(I)-FNS(I))/F(I)*100 20 | 350 NEXT 21 | 400 END 22 | -------------------------------------------------------------------------------- /examples/00tutorial/stopcont.bas: -------------------------------------------------------------------------------- 1 | 10 REM "STOP and CONT example" 2 | 20 REM "" 3 | 100 A=10 4 | 110 PRINT "A=", A 5 | 120 PRINT "Going back to interactive mode" 6 | 130 PRINT "Change A if you like" 7 | 140 STOP 8 | 150 PRINT "Back to run mode" 9 | 160 PRINT "A=", A 10 | 200 END 11 | -------------------------------------------------------------------------------- /examples/00tutorial/string1.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Strings in BASIC (1)" 2 | 20 REM "Dimensioning and comparing" 3 | 100 PRINT "Strings can be constants" 4 | 110 PRINT "Strings", "can", "be", "constants" 5 | 200 PRINT "String variables" 6 | 210 A$="... without DIM - 32 chars max" 7 | 220 PRINT A$ 8 | 230 PRINT "Length of this string", LEN(A$) 9 | 240 DIM B$(80) 10 | 250 B$="... dimensioning to any length, the memory is the limit" 11 | 260 PRINT B$ 12 | 270 PRINT "Length of this string", LEN(B$) 13 | 300 IF A$<>B$ THEN PRINT "Strings are different" 14 | 310 IF A$=A$ THEN PRINT "Strings are equal" 15 | 320 IF A$ THEN PRINT "String is not empty" 16 | 330 C$="" 17 | 340 IF C$ THEN PRINT "This never shows" 18 | 350 PRINT "... because empty strings evaluate to false" 19 | 400 END 20 | 21 | -------------------------------------------------------------------------------- /examples/00tutorial/string2.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Strings in BASIC (2)" 2 | 20 REM "Substrings, splitting and concatenating" 3 | 100 DIM A$(80), B$(80) 4 | 110 A$="the quick brown fox jumps over the lazy dog" 5 | 120 PRINT A$ 6 | 130 PRINT "The first 3 characters-", A$(1,3) 7 | 140 PRINT "The rest of the string-", A$(4) 8 | 150 PRINT "Splitting ..." 9 | 160 FOR I=1 TO LEN(A$) 10 | 170 PRINT A$(I, I); 11 | 180 IF A$(I, I)=" " THEN PRINT 12 | 190 NEXT I 13 | 200 PRINT 14 | 210 C$=A$(1, 19) 15 | 220 D$=A$(20) 16 | 230 PRINT C$ 17 | 240 PRINT D$ 18 | 250 PRINT "Concatenating ..." 19 | 260 B$=C$ : B$(LEN(B$)+1)=D$ 20 | 270 PRINT B$ 21 | 300 END 22 | 23 | -------------------------------------------------------------------------------- /examples/00tutorial/string3.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Strings in BASIC (3)" 2 | 20 REM "chars and strings" 3 | 100 DIM A$(80) 4 | 110 PRINT "Integers are chars" 5 | 120 FOR I=1 TO 26 6 | 130 A$(I)=64+I 7 | 140 NEXT I 8 | 150 PRINT A$ 9 | 200 PRINT "Chars are chars or integers, mind the ()" 10 | 210 FOR I=1 TO 10 11 | 220 C=A$(I, I) 12 | 230 PRINT A$(I, I), (A$(I, I)), C 13 | 240 NEXT I 14 | 300 PRINT "Chars are taken from the beginning" 15 | 310 FOR I=1 TO 10 16 | 320 C=A$(I) 17 | 330 PRINT C, A$(I) 18 | 340 NEXT I 19 | 400 PRINT "Chars are signed, mind the ()" 20 | 410 A$=230 21 | 420 PRINT (A$) 22 | 500 END 23 | 24 | -------------------------------------------------------------------------------- /examples/00tutorial/string4.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Strings in BASIC (4)" 2 | 20 REM "String arrays" 3 | 30 DIM B$(10,10) 4 | 100 REM "Read a string" 5 | 110 FOR I=1 TO 9 6 | 120 READ B$()(I) 7 | 130 NEXT I 8 | 200 REM "Print the entire string" 9 | 210 FOR I=1 TO 9 10 | 220 PRINT B$()(I) 11 | 230 NEXT I 12 | 300 REM "Substrings and arrays" 13 | 310 FOR I=1 TO 9 14 | 320 PRINT B$(1,1)(I) 15 | 330 NEXT I 16 | 400 DATA "the", "quick", "brown", "fox", "jumps", "over", "the", "lazy", "dog" 17 | -------------------------------------------------------------------------------- /examples/00tutorial/sysinf.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Language set information from USR" 2 | 20 REM "" 3 | 100 PRINT "*** Language set information" 4 | 200 U=USR(0,1) 5 | 210 PRINT "Language identifier:", U 6 | 220 PRINT "Palo Alto Basic with Stefan's extensions" 7 | 230 IF U AND 1 THEN PRINT "+ Apple Integer BASIC and strings/arrays" 8 | 250 IF U AND 2 THEN PRINT "+ Arduino I/O functions" 9 | 260 IF U AND 4 THEN PRINT "+ File I/O" 10 | 270 IF U AND 8 THEN PRINT "+ Dartmouth BASIC extensions" 11 | 280 IF U AND 16 THEN PRINT "+ Graphics language features" 12 | 290 IF U AND 32 THEN PRINT "+ Darkarts language features" 13 | 300 IF U AND 64 THEN PRINT "+ IoT language extensions" 14 | 310 IF USR(0,3) THEN PRINT "+ Floating point" ELSE PRINT "Integer arithemtic" 15 | 16 | -------------------------------------------------------------------------------- /examples/00tutorial/table.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Print a table of values" 2 | 100 INPUT "Start= ", S 3 | 110 INPUT "End= ", E 4 | 120 PRINT #8, "X", "X*X", "X*X*X" 5 | 130 FOR I=S TO E 6 | 140 PRINT #8, I, I*I, I*I*I 7 | 150 NEXT 8 | -------------------------------------------------------------------------------- /examples/00tutorial/timer.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Blinking without delay" 2 | 100 EVERY 1000 GOSUB 1000 3 | 110 FOR I: NEXT 4 | 120 END 5 | 1000 PRINT "Blink", I 6 | 1010 DWRITE LED, S 7 | 1010 S=(S+1)%2 8 | 1020 RETURN 9 | 10 | -------------------------------------------------------------------------------- /examples/00tutorial/timestop.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Stopping after some time" 2 | 100 AFTER 10000 GOTO 1000 3 | 110 FOR I: NEXT 4 | 120 END 5 | 1000 PRINT "Program stopped" 6 | 1010 STOP 7 | -------------------------------------------------------------------------------- /examples/00tutorial/trig.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Table of trigonometric functions" 2 | 20 REM "" 3 | 100 REM "Calculate PI" 4 | 110 P1=4*ATAN(1) 5 | 200 PRINT "X";: TAB(4) 6 | 205 PRINT "SIN(X)";: TAB(7) 7 | 210 PRINT "COS(X)";: TAB(7) 8 | 215 PRINT "TAN(X)" 9 | 220 FOR I=0 TO 89 STEP 5 10 | 230 X=I/360*2*P1 11 | 240 PRINT #4, I, #12, SIN(X), COS(X), TAN(X) 12 | 250 NEXT 13 | -------------------------------------------------------------------------------- /examples/01basics/analogrs.bas: -------------------------------------------------------------------------------- 1 | 10 REM "AnalogReadSerial from Arduino examples" 2 | 100 REM "setup() put your setup code here, to run once:" 3 | 200 REM "loop() put your main code here, to run repeatedly:" 4 | 210 FOR I 5 | 220 S=AREAD(AZERO) 6 | 230 PRINT S 7 | 240 DELAY 1 8 | 250 NEXT 9 | -------------------------------------------------------------------------------- /examples/01basics/baremin.bas: -------------------------------------------------------------------------------- 1 | 10 REM "BareMinimum from Arduino examples" 2 | 100 REM "setup() put your setup code here, to run once:" 3 | 200 REM "loop() put your main code here, to run repeatedly:" 4 | 210 FOR I 5 | 250 NEXT 6 | -------------------------------------------------------------------------------- /examples/01basics/blink.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Blink from Arduino examples" 2 | 100 REM "setup() put your setup code here, to run once:" 3 | 110 PINM LED, 1 4 | 200 REM "loop() put your main code here, to run repeatedly:" 5 | 210 FOR I 6 | 220 DWRITE LED, 1 7 | 230 DELAY 1000 8 | 240 DWRITE LED, 0 9 | 250 DELAY 1000 10 | 260 NEXT 11 | -------------------------------------------------------------------------------- /examples/01basics/digitrs.bas: -------------------------------------------------------------------------------- 1 | 10 REM "DigitalReadSerial from Arduino examples" 2 | 20 P=2 3 | 100 REM "setup() put your setup code here, to run once:" 4 | 110 PINM P, 0 5 | 200 REM "loop() put your main code here, to run repeatedly:" 6 | 210 FOR I 7 | 220 S=DREAD(P) 8 | 230 PRINT S 9 | 240 DELAY 1 10 | 220 S=DREAD(P) 11 | 230 PRINT S 12 | 240 DELAY 1 13 | 250 NEXT 14 | -------------------------------------------------------------------------------- /examples/01basics/fade.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Fade from Arduino examples" 2 | 20 L=9 3 | 30 B=0 4 | 40 F=5 5 | 100 REM "setup() put your setup code here, to run once:" 6 | 110 PINM L, 1 7 | 200 REM "loop() put your main code here, to run repeatedly:" 8 | 210 FOR I 9 | 220 AWRITE L, B 10 | 230 B=B+F 11 | 240 IF B<=0 OR B>=255 THEN F=-F 12 | 250 DELAY 30 13 | 260 NEXT 14 | -------------------------------------------------------------------------------- /examples/01basics/readav1.bas: -------------------------------------------------------------------------------- 1 | 10 REM "ReadAnalogVoltage from Arduino examples - float version" 2 | 100 REM "setup() put your setup code here, to run once:" 3 | 200 REM "loop() put your main code here, to run repeatedly:" 4 | 210 FOR I 5 | 220 S=AREAD(AZERO) 6 | 230 V=S*5/1023 7 | 240 PRINT V 8 | 250 NEXT 9 | -------------------------------------------------------------------------------- /examples/01basics/readav2.bas: -------------------------------------------------------------------------------- 1 | 10 REM "ReadAnalogVoltage from Arduino examples - integer version" 2 | 100 REM "setup() put your setup code here, to run once:" 3 | 200 REM "loop() put your main code here, to run repeatedly:" 4 | 210 FOR I 5 | 220 S=AREAD(AZERO) 6 | 230 V=S*5/1023 7 | 240 PRINT V;"."; 8 | 250 S=S-V*1023/5 9 | 260 V=S*50/1023 10 | 270 PRINT V 11 | 280 NEXT 12 | -------------------------------------------------------------------------------- /examples/02digital/blinkwod.bas: -------------------------------------------------------------------------------- 1 | 10 REM "BlinkWithoutDealy from Arduino examples" 2 | 20 L=0 3 | 30 P=0 4 | 40 T=1000 5 | 100 REM "setup() put your setup code here, to run once:" 6 | 110 PINM LED, 1 7 | 200 REM "loop() put your main code here, to run repeatedly:" 8 | 210 FOR I 9 | 220 C=MILLIS(T) 10 | 230 IF C>P THEN P=C : L=(L+1)%2 11 | 240 DWRITE LED, L 12 | 250 NEXT 13 | -------------------------------------------------------------------------------- /examples/02digital/button.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Button from Arduino examples" 2 | 20 B=2 3 | 30 L=LED 4 | 40 S=0 5 | 100 REM "setup() put your setup code here, to run once:" 6 | 110 PINM L, 1 7 | 120 PINM B, 0 8 | 200 REM "loop() put your main code here, to run repeatedly:" 9 | 210 FOR I 10 | 220 S=DREAD(B) 11 | 230 IF S=1 THEN DWRITE L, 1 ELSE DWRITE L, 0 12 | 250 NEXT 13 | -------------------------------------------------------------------------------- /examples/02digital/debounce.bas: -------------------------------------------------------------------------------- 1 | 10 REM "debounce from Arduino examples" 2 | 11 REM "Using millis with a divisor here" 3 | 20 P=2 4 | 30 L=13 5 | 40 L0=1 : B0=0 6 | 50 T=0 : D=50 7 | 100 REM "setup() put your setup code here, to run once:" 8 | 110 PINM P, 0 9 | 120 PINM L, 1 10 | 130 DWRITE L, L0 11 | 200 REM "loop() put your main code here, to run repeatedly:" 12 | 210 FOR I 13 | 220 R=DREAD(P) 14 | 230 IF R<>B0 THEN L0=MILLIS(D) 15 | 240 IF MILLIS(D)-L0=0 GOTO 270 16 | 250 IF R<>B0 THEN B0=P 17 | 260 IF B0=1 THEN L0=NOT L0 18 | 270 DWRITE L, L0 19 | 280 NEXT 20 | -------------------------------------------------------------------------------- /examples/02digital/digitip.bas: -------------------------------------------------------------------------------- 1 | 10 REM "DigitalInputPullup from Arduino examples" 2 | 100 REM "setup() put your setup code here, to run once:" 3 | 110 PINM 2, 2 4 | 120 PINM LED, 1 5 | 200 REM "loop() put your main code here, to run repeatedly:" 6 | 210 FOR I 7 | 220 S=DREAD(2) 8 | 230 PRINT S 9 | 240 IF S=1 THEN DWRITE LED, 0 ELSE DWRITE LED, 1 10 | 250 NEXT 11 | -------------------------------------------------------------------------------- /examples/02digital/melodys.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Melody from Arduino examples - small version" 2 | 20 REM "Read tones T(), and durations D()" 3 | 50 READ N 4 | 60 DIM T(N) : FOR I=1 TO N : READ T(I) : NEXT 5 | 70 DIM D(N) : FOR I=1 TO N : READ D(I) : NEXT 6 | 100 REM "setup() put your setup code here, to run once:" 7 | 110 FOR I=1 TO N 8 | 120 D=1000/D(I) 9 | 130 PLAY 8, T(I), D 10 | 140 DELAY D*13/10 11 | 150 NEXT 12 | 160 PLAY 8, 0, 1 13 | 170 END 14 | 200 REM "loop() put your main code here, to run repeatedly:" 15 | 1200 REM "The melody of N notes and durations" 16 | 1210 DATA 8 17 | 1220 DATA 247, 185, 185, 208, 185, 0, 233, 247 18 | 1230 DATA 4, 8, 8, 4, 4, 4, 4, 4 19 | -------------------------------------------------------------------------------- /examples/02digital/pitches.bas: -------------------------------------------------------------------------------- 1 | 1000 REM "Pitches of 89 notes" 2 | 1010 DATA 89 3 | 1020 DATA 31, 33, 35, 37, 39, 41, 44, 46 4 | 1030 DATA 49, 52, 55, 58, 62, 65, 69, 73 5 | 1040 DATA 78, 82, 87, 93, 98, 104, 110, 117 6 | 1050 DATA 123, 131, 139, 147, 156, 165, 175, 185 7 | 1060 DATA 196, 208, 220, 233, 247, 262, 277, 294, 8 | 1070 DATA 311, 330, 349, 370, 392, 415, 440, 466, 9 | 1080 DATA 494, 523, 554, 587, 622, 659, 698, 740, 10 | 1090 DATA 784, 831, 880, 932, 988, 1047, 1109, 1175, 11 | 1100 DATA 1245, 1319, 1397, 1480, 1568, 1661, 1760, 1865, 12 | 1110 DATA 1976, 2093, 2217, 2349, 2489, 2637, 2794, 2960 13 | 1120 DATA 3136, 3322, 3520, 3729, 3951, 4186, 4435, 4699, 14 | 1130 DATA 4978 -------------------------------------------------------------------------------- /examples/02digital/statecd.bas: -------------------------------------------------------------------------------- 1 | 10 REM "StateChangeDetection from Arduino examples" 2 | 20 B=2 3 | 30 L=LED 4 | 40 S=0 5 | 50 T=0 6 | 60 C=0 7 | 100 REM "setup() put your setup code here, to run once:" 8 | 110 PINM B, 0 9 | 120 PINM L, 1 10 | 200 REM "loop() put your main code here, to run repeatedly:" 11 | 210 FOR I 12 | 220 S=DREAD(B) 13 | 230 IF S=T THEN 270 14 | 240 IF S=0 THEN PRINT "off" : GOTO 270 15 | 250 C=C+1 16 | 260 PRINT "on" 17 | 270 PRINT "number of button pushes: ", C 18 | 280 DELAY 50 19 | 290 T=S 20 | 300 IF C%4=0 THEN DWRITE L, 1 ELSE DWRITE L, 0 21 | 310 NEXT 22 | -------------------------------------------------------------------------------- /examples/02digital/tonepf.bas: -------------------------------------------------------------------------------- 1 | 10 REM "tonePitchFollower from Arduino examples" 2 | 100 REM "setup() put your setup code here, to run once:" 3 | 200 REM "loop() put your main code here, to run repeatedly:" 4 | 210 FOR I 5 | 220 S=AREAD(AZERO) 6 | 230 T=MAP(S, 400, 1000, 120, 1500) 7 | 240 PLAY 9, T, 10 8 | 250 DELAY 1 9 | 260 NEXT 10 | -------------------------------------------------------------------------------- /examples/03analog/analogin.bas: -------------------------------------------------------------------------------- 1 | 10 REM "AnalogInput from Arduino examples" 2 | 20 REM "S is the analog sensor input, L the LED pin" 3 | 30 S=AZERO 4 | 40 L=13 5 | 50 V=0 6 | 100 REM "setup() put your setup code here, to run once:" 7 | 110 PINM L, 1 8 | 200 REM "loop() put your main code here, to run repeatedly:" 9 | 210 FOR I 10 | 220 V=AREAD(S) 11 | 230 DWRITE L, 1 12 | 240 DELAY V 13 | 250 DWRITE L, 0 14 | 260 NEXT 15 | -------------------------------------------------------------------------------- /examples/03analog/analogios.bas: -------------------------------------------------------------------------------- 1 | 10 REM "AnalogInOutSerial from Arduino examples" 2 | 20 REM "A is the analog pin, L the LED pin" 3 | 30 A=AZERO 4 | 40 L=9 5 | 50 S=0 6 | 60 O=0 7 | 100 REM "setup() put your setup code here, to run once:" 8 | 200 REM "loop() put your main code here, to run repeatedly:" 9 | 210 FOR I 10 | 220 S=AREAD(A) 11 | 230 O=MAP(S, 0, 1023, 0, 255) 12 | 240 AWRITE L, O 13 | 250 PRINT "sensor = ", S, "output = ", O 14 | 260 DELAY 2 15 | 270 NEXT 16 | -------------------------------------------------------------------------------- /examples/03analog/analogwm.bas: -------------------------------------------------------------------------------- 1 | 10 REM "AnalogWriteMega from Arduino examples" 2 | 20 REM "L is the lowest LED pin, H the highest" 3 | 30 L=2 4 | 40 H=13 5 | 100 REM "setup() put your setup code here, to run once:" 6 | 120 FOR T=L TO H 7 | 130 PINM T, 1 8 | 140 NEXT 9 | 200 REM "loop() put your main code here, to run repeatedly:" 10 | 210 FOR I 11 | 220 FOR T=L TO H 12 | 230 FOR B=0 TO 254 13 | 240 AWRITE T, B 14 | 250 DELAY 2 15 | 260 NEXT 16 | 270 FOR B=255 TO 0 STEP -1 17 | 280 AWRITE T, B 18 | 290 DELAY 2 19 | 300 NEXT 20 | 310 DELAY 100 21 | 320 NEXT 22 | 330 NEXT 23 | -------------------------------------------------------------------------------- /examples/03analog/calib.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Calibration from Arduino examples" 2 | 20 REM "S is Sensor pin, L is the LED pin" 3 | 30 REM "M is the minimum, N is the maximum" 4 | 40 S=AZERO 5 | 50 L=9 6 | 60 V=0 7 | 70 M=1023 8 | 80 N=0 9 | 90 T=MILLIS(1000) 10 | 100 REM "setup() put your setup code here, to run once:" 11 | 110 PINM LED, 1 12 | 120 DWRITE LED, 1 13 | 130 IF MILLIS(1000)-T>5 GOTO 190 14 | 140 V=AREAD(S) 15 | 150 IF V>M THEN N=V 16 | 160 IF VN THEN V=N 23 | 240 IF V10 THEN J=1 20 | 270 A=T/N 21 | 280 PRINT A 22 | 290 DELAY 1 23 | 300 NEXT 24 | -------------------------------------------------------------------------------- /examples/04communication/dimmer.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Dimmer from Arduino examples" 2 | 20 REL "L is the LED pin" 3 | 30 L=9 4 | 100 REM "setup() put your setup code here, to run once:" 5 | 110 PINM L, 1 6 | 200 REM "loop() put your main code here, to run repeatedly:" 7 | 210 FOR I 8 | 220 IF AVAIL(1) THEN GET B : AWRITE L, B 9 | 230 NEXT 10 | -------------------------------------------------------------------------------- /examples/04communication/graph.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Graph from Arduino examples" 2 | 100 REM "setup() put your setup code here, to run once:" 3 | 200 REM "loop() put your main code here, to run repeatedly:" 4 | 210 FOR I 5 | 220 PRINT AREAD(AZERO) 6 | 230 DELAY 2 7 | 250 NEXT 8 | -------------------------------------------------------------------------------- /examples/04communication/midi.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Midi from Arduino examples" 2 | 20 REM "Second serial with midi baudrate 31250" 3 | 30 REM "&4 is the second serial port" 4 | 40 SET 8, 31250 5 | 50 C=144 6 | 60 V=69 7 | 100 REM "setup() put your setup code here, to run once:" 8 | 200 REM "loop() put your main code here, to run repeatedly:" 9 | 210 FOR I 10 | 220 FOR N=30 TO 90 11 | 230 PUT &4, C, N, V 12 | 240 DELAY 100 13 | 250 PUT &4, C, N, 0 14 | 260 DELAY 100 15 | 270 NEXT 16 | 280 NEXT 17 | -------------------------------------------------------------------------------- /examples/04communication/multiser.bas: -------------------------------------------------------------------------------- 1 | 10 REM "MultiSerial from Arduino examples" 2 | 20 REM "BASIC needs to be compiled with ARDUINOPRT" 3 | 30 REM "and HASIOT for this program to work" 4 | 100 REM "setup() put your setup code here, to run once:" 5 | 200 REM "loop() put your main code here, to run repeatedly:" 6 | 210 FOR I 7 | 220 IF AVAIL(1) GET C : PUT &4, C 8 | 230 IF AVAIL(4) GET &4, C : PUT C 9 | 240 NEXT 10 | -------------------------------------------------------------------------------- /examples/04communication/physpix.bas: -------------------------------------------------------------------------------- 1 | 10 REM "PhysicalPixel from Arduino examples" 2 | 20 REM "Uses the buildin LED, needs HASIOT" 3 | 30 L=LED 4 | 100 REM "setup() put your setup code here, to run once:" 5 | 110 PINM L, 1 6 | 200 REM "loop() put your main code here, to run repeatedly:" 7 | 210 FOR I 8 | 220 IF AVAIL(1)=0 GOTO 250 9 | 230 GET C 10 | 240 IF C="H" DWRITE L, 1 11 | 250 IF C="L" DWRITE L, 0 12 | 250 NEXT 13 | -------------------------------------------------------------------------------- /examples/04communication/sercs.bas: -------------------------------------------------------------------------------- 1 | 10 REM "SerialCallResponse from Arduino examples" 2 | 20 REM "First, second and third sensor = 0" 3 | 30 F=0 4 | 40 S=0 5 | 50 T=0 6 | 60 B=0 7 | 100 REM "setup() put your setup code here, to run once:" 8 | 110 PINM 2, 0 9 | 120 IF AVAIL(1)>0 GOTO 200 10 | 130 PRINT "A"; 11 | 140 DELAY 300 12 | 150 GOTO 120 13 | 200 REM "loop() put your main code here, to run repeatedly:" 14 | 210 FOR I 15 | 220 IF AVAIL(1)<=0 GOTO 290 16 | 230 GET B 17 | 240 F=AREAD(AZERO)/4 18 | 250 DELAY 10 19 | 260 S=AREAD(AZERO)/4 20 | 270 T=MAP(DREAD(2), 0, 1, 0, 255) 21 | 280 PUT F, S, T 22 | 290 NEXT 23 | -------------------------------------------------------------------------------- /examples/04communication/sercsa.bas: -------------------------------------------------------------------------------- 1 | 10 REM "SerialCallResponseASCII from Arduino examples" 2 | 20 REM "First, second and third sensor = 0" 3 | 30 F=0 4 | 40 S=0 5 | 50 T=0 6 | 60 B=0 7 | 100 REM "setup() put your setup code here, to run once:" 8 | 110 PINM 2, 0 9 | 120 IF AVAIL(1)>0 GOTO 200 10 | 130 PRINT 0, 0, 0 11 | 140 DELAY 300 12 | 150 GOTO 120 13 | 200 REM "loop() put your main code here, to run repeatedly:" 14 | 210 FOR I 15 | 220 IF AVAIL(1)<=0 GOTO 290 16 | 230 GET B 17 | 240 F=AREAD(AZERO)/4 18 | 250 DELAY 10 19 | 260 S=AREAD(AZERO)/4 20 | 270 T=MAP(DREAD(2), 0, 1, 0, 255) 21 | 280 PRINT F, "," S ,",", T 22 | 290 NEXT 23 | -------------------------------------------------------------------------------- /examples/04communication/virtcm.bas: -------------------------------------------------------------------------------- 1 | 10 REM "VirtualColorMixer from Arduino examples" 2 | 20 R=AZERO 3 | 30 G=AZERO+1 4 | 40 B=AZERO+2 5 | 100 REM "setup() put your setup code here, to run once:" 6 | 200 REM "loop() put your main code here, to run repeatedly:" 7 | 210 FOR I 8 | 220 PRINT AREAD(R), ",", AREAD(G), ",", AREAD(B) 9 | 250 NEXT 10 | -------------------------------------------------------------------------------- /examples/05control/arrays.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Arrays from Arduino examples" 2 | 20 T=100 3 | 30 N=6 4 | 40 DIM L(N) 5 | 50 FOR J=1 to N: READ L(J): NEXT 6 | 60 DATA 2, 7, 4, 6, 5, 3 7 | 100 REM "setup() put your setup code here, to run once:" 8 | 110 FOR J=1 to N 9 | 120 PINM L(J), 1 10 | 130 NEXT 11 | 200 REM "loop() put your main code here, to run repeatedly:" 12 | 210 FOR I 13 | 220 FOR J=1 TO N 14 | 230 DWRITE L(J), 1 15 | 240 DELAY T 16 | 250 DWRITE L(J), 0 17 | 260 NEXT 18 | 270 FOR J=N TO 1 STEP -1 19 | 280 DWRITE L(J), 1 20 | 290 DELAY T 21 | 300 DWRITE L(J), 0 22 | 310 NEXT 23 | 320 NEXT 24 | -------------------------------------------------------------------------------- /examples/05control/forloop.bas: -------------------------------------------------------------------------------- 1 | 10 REM "ForLoopIterations from Arduino examples" 2 | 20 T=100 3 | 100 REM "setup() put your setup code here, to run once:" 4 | 110 FOR P=2 TO 7 5 | 120 PINM P, 1 6 | 130 NEXT 7 | 200 REM "loop() put your main code here, to run repeatedly:" 8 | 210 FOR I 9 | 220 FOR P=2 TO 7 10 | 230 DWRITE P, 1 11 | 240 DELAY 100 12 | 250 DWRITE P, 0 13 | 260 NEXT 14 | 270 FOR P=7 TO 2 STEP -1 15 | 280 DWRITE P, 1 16 | 290 DELAY 100 17 | 300 DWRITE P, 0 18 | 310 NEXT 19 | 320 NEXT 20 | -------------------------------------------------------------------------------- /examples/05control/ifstatc.bas: -------------------------------------------------------------------------------- 1 | 10 REM "IfStatementConditional from Arduino examples" 2 | 20 REM "A analog pin, led pin, threshold" 3 | 30 A=AZERO 4 | 40 L=13 5 | 50 T=400 6 | 100 REM "setup() put your setup code here, to run once:" 7 | 110 PINM L, 1 8 | 200 REM "loop() put your main code here, to run repeatedly:" 9 | 210 FOR I 10 | 220 V=AREAD(A) 11 | 230 IF V>T THEN DWRITE L, 1 ELSE DWRITE L, 0 12 | 240 PRINT V 13 | 250 DELAY 1 14 | 260 NEXT 15 | -------------------------------------------------------------------------------- /examples/05control/switch.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Switch from Arduino examples" 2 | 20 REM "N is sensor minimum, M maximum" 3 | 30 N=0 4 | 40 M=600 5 | 100 REM "setup() put your setup code here, to run once:" 6 | 200 REM "loop() put your main code here, to run repeatedly:" 7 | 210 FOR I 8 | 220 V=AREAD(AZERO) 9 | 230 R=MAP(V, N, M, 1, 4) 10 | 240 ON R GOSUB 300, 320, 340, 360 11 | 250 DELAY 1 12 | 260 NEXT 13 | 300 PRINT "DARK" 14 | 310 RETURN 15 | 320 PRINT "DIM" 16 | 330 RETURN 17 | 340 PRINT "MEDIUM" 18 | 350 RETURN 19 | 360 PRINT "BRIGHT" 20 | 370 RETURN 21 | -------------------------------------------------------------------------------- /examples/05control/switch2.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Switch2 from Arduino examples" 2 | 20 REM "" 3 | 100 REM "setup() put your setup code here, to run once:" 4 | 110 FOR T=1 TO 6 : PINM T, 1 : NEXT 5 | 200 REM "loop() put your main code here, to run repeatedly:" 6 | 210 FOR I 7 | 220 IF AVAIL(1)=0 GOTO 220 8 | 230 GET C 9 | 240 C=C-"a"+1 10 | 250 ON C GOTO 300, 320, 340, 360, 380 11 | 260 FOR T=1 TO 6 : DWRITE T, 1 : NEXT 12 | 270 GOTO 400 13 | 300 DWRITE 2, 1 14 | 310 GOTO 400 15 | 320 DWRITE 3, 1 16 | 330 GOTO 400 17 | 340 DWRITE 4, 1 18 | 350 GOTO 400 19 | 360 DWRITE 5, 1 20 | 370 GOTO 400 21 | 380 DWRITE 6, 1 22 | 400 NEXT 23 | -------------------------------------------------------------------------------- /examples/05control/whilest.bas: -------------------------------------------------------------------------------- 1 | 10 REM "WhileStatementConditional from Arduino examples" 2 | 20 REM "P sensor pin, L led, K indicator, B button" 3 | 30 P=AZERO 4 | 40 L=9 5 | 50 K=13 6 | 60 B=2 7 | 70 N=1023 8 | 80 M=0 9 | 90 V=0 10 | 100 REM "setup() put your setup code here, to run once:" 11 | 110 PINM K, 1 12 | 120 PINM L, 1 13 | 130 PINM B, 0 14 | 200 REM "loop() put your main code here, to run repeatedly:" 15 | 210 FOR I 16 | 220 IF DREAD(B)=1 THEN GOSUB 300 : GOTO 220 17 | 230 DWRITE K, 0 18 | 240 V=AREAD(P) 19 | 250 V=MAP(V, N, M, 0, 255) 20 | 260 IF V>255 V=255 21 | 270 IF V<0 V=0 22 | 280 AWRITE L, V 23 | 290 NEXT 24 | 300 REM Calibration 25 | 310 DWRITE K, 1 26 | 320 V=AREAD(P) 27 | 330 IF V>M M=V 28 | 340 IF V="A")AND(X<="Z")) 4 | 40 DEF FNL(X)=((X>="a")AND(X<="z")) 5 | 100 REM "setup() put your setup code here, to run once:" 6 | 110 A$="" 7 | 120 FOR I=1 TO LEN(A$) 8 | 130 IF FNL(A$(I)) THEN B$(I)=(A$(I,I)-32) ELSE B$(I)=A$(I,I) 9 | 140 NEXT I 10 | 150 PRINT B$ 11 | 160 A$="" 12 | 170 FOR I=1 TO LEN(A$) 13 | 180 IF FNU(A$(I)) THEN B$(I)=(A$(I,I)+32) ELSE B$(I)=A$(I,I) 14 | 190 NEXT I 15 | 200 PRINT B$ 16 | -------------------------------------------------------------------------------- /examples/08strings/strchar.bas: -------------------------------------------------------------------------------- 1 | 10 REM "StringCharacter from Arduino examples" 2 | 20 DIM A$(80), B$(80) 3 | 100 REM "setup() put your setup code here, to run once:" 4 | 110 PRINT: PRINT 5 | 120 PRINT "String character manipultions:" 6 | 130 A$="SensorReading: 456" 7 | 140 B$=A$(16, 16) 8 | 150 PRINT "The most significant digit is", B$ 9 | 160 PRINT 10 | 170 B$=A$(1, 13) 11 | 180 B$(14)="=" 12 | 190 B$(15)=A$(15) 13 | 200 PRINT B$ 14 | -------------------------------------------------------------------------------- /examples/11stefans/array2d.bas: -------------------------------------------------------------------------------- 1 | 10 DIM B(10,10),C(8,8) 2 | 20 FOR I=1 TO 10 3 | 30 FOR J=1 TO 10 4 | 40 B(I,J)=12*I+J 5 | 50 NEXT 6 | 60 NEXT 7 | 100 FOR I=1 TO 8 8 | 110 FOR J=1 TO 8 9 | 120 C(I,J)=B(J,I) 10 | 130 NEXT 11 | 140 NEXT 12 | 200 FOR I=1 TO 8 13 | 210 FOR J=1 TO 8 14 | 220 PRINT C(I,J),B(J,I) 15 | 230 NEXT 16 | 240 NEXT 17 | 250 FOR I=1 TO 10 18 | 260 FOR J=1 TO 10 19 | 270 IF B(I,J)<>12*I+J THEN PRINT "fail": BREAK 20 | 280 NEXT 21 | 290 NEXT 22 | 300 FOR I=1 TO 10 23 | 310 PRINT B(I),B(I,1) 24 | 320 NEXT 25 | -------------------------------------------------------------------------------- /examples/11stefans/bench.bas: -------------------------------------------------------------------------------- 1 | 10 REM "The quick and dirty performance test" 2 | 20 T=MILLIS(1): FOR I=1 TO 10000: A=5: NEXT: PRINT MILLIS(1)-T 3 | 4 | -------------------------------------------------------------------------------- /examples/11stefans/creative.bas: -------------------------------------------------------------------------------- 1 | 10 REM "The Creative Computing Benchmark 1977" 2 | 15 T=MILLIS (1) 3 | 20 FOR N=1 TO 100:A=N 4 | 30 FOR I=1 TO 10 5 | 40 A=SQR (A):R=R+RND (1) 6 | 50 NEXT I 7 | 60 FOR I=1 TO 10 8 | 70 A=A*A:R=R+RND (1) 9 | 80 NEXT I 10 | 90 S=S+A:NEXT N 11 | 100 PRINT "Accuracy:", ABS (1010-S/5) 12 | 110 PRINT "Random:", ABS (1000-R) 13 | 120 T=MILLIS (1)-T 14 | 130 PRINT "Expired time:",T, "ms" 15 | 140 PRINT "An Apple 2 needed 120000 ms for this" 16 | 17 | -------------------------------------------------------------------------------- /examples/11stefans/cubes.bas: -------------------------------------------------------------------------------- 1 | 1000 REM "Look into three cubes" 2 | 1010 DEF FNTC(I)=I^3+(I+1)^3+(I+2)^3 3 | 2000 FOR N=1 TO 150 4 | 2010 F=FNTC(N) 5 | 2020 D=INT(SQR(F)) 6 | 2030 D2=D^2 7 | 2040 PRINT N,F,D2,F-D2 8 | 2050 NEXT 9 | -------------------------------------------------------------------------------- /examples/11stefans/gbench.bas: -------------------------------------------------------------------------------- 1 | 5 REM "Draw 100 rectangles" 2 | 10 T=MILLIS(1) 3 | 20 FOR I=1 TO 100 4 | 30 FRECT RND(200),RND(200),RND(200),RND(200) 5 | 40 COLOR RND(15) 6 | 50 NEXT 7 | 60 PRINT MILLIS(1)-T 8 | -------------------------------------------------------------------------------- /examples/11stefans/rfbench1.bas: -------------------------------------------------------------------------------- 1 | 300 T=MILLIS(1) 2 | 400 FOR K=1 TO 1000 3 | 500 NEXT K 4 | 700 PRINT MILLIS(1)-T, "ms" 5 | 705 PRINT "Apple Soft BASIC: 1300 ms" 6 | 710 PRINT "Apple Integer BASIC: 1300 ms" 7 | 800 END 8 | -------------------------------------------------------------------------------- /examples/11stefans/rfbench2.bas: -------------------------------------------------------------------------------- 1 | 300 T=MILLIS(1) 2 | 400 K=0 3 | 500 K=K+1 4 | 600 IF K<1000 THEN 500 5 | 700 PRINT MILLIS(1)-T, "ms" 6 | 705 PRINT "Apple Soft BASIC: 8500 ms" 7 | 710 PRINT "Apple Integer BASIC: 3100 ms" 8 | 800 END 9 | -------------------------------------------------------------------------------- /examples/11stefans/rfbench3.bas: -------------------------------------------------------------------------------- 1 | 300 T=MILLIS(1) 2 | 400 K=0 3 | 500 K=K+1 4 | 510 LET A=K/K*K+K-K 5 | 600 IF K<1000 THEN 500 6 | 700 PRINT MILLIS(1)-T, "ms" 7 | 705 PRINT "Apple Soft BASIC: 16000 ms" 8 | 710 PRINT "Apple Integer BASIC: 7200 ms" 9 | 800 END 10 | -------------------------------------------------------------------------------- /examples/11stefans/rfbench4.bas: -------------------------------------------------------------------------------- 1 | 300 T=MILLIS(1) 2 | 400 K=0 3 | 500 K=K+1 4 | 510 LET A=K/2*3+4-5 5 | 600 IF K<1000 THEN 500 6 | 700 PRINT MILLIS(1)-T, "ms" 7 | 705 PRINT "Apple Soft BASIC: 17800 ms" 8 | 710 PRINT "Apple Integer BASIC: 7200 ms" 9 | 800 END 10 | -------------------------------------------------------------------------------- /examples/11stefans/rfbench5.bas: -------------------------------------------------------------------------------- 1 | 300 T=MILLIS(1) 2 | 400 K=0 3 | 500 K=K+1 4 | 510 LET A=K/2*3+4-5 5 | 520 GOSUB 820 6 | 600 IF K<1000 THEN 500 7 | 700 PRINT MILLIS(1)-T, "ms" 8 | 705 PRINT "Apple Soft BASIC: 19100 ms" 9 | 710 PRINT "Apple Integer BASIC: 8800 ms" 10 | 800 END 11 | 820 RETURN 12 | -------------------------------------------------------------------------------- /examples/11stefans/rfbench6.bas: -------------------------------------------------------------------------------- 1 | 300 T=MILLIS(1) 2 | 400 K=0 3 | 430 DIM M(5) 4 | 500 K=K+1 5 | 510 LET A=K/2*3+4-5 6 | 520 GOSUB 820 7 | 530 FOR L=1 TO 5 8 | 540 NEXT L 9 | 600 IF K<1000 THEN 500 10 | 700 PRINT MILLIS(1)-T, "ms" 11 | 705 PRINT "Apple Soft BASIC: 28600 ms" 12 | 710 PRINT "Apple Integer BASIC: 18500 ms" 13 | 800 END 14 | 820 RETURN 15 | -------------------------------------------------------------------------------- /examples/11stefans/rfbench7.bas: -------------------------------------------------------------------------------- 1 | 300 T=MILLIS(1) 2 | 400 K=0 3 | 430 DIM M(5) 4 | 500 K=K+1 5 | 510 LET A=K/2*3+4-5 6 | 520 GOSUB 820 7 | 530 FOR L=1 TO 5 8 | 535 M(L)=A 9 | 540 NEXT L 10 | 600 IF K<1000 THEN 500 11 | 700 PRINT MILLIS(1)-T, "ms" 12 | 705 PRINT "Apple Soft BASIC: 44800 ms" 13 | 710 PRINT "Apple Integer BASIC: 28000 ms" 14 | 800 END 15 | 820 RETURN 16 | -------------------------------------------------------------------------------- /examples/11stefans/rfbench8.bas: -------------------------------------------------------------------------------- 1 | 300 T=MILLIS(1) 2 | 400 K=0 3 | 500 K=K+1 4 | 530 A=POW(K, 2) 5 | 540 B=LOG(K) 6 | 550 C=SIN(K) 7 | 600 IF K<100 THEN GOTO 500 8 | 700 PRINT MILLIS(1)-T, "ms" 9 | 705 PRINT "Apple Soft BASIC: 10700 ms" 10 | 800 END 11 | -------------------------------------------------------------------------------- /examples/11stefans/root.bas: -------------------------------------------------------------------------------- 1 | 10 INPUT "Range: ",L 2 | 20 PRINT "N ISQR ASQR SQR SQR-ASQR (SQR-ASQR)/SQR " 3 | 100 FOR X=1 TO L 4 | 110 GOSUB 1000 5 | 115 GOSUB 1200 6 | 120 PRINT #4,X,S,#12,A,SQR(X),SQR(X)-A,(SQR(X)-A)/A 7 | 140 NEXT X 8 | 999 END 9 | 1000 REM "Find the closest integer square root" 10 | 1010 FOR I=1 TO 1000 11 | 1020 IF I*I>X THEN S=I-1 ELSE GOTO 1030 12 | 1025 IF I*I-X0 THEN Y=Y-1 9 | 90 IF A$="3" AND Y<1 THEN Y=Y+1 10 | 100 IF A$="1" AND X>0 THEN X=X-1 11 | 110 IF A$="2" AND X<15 THEN X=X+1 12 | 120 IF A=10 GOSUB 200 13 | 130 DELAY 300 14 | 140 GOTO 30 15 | 200 PRINT "Selected", X, Y 16 | 210 DELAY 500 17 | 220 RETURN 18 | -------------------------------------------------------------------------------- /examples/12systems/eeprom.bas: -------------------------------------------------------------------------------- 1 | 10 PRINT "Previous measurement ",@E(1) 2 | 20 PRINT "Starting new measurement" 3 | 30 L=0 4 | 40 FOR I=1 TO 10 5 | 50 L=L+AREAD(AZERO) 6 | 60 DELAY 2000 7 | 70 NEXT 8 | 80 @E(1)=L/10 9 | 90 PRINT "Average = ",@E(1) 10 | -------------------------------------------------------------------------------- /examples/12systems/flame.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Flame sensor and buzzer demo" 2 | 20 REM "Buzzer pin 2 and flame sensor pin A1" 3 | 30 B=2 4 | 40 F=AZERO+1 5 | 50 REM "The flame sensor threshold" 6 | 60 T=250 7 | 100 REM "setup() put your setup code here, to run once:" 8 | 110 PINM B, 1 9 | 120 PINM F, 0 10 | 130 DWRITE B, 0 11 | 200 REM "loop() put your main code here, to run repeatedly:" 12 | 210 FOR I 13 | 220 V=AREAD(F) 14 | 230 IF V>T THEN DELAY 2000 : CONT 15 | 240 DWRITE B, 1 16 | 250 DELAY 250 17 | 260 DWRITE B, 0 18 | 270 DELAY 500 19 | 280 NEXT 20 | 21 | -------------------------------------------------------------------------------- /examples/12systems/graph.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Graphics code elementary demo" 2 | 20 REM "Written only for large TFT screens" 3 | 100 CLS 4 | 200 FOR I 5 | 210 X=RND(800) 6 | 220 Y=RND(480) 7 | 230 R0=RND(40) 8 | 240 R=RND(255): G=RND(255): B=RND(255) 9 | 250 COLOR R,G,B 10 | 260 FCIRCLE X,Y,R0 11 | 270 @X=1:@Y=1:PRINT #5;I; 12 | 280 DELAY 100 13 | 290 NEXT 14 | 300 END 15 | -------------------------------------------------------------------------------- /examples/12systems/hello.bas: -------------------------------------------------------------------------------- 1 | 10 PRINT "Hello World" 2 | -------------------------------------------------------------------------------- /examples/12systems/lcdlight.bas: -------------------------------------------------------------------------------- 1 | 10 REM "LCDLight - display light intensity" 2 | 100 REM "setup() put your setup code here, to run once:" 3 | 110 REM "Minimum and maximum intensity and the PIN" 4 | 120 B=0 : C=100 5 | 130 A=AZERO+1 6 | 140 REM "Set the DISPLAY stream &2 as output device" 7 | 150 @O=2 8 | 200 REM "loop() put your main code here, to run repeatedly:" 9 | 210 FOR I 10 | 220 GET &2, D 11 | 230 IF D=10 THEN @O=1: END 12 | 240 IF D=49 THEN B=0: C=100 13 | 250 V=MAP(AREAD(A), 1023, 0, 0, 99) 14 | 260 IF V>B THEN B=V 15 | 270 IF V integer range" 6 | 60 T1=180 7 | 100 REM "setup() put your setup code here, to run once:" 8 | 110 PINM P1, 1 9 | 120 PINM P2, 0 10 | 200 REM "loop() put your main code here, to run repeatedly:" 11 | 210 FOR I 12 | 220 REM "Send a pulse, approx 50 microseconds" 13 | 230 DWRITE P1,0 14 | 240 DWRITE P1,1 15 | 250 DWRITE P1,0 16 | 260 V=PULSEIN(P2, 1, T1) 17 | 270 D=MAP(V, 0, 18000, 0, 29700) 18 | 275 PUT &2, 12 19 | 280 PRINT &2, "Time:", V 20 | 290 PRINT &2, "Dist:", D; 21 | 300 DELAY 1000 22 | 310 GET &2, A 23 | 320 IF A=10 THEN END 24 | 330 NEXT 25 | -------------------------------------------------------------------------------- /examples/12systems/minmax.bas: -------------------------------------------------------------------------------- 1 | 10 PINM AZERO, 0 2 | 20 M0=1024: M1=0 3 | 30 FOR I=1 TO 10 4 | 40 L=AREAD(AZERO) 5 | 50 IF M0>L THEN M0=L 6 | 60 IF M1 integer range" 6 | 60 T1=180 7 | 100 REM "setup() put your setup code here, to run once:" 8 | 110 PINM P1, 1 9 | 120 PINM P2, 0 10 | 200 REM "loop() put your main code here, to run repeatedly:" 11 | 210 FOR I 12 | 220 REM "Send a pulse, approx 50 microseconds" 13 | 230 DWRITE P1,0 14 | 240 DWRITE P1,1 15 | 250 DWRITE P1,0 16 | 260 V=PULSE(P2, 1, T1) 17 | 270 D=MAP(V, 0, 18000, 0, 29700) 18 | 280 PRINT "Time (10 mus) : ", V 19 | 290 PRINT "Distance (mm) : ", D 20 | 300 DELAY 1000 21 | 310 GET A 22 | 320 IF A=32 THEN END 23 | 330 NEXT 24 | -------------------------------------------------------------------------------- /examples/12systems/shield.bas: -------------------------------------------------------------------------------- 1 | 10 PUT &2, 12 2 | 20 PRINT &2,"LCD shield test" 3 | 30 PRINT &2,"Key code: "; 4 | 40 @X=10: @Y=1 5 | 50 GET &2,A 6 | 60 IF A<>0 THEN PRINT &2,A; 7 | 70 DELAY 10 8 | 80 GOTO 40 9 | -------------------------------------------------------------------------------- /examples/12systems/stopw.bas: -------------------------------------------------------------------------------- 1 | 100 REM "A little stopwatch using the 16*2 shield" 2 | 200 REM "The setup()" 3 | 210 D=0: T=0: U=0: S=0: C=0 4 | 220 PUT &2,12: PRINT &2;"Time = "; 5 | 230 GOSUB 600 6 | 300 REM "The loop()" 7 | 320 GET &2,A 8 | 330 IF A=10 AND C=0 THEN C=A: GOTO 400 9 | 340 IF C=10 AND A=0 THEN C=0 10 | 350 IF A=49 THEN 500 11 | 360 DELAY 10 12 | 370 IF S=1 THEN T=MILLIS(10)-D 13 | 380 IF T<>U THEN U=T: GOSUB 600 14 | 390 GOTO 300 15 | 400 S=(S+1)%2:IF S=1 THEN D=MILLIS(10) 16 | 499 GOTO 300 17 | 500 END 18 | 600 REM "The display refresh" 19 | 610 @Y=0:@X=8:PRINT &2;" "; 20 | 620 @Y=0:@X=8:PRINT &2;T; 21 | 630 RETURN 22 | -------------------------------------------------------------------------------- /examples/13wire/analogm.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Master code for analogr2" 2 | 20 REM "Display the analog value" 3 | 100 REM "setup()" 4 | 110 OPEN &7, 8 5 | 200 REM "loop()" 6 | 210 FOR I 7 | 220 @S=0 8 | 230 INPUT &7, A 9 | 240 IF @S THEN PRINT "Data error" ELSE PRINT A 10 | 250 DELAY 500 11 | 260 NEXT I 12 | -------------------------------------------------------------------------------- /examples/13wire/analogm2.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Master code for analogr2" 2 | 20 REM "Display the analog value" 3 | 100 REM "setup()" 4 | 110 OPEN &7, 8 5 | 200 REM "loop()" 6 | 210 FOR I 7 | 220 @S=0 8 | 230 INPUT &7, A$ 9 | 240 IF @S OR LEN(A$)<2 THEN PRINT "Data error":DELAY 500: CONT 10 | 250 L=A$(1): IF L<0 THEN L=L+255 11 | 260 H=A$(2) 12 | 270 PRINT H*256+L 13 | 280 DELAY 300 14 | 290 NEXT 15 | 16 | -------------------------------------------------------------------------------- /examples/13wire/analogr.bas: -------------------------------------------------------------------------------- 1 | 10 REM "I2C analog slave" 2 | 20 REM "A is the analog port" 3 | 30 A=AZERO 4 | 100 REM "the setup()" 5 | 110 PRINT "Open slave mode on port 8" 6 | 120 OPEN &7, 8, 1 7 | 200 REM "loop() ASCII data transfer of 6 chars" 8 | 210 FOR I 9 | 220 V=AREAD(A) 10 | 230 PRINT &7, #6, INT(V) 11 | 240 DELAY 300 12 | 250 NEXT I 13 | -------------------------------------------------------------------------------- /examples/13wire/analogr2.bas: -------------------------------------------------------------------------------- 1 | 10 REM "I2C analog slave" 2 | 20 REM "A is the analog port" 3 | 30 A=AZERO 4 | 100 REM "the setup()" 5 | 110 PRINT "Open slave mode on port 8" 6 | 120 OPEN &7, 8, 1 7 | 200 REM "loop() binary data transfer" 8 | 210 FOR I 9 | 220 V=AREAD(A) 10 | 230 A$(1)=INT(V)%256 11 | 240 A$(2)=INT(V)/256 12 | 250 PRINT &7, A$ 13 | 260 DELAY 300 14 | 270 NEXT I 15 | 16 | -------------------------------------------------------------------------------- /examples/13wire/ident.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Identify devices on the I2C bus" 2 | 20 REM "" 3 | 100 REM "the setup()" 4 | 110 FOR I=1 TO 127 5 | 120 @S=0 6 | 130 REM "Try to open a device and send a byte" 7 | 140 OPEN &7, I 8 | 150 PUT &7, 0 9 | 160 IF @S=0 THEN PRINT "device found on", #3, I;": ";:GOSUB 500 10 | 190 NEXT 11 | 200 PRINT 12 | 210 END 13 | 500 REM "Search the device name" 14 | 505 IF I=56 THEN PRINT "AH10" : RETURN 15 | 510 IF I=60 THEN PRINT "Oled" : RETURN 16 | 520 IF I>=80 AND I<=87 THEN PRINT "EEPROM" : RETURN 17 | 530 IF I=104 THEN PRINT "Real Time Clock" : RETURN 18 | 540 IF I=118 OR I=119 THEN PRINT "BMP/E280" : RETURN 19 | 590 PRINT "Unknown" 20 | 600 RETURN 21 | 22 | -------------------------------------------------------------------------------- /examples/13wire/masterr.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Master reader from Arduino examples" 2 | 20 REM "" 3 | 100 REM "the setup()" 4 | 110 PRINT "Open master mode on port 8" 5 | 120 OPEN &7, 8 6 | 200 REM "the loop()" 7 | 210 REM "request 6 byte from the slave" 8 | 220 FOR I 9 | 230 @S=0 10 | 240 INPUT &7, #6, A$ 11 | 250 IF @S THEN PRINT "Data error" ELSE PRINT A$ 12 | 260 DELAY 500 13 | 270 NEXT 14 | -------------------------------------------------------------------------------- /examples/13wire/masterw.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Master writer from Arduino examples" 2 | 20 REM "" 3 | 100 REM "the setup()" 4 | 110 PRINT "Open master mode on port 8" 5 | 120 OPEN &7, 8 6 | 130 A$="x is " 7 | 200 REM "the loop()" 8 | 220 FOR I 9 | 230 A$(6)=I 10 | 240 @S=0 11 | 250 PRINT &7, A$ 12 | 260 IF @S THEN PRINT "Transmission error" 13 | 270 DELAY 500 14 | 280 NEXT 15 | -------------------------------------------------------------------------------- /examples/13wire/scan.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Scan the I2C bus for devices" 2 | 20 REM "" 3 | 100 REM "the setup()" 4 | 110 FOR I=1 TO 127 5 | 120 @S=0 6 | 130 REM "Try to open a device and send a byte" 7 | 140 OPEN &7, I 8 | 150 PUT &7, 0 9 | 160 IF @S=0 THEN PRINT "device found on ",I 10 | 170 NEXT 11 | 200 END 12 | -------------------------------------------------------------------------------- /examples/13wire/slaver.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Slave receiver from Arduino examples" 2 | 20 REM "" 3 | 100 REM "the setup()" 4 | 110 PRINT "Open slave mode on port 8" 5 | 120 OPEN &7, 8, 1 6 | 200 REM "the loop()" 7 | 220 FOR I 8 | 230 IF AVAIL(7)=0 THEN 270 9 | 240 INPUT &7, A$ 10 | 250 X=(A$(6)) 11 | 260 PRINT X 12 | 270 DELAY 100 13 | 280 NEXT 14 | 15 | -------------------------------------------------------------------------------- /examples/13wire/slaves.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Slave sender from Arduino examples" 2 | 20 REM "" 3 | 100 REM "the setup()" 4 | 110 PRINT "Open slave mode on port 8" 5 | 120 OPEN &7, 8, 1 6 | 200 REM "the loop()" 7 | 210 REM "send exactly 6 byte to the buffer" 8 | 220 FOR I 9 | 230 PRINT &7, "hello " 10 | 240 DELAY 100 11 | 250 IF USR(7, 1)=0 THEN PRINT "Master requested data" 12 | 260 NEXT 13 | -------------------------------------------------------------------------------- /examples/14games/diamond.bas: -------------------------------------------------------------------------------- 1 | 1 REM "DIAMOND from 101 BASIC games" 2 | 2 REM "Ported to Stefan's BASIC in 2021" 3 | 3 REM 4 | 4 PRINT "FOR A PRETTY DIAMOND PATTERN," 5 | 5 INPUT "TYPE IN AN ODD NUMBER BETWEEN 5 AND 21";R:PRINT 6 | 6 Q=INT(60/R):A$="CC" 7 | 8 FOR L=1 TO Q 8 | 10 X=1:Y=R:Z=2 9 | 20 FOR N=X TO Y STEP Z 10 | 25 TAB((R-N)/2) 11 | 28 FOR M=1 TO Q 12 | 29 C=1 13 | 30 FOR A=1 TO N 14 | 32 IF C>LEN(A$) THEN PRINT "!";: CONT 15 | 34 PRINT A$(C,C); 16 | 36 C=C+1 17 | 50 NEXT 18 | 53 IF M=Q THEN BREAK 19 | 55 TAB(R*M+(R-N)/2) 20 | 56 NEXT 21 | 60 PRINT 22 | 70 NEXT 23 | 83 IF X<>1 THEN CONT 24 | 85 X=R-2:Y=1:Z=-2 25 | 90 GOTO 20 26 | 95 NEXT 27 | 99 END 28 | -------------------------------------------------------------------------------- /examples/14games/russian.bas: -------------------------------------------------------------------------------- 1 | 10 REM "RUSSIAN ROULETTE from 101 BASIC games" 2 | 20 REM "Ported to Stefan's BASIC in 2021" 3 | 30 REM 4 | 100 PRINT "THIS IS A GAME OF >>>>>>>>>>RUSSIAN ROULETTE." 5 | 110 PRINT:PRINT "HERE IS A REVOLVER." 6 | 120 PRINT "TYPE '1' TO SPIN CHAMBER AND PULL TRIGGER." 7 | 130 PRINT "TYPE '2' TO GIVE UP." 8 | 140 PRINT "GO" 9 | 150 FOR N=1 TO 10 10 | 200 PRINT N, ": ";: INPUT I 11 | 210 IF I=2 THEN PRINT " CHICKEN!!!!!": END 12 | 220 IF INT(RND(6))<5 THEN PRINT "- CLICK -": CONT 13 | 230 ELSE PRINT " BANG!!!!! YOU'RE DEAD!": BREAK 14 | 240 NEXT 15 | 250 IF N=10 THEN PRINT "YOU WIN!!!!!" 16 | 260 ELSE PRINT "CONDOLENCES WILL BE SENT TO YOUR RELATIVES." 17 | 270 END 18 | -------------------------------------------------------------------------------- /examples/14games/sinewave.bas: -------------------------------------------------------------------------------- 1 | 10 REM "SINE WAVE from 101 BASIC games" 2 | 20 REM "Originally written by DAVID AHL" 3 | 30 REM "Ported to Stefan's BASIC 2021" 4 | 40 IF NOT USR(0,3) THEN PRINT "NEEDS FLOAT": END 5 | 50 B=0 6 | 100 PRINT "PLOT A SINE WAVE" 7 | 200 REM "START LONG LOOP" 8 | 210 FOR T=0 TO 40 STEP 0.25 9 | 220 A=INT(26+25*SIN(T)) 10 | 230 TAB(A) 11 | 240 IF B=1 THEN PRINT "BASIC": B=0 12 | 250 ELSE PRINT "Stefan's": B=1 13 | 260 NEXT T 14 | 900 END 15 | -------------------------------------------------------------------------------- /examples/15radio/rf24rdr.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Simple rf24 reader" 2 | 100 REM "open the radio pipe for read" 3 | 110 OPEN &8, "radi1", 0 4 | 200 REM "receive a message" 5 | 210 FOR I 6 | 220 IF AVAIL(8)=1 THEN INPUT &8, A$ : PRINT A$ 7 | 250 DELAY 100 8 | 260 NEXT 9 | -------------------------------------------------------------------------------- /examples/15radio/rf24rdra.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Avanced rf24 writer" 2 | 20 REM "Read a message from a slave and print it" 3 | 100 REM "Open the radio pipe for write and read " 4 | 110 OPEN &8, "radi2", 1 5 | 120 OPEN &8, "radi1", 0 6 | 130 IF @S THEN PRINT "Open error": END 7 | 200 REM "Main loop, wait for a message and then react" 8 | 210 FOR I 9 | 220 PRINT &8, "send" 10 | 230 IF @S THEN PRINT "Output error": @S=0: GOTO 280 11 | 240 DELAY 200 12 | 250 IF AVAIL(8)=0 THEN PRINT "No data error": GOTO 280 13 | 260 INPUT &8, A$ 14 | 270 IF @S THEN PRINT "Input error": @S=0: ELSE PRINT A$ 15 | 280 A$="": @S=0 16 | 290 DELAY 1000 17 | 300 NEXT 18 | -------------------------------------------------------------------------------- /examples/15radio/rf24wrt.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Simple rf24 writer" 2 | 100 REM "open the radio pipe for write " 3 | 110 OPEN &8, "radi1", 1 4 | 200 REM "send a message" 5 | 210 FOR I 6 | 220 A$="radio " 7 | 230 A$(7)=STR(I) 8 | 240 PRINT &8, A$ 9 | 250 DELAY 1000 10 | 260 NEXT 11 | 12 | -------------------------------------------------------------------------------- /examples/15radio/rf24wrta.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Avanced rf24 writer" 2 | 20 REM "Read an analog input on request of a master" 3 | 40 REM "The analog pin to read from" 4 | 50 AP=AZERO 5 | 100 REM "Open the radio pipe for write and read " 6 | 110 OPEN &8, "radi1", 1 7 | 120 OPEN &8, "radi2", 0 8 | 130 IF @S THEN PRINT "Open error": END 9 | 140 PINM AP, 0 10 | 200 REM "Main loop, wait for a message and then react" 11 | 210 FOR I 12 | 220 IF AVAIL(8)=0 THEN DELAY 100: GOTO 220 13 | 230 INPUT &8, A$ 14 | 240 IF @S THEN PRINT "Input error": @S=0 15 | 250 IF A$="send" THEN PRINT &8, AREAD(AP) 16 | 260 IF @S THEN PRINT "Output error" 17 | 270 A$="": @S=0 18 | 280 DELAY 1000 19 | 290 NEXT 20 | -------------------------------------------------------------------------------- /examples/16mqtt/analog.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Simple mqtt writer" 2 | 20 REM "read an analog input and transfer the data" 3 | 30 AP=AZERO 4 | 100 REM "open a mqtt topic for write" 5 | 110 OPEN &9, "iotbasic/data", 1 6 | 120 PINM AP, 0 7 | 200 REM "send a message " 8 | 210 FOR I 9 | 220 A$="analog ": A$(8)=STR(AREAD(AP)) 10 | 240 PRINT &9, A$ 11 | 250 IF NETSTAT<>3 THEN PRINT "No connection" 12 | 260 DELAY 3000 13 | 270 NEXT 14 | -------------------------------------------------------------------------------- /examples/16mqtt/digital.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Simple mqtt reader" 2 | 20 REM "receive a message and switch the led" 3 | 100 REM "open a mqtt topic for read" 4 | 110 OPEN &9, "iotbasic/command", 0 5 | 120 PINM LED, 1 6 | 200 REM "wait for a message" 7 | 210 FOR I 8 | 220 IF AVAIL(9)=0 THEN 280 9 | 230 INPUT &9, A$ 10 | 240 REM "ESP led is inverted" 11 | 250 IF A$="on" THEN DWRITE LED, 0 12 | 260 IF A$="off" THEN DWRITE LED, 1 13 | 270 PRINT "Received message", A$ 14 | 280 DELAY 1000 15 | 290 NEXT 16 | -------------------------------------------------------------------------------- /examples/16mqtt/mqttmod.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Mqtt modem - use an ESP modules to send mqtt" 2 | 20 REM "The I/O buffer" 3 | 30 DIM A$(128) 4 | 100 REM "Setup section, open a read and write topic" 5 | 110 OPEN &9,"iotbasic/data",1 6 | 120 OPEN &9,"iotbasic/command" 7 | 200 REM "The loop, input from serial and send/receive" 8 | 210 INPUT "",A$ 9 | 220 IF A$="#" THEN END 10 | 230 PRINT &9,A$ 11 | 240 DELAY 100 12 | 250 REM "The first character printed indicates the status" 13 | 260 IF NETSTAT=3 THEN PRINT "+"; 14 | 270 IF NETSTAT=1 THEN PRINT "0"; 15 | 280 IF NETSTAT=0 THEN PRINT "-"; 16 | 290 IF AVAIL(9)=0 THEN PRINT: GOTO 210 17 | 300 INPUT &9,A$ 18 | 310 PRINT A$ 19 | 320 GOTO 210 20 | -------------------------------------------------------------------------------- /examples/17robot/echo.bas: -------------------------------------------------------------------------------- 1 | 10 PINM 4, 1 2 | 20 PINM 5, 0 3 | 30 DWRITE 4, 0 4 | 40 PULSE 4, 10 5 | 50 E=PULSE(5, 1, 100) 6 | 60 PRINT E/29*100/2 7 | 70 delay 500 8 | 80 goto 40 9 | -------------------------------------------------------------------------------- /examples/17robot/firsttest.bas: -------------------------------------------------------------------------------- 1 | 10 PINM 13,1 2 | 20 PINM 8,1 3 | 30 DWRITE 13,1 4 | 40 AWRITE 11,120 5 | 50 DELAY 1000 6 | 60 AWRITE 11,0 -------------------------------------------------------------------------------- /examples/17robot/look.bas: -------------------------------------------------------------------------------- 1 | 10 REM "The pin setting for Arduino or ESP32" 2 | 20 REM SP=27: TP=17: EP=16 3 | 30 SP=6: TP=4: EP=5 4 | 300 REM "The function for the servo and the echo, integer safe!" 5 | 310 DEF FNP(A)=40+A*200/180 6 | 320 DEF FNE(P)=P/29*100/2 7 | 1000 REM "Look around once" 8 | 1010 GOSUB 10000 9 | 1020 FOR J=1 TO 5 10 | 1030 PRINT J, E(J) 11 | 1040 NEXT 12 | 1050 END 13 | 10000 REM "The look around code" 14 | 10060 FOR J=1 TO 5 15 | 10070 A=(J-1)*45: GOSUB 12000: GOSUB 11000: E(J)=E 16 | 10120 NEXT 17 | 10130 A=90: GOSUB 12000 18 | 10190 RETURN 19 | 11000 REM "Echo once and return the value in E" 20 | 11010 DWRITE TP,0: PULSE TP,10 21 | 11020 E=FNE(PULSE(EP,1,70)) 22 | 11030 RETURN 23 | 12000 REM "The servo code" 24 | 12010 DWRITE SP,0 25 | 12020 FOR I=1 TO 40: DELAY 20: PULSE SP,FNP(A): NEXT 26 | 12030 RETURN 27 | -------------------------------------------------------------------------------- /examples/17robot/remote.bas: -------------------------------------------------------------------------------- 1 | 10 OPEN &9,"littlerobot/data" 2 | 20 OPEN &9,"littlerobot/command",1 3 | 30 S=0 4 | 40 WHILE -1 5 | 50 GET &2,C 6 | 60 SWITCH C 7 | 70 CASE "1": PRINT &9,"l" 8 | 80 CASE "2": PRINT &9,"r" 9 | 90 CASE "3": PRINT &9,"b" 10 | 100 CASE "4": PRINT &9,"f" 11 | 110 SWEND 12 | 120 IF AVAIL(9)=0 THEN CONT 13 | 130 INPUT &9,A$: IF A$<>"" THEN CLS: PRINT &2,INT(VAL(A$)) 14 | 140 WEND 15 | -------------------------------------------------------------------------------- /examples/17robot/servo.bas: -------------------------------------------------------------------------------- 1 | 10 PINM 6,1 2 | 20 DWRITE 6, 0 3 | 30 INPUT A 4 | 40 P=40+A*200/180 5 | 50 FOR I=1 TO 40: DELAY 20: PULSE 6, P: NEXT 6 | 60 GOTO 30 7 | -------------------------------------------------------------------------------- /examples/99tests/01hello.bas: -------------------------------------------------------------------------------- 1 | 10 print "hello world" 2 | 3 | -------------------------------------------------------------------------------- /examples/99tests/01hello.bas.res: -------------------------------------------------------------------------------- 1 | hello world 2 | -------------------------------------------------------------------------------- /examples/99tests/02print.bas: -------------------------------------------------------------------------------- 1 | 10 PRINT 2 | 20 PRINT "this is a string" 3 | 30 PRINT 10 4 | 40 A=10 5 | 50 PRINT A, 10 6 | 60 PRINT #3, A, 10, "end" 7 | 70 PRINT "the number is", A 8 | 80 PRINT "double of", A, "is", 2*A 9 | 90 PRINT "double of "; A; " is "; 2*A 10 | -------------------------------------------------------------------------------- /examples/99tests/02print.bas.res: -------------------------------------------------------------------------------- 1 | 2 | this is a string 3 | 10 4 | 10 10 5 | 10 10 end 6 | the number is 10 7 | double of 10 is 20 8 | double of 10 is 20 9 | -------------------------------------------------------------------------------- /examples/99tests/03let.bas: -------------------------------------------------------------------------------- 1 | 10 LET A=12 2 | 20 B=-15 3 | 30 PRINT A, B 4 | 40 C=(A+B)*2 5 | 50 PRINT C 6 | 60 D=(C+B)*(A+B) 7 | 70 PRINT D 8 | 80 E=INT(C) 9 | 90 F=SGN(C) 10 | 100 G=ABS(C) 11 | 110 PRINT C, E, F, G 12 | 120 A=C+E+F+G 13 | 130 PRINT A 14 | -------------------------------------------------------------------------------- /examples/99tests/03let.bas.res: -------------------------------------------------------------------------------- 1 | 12 -15 2 | -6 3 | 63 4 | -6 -6 -1 6 5 | -7 6 | -------------------------------------------------------------------------------- /examples/99tests/04goto.bas: -------------------------------------------------------------------------------- 1 | 10 PRINT "start" 2 | 20 GOTO 100 3 | 30 PRINT "never printed" 4 | 100 PRINT "jumped" 5 | -------------------------------------------------------------------------------- /examples/99tests/04goto.bas.res: -------------------------------------------------------------------------------- 1 | start 2 | jumped 3 | -------------------------------------------------------------------------------- /examples/99tests/05gosub.bas: -------------------------------------------------------------------------------- 1 | 10 PRINT "start" 2 | 20 GOSUB 100 3 | 30 PRINT "returned" 4 | 40 STOP 5 | 100 PRINT "in subroutine" 6 | 110 RETURN 7 | -------------------------------------------------------------------------------- /examples/99tests/05gosub.bas.res: -------------------------------------------------------------------------------- 1 | start 2 | in subroutine 3 | returned 4 | -------------------------------------------------------------------------------- /examples/99tests/06for.bas: -------------------------------------------------------------------------------- 1 | 10 FOR I=1 TO 10 2 | 20 A=A+I 3 | 30 NEXT I 4 | 40 PRINT A 5 | 50 FOR I=1 6 | 60 IF I=5 BREAK 7 | 70 NEXT 8 | 80 PRINT I 9 | 90 FOR I=1 TO 10 10 | 100 IF I>5 CONT 11 | 110 PRINT I 12 | 120 NEXT 13 | 130 FOR I=1 TO 2 14 | 140 FOR J=1 TO 2 15 | 150 FOR K=1 TO 2 16 | 160 FOR L=1 TO 2 17 | 170 A=A+(I+J)*(K+L) 18 | 180 NEXT 19 | 190 NEXT 20 | 200 NEXT 21 | 210 NEXT 22 | 220 PRINT A 23 | -------------------------------------------------------------------------------- /examples/99tests/06for.bas.res: -------------------------------------------------------------------------------- 1 | 55 2 | 5 3 | 1 4 | 2 5 | 3 6 | 4 7 | 5 8 | 199 9 | -------------------------------------------------------------------------------- /examples/99tests/08string1.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Strings in BASIC (1)" 2 | 20 REM "Dimensioning and comparing" 3 | 100 PRINT "Strings can be constants" 4 | 110 PRINT "Strings", "can", "be", "constants" 5 | 200 PRINT "String variables" 6 | 210 A$="... without DIM - 32 chars max" 7 | 220 PRINT A$ 8 | 230 PRINT "Length of this string", LEN(A$) 9 | 240 DIM B$(80) 10 | 250 B$="... dimensioning to any length, the memory is the limit" 11 | 260 PRINT B$ 12 | 270 PRINT "Length of this string", LEN(B$) 13 | 300 IF A$<>B$ THEN PRINT "Strings are different" 14 | 310 IF A$=A$ THEN PRINT "Strings are equal" 15 | 320 IF A$ THEN PRINT "String is not empty" 16 | 330 C$="" 17 | 340 IF C$ THEN PRINT "This never shows" 18 | 350 PRINT "... because empty strings evaluate to false" 19 | 400 END 20 | 21 | -------------------------------------------------------------------------------- /examples/99tests/08string1.bas.res: -------------------------------------------------------------------------------- 1 | Strings can be constants 2 | Strings can be constants 3 | String variables 4 | ... without DIM - 32 chars max 5 | Length of this string 30 6 | ... dimensioning to any length, the memory is the limit 7 | Length of this string 55 8 | Strings are different 9 | Strings are equal 10 | String is not empty 11 | ... because empty strings evaluate to false 12 | -------------------------------------------------------------------------------- /examples/99tests/09string2.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Strings in BASIC (2)" 2 | 20 REM "Substrings, splitting and concatenating" 3 | 100 DIM A$(80), B$(80) 4 | 110 A$="the quick brown fox jumps over the lazy dog" 5 | 120 PRINT A$ 6 | 130 PRINT "The first 3 characters-", A$(1,3) 7 | 140 PRINT "The rest of the string-", A$(4) 8 | 150 PRINT "Splitting ..." 9 | 160 FOR I=1 TO LEN(A$) 10 | 170 PRINT A$(I, I); 11 | 180 IF A$(I, I)=" " THEN PRINT 12 | 190 NEXT I 13 | 200 PRINT 14 | 210 C$=A$(1, 19) 15 | 220 D$=A$(20) 16 | 230 PRINT C$ 17 | 240 PRINT D$ 18 | 250 PRINT "Concatenating ..." 19 | 260 B$=C$ : B$(LEN(B$)+1)=D$ 20 | 270 PRINT B$ 21 | 300 END 22 | 23 | -------------------------------------------------------------------------------- /examples/99tests/09string2.bas.res: -------------------------------------------------------------------------------- 1 | the quick brown fox jumps over the lazy dog 2 | The first 3 characters- the 3 | The rest of the string- quick brown fox jumps over the lazy dog 4 | Splitting ... 5 | the 6 | quick 7 | brown 8 | fox 9 | jumps 10 | over 11 | the 12 | lazy 13 | dog 14 | the quick brown fox 15 | jumps over the lazy dog 16 | Concatenating ... 17 | the quick brown fox jumps over the lazy dog 18 | -------------------------------------------------------------------------------- /examples/99tests/10string3.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Strings in BASIC (3)" 2 | 20 REM "chars and strings" 3 | 100 DIM A$(80) 4 | 110 PRINT "Integers are chars" 5 | 120 FOR I=1 TO 26 6 | 130 A$(I)=64+I 7 | 140 NEXT I 8 | 150 PRINT A$ 9 | 200 PRINT "Chars are chars or integers, mind the ()" 10 | 210 FOR I=1 TO 10 11 | 220 C=A$(I, I) 12 | 230 PRINT A$(I, I), (A$(I, I)), C 13 | 240 NEXT I 14 | 300 PRINT "Chars are taken from the beginning" 15 | 310 FOR I=1 TO 10 16 | 320 C=A$(I) 17 | 330 PRINT C, A$(I) 18 | 340 NEXT I 19 | 400 PRINT "Chars are signed, mind the ()" 20 | 410 A$=230 21 | 420 PRINT (A$) 22 | 500 END 23 | 24 | -------------------------------------------------------------------------------- /examples/99tests/10string3.bas.res: -------------------------------------------------------------------------------- 1 | Integers are chars 2 | ABCDEFGHIJKLMNOPQRSTUVWXYZ 3 | Chars are chars or integers, mind the () 4 | A 65 65 5 | B 66 66 6 | C 67 67 7 | D 68 68 8 | E 69 69 9 | F 70 70 10 | G 71 71 11 | H 72 72 12 | I 73 73 13 | J 74 74 14 | Chars are taken from the beginning 15 | 65 ABCDEFGHIJKLMNOPQRSTUVWXYZ 16 | 66 BCDEFGHIJKLMNOPQRSTUVWXYZ 17 | 67 CDEFGHIJKLMNOPQRSTUVWXYZ 18 | 68 DEFGHIJKLMNOPQRSTUVWXYZ 19 | 69 EFGHIJKLMNOPQRSTUVWXYZ 20 | 70 FGHIJKLMNOPQRSTUVWXYZ 21 | 71 GHIJKLMNOPQRSTUVWXYZ 22 | 72 HIJKLMNOPQRSTUVWXYZ 23 | 73 IJKLMNOPQRSTUVWXYZ 24 | 74 JKLMNOPQRSTUVWXYZ 25 | Chars are signed, mind the () 26 | -26 27 | -------------------------------------------------------------------------------- /examples/99tests/11string4.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Strings in BASIC (4)" 2 | 20 REM "String arrays" 3 | 30 DIM B$(10,10) 4 | 100 REM "Read a string" 5 | 110 FOR I=1 TO 9 6 | 120 READ B$()(I) 7 | 130 NEXT I 8 | 200 REM "Print the entire string" 9 | 210 FOR I=1 TO 9 10 | 220 PRINT B$()(I) 11 | 230 NEXT I 12 | 300 REM "Substrings and arrays" 13 | 310 FOR I=1 TO 9 14 | 320 PRINT B$(1,1)(I) 15 | 330 NEXT I 16 | 400 DATA "the", "quick", "brown", "fox", "jumps", "over", "the", "lazy", "dog" 17 | -------------------------------------------------------------------------------- /examples/99tests/11string4.bas.res: -------------------------------------------------------------------------------- 1 | the 2 | quick 3 | brown 4 | fox 5 | jumps 6 | over 7 | the 8 | lazy 9 | dog 10 | t 11 | q 12 | b 13 | f 14 | j 15 | o 16 | t 17 | l 18 | d 19 | -------------------------------------------------------------------------------- /examples/99tests/12clrvars.bas: -------------------------------------------------------------------------------- 1 | 10 M=USR(0, 9) 2 | 20 PRINT "Memory size is ";M 3 | 30 PRINT "Himem is "; HIMEM 4 | 40 PRINT "Heap size is "; M-HIMEM-1 5 | 110 DIM A(8) 6 | 120 FOR I=1 TO 8: A(I)=I: NEXT 7 | 130 FOR I=1 TO 8: PRINT I, A(I): NEXT 8 | 140 A$="Hello World" 9 | 150 PRINT "Heap size is "; M-HIMEM-1 10 | 200 PRINT "A$ is ";A$ 11 | 210 CLR A() 12 | 220 PRINT "A$ is ";A$ 13 | 230 PRINT "Heap size is "; M-HIMEM-1 14 | 300 DIM A(20) 15 | 310 FOR I=1 TO 20: A(I)=I: NEXT 16 | 320 FOR I=1 TO 20: PRINT I, A(I): NEXT 17 | 330 PRINT "Heap size is "; M-HIMEM-1 18 | -------------------------------------------------------------------------------- /examples/99tests/12clrvars.bas.res: -------------------------------------------------------------------------------- 1 | Memory size is 65535 2 | Himem is 65534 3 | Heap size is 0 4 | 1 1 5 | 2 2 6 | 3 3 7 | 4 4 8 | 5 5 9 | 6 6 10 | 7 7 11 | 8 8 12 | Heap size is 80 13 | A$ is Hello World 14 | A$ is 15 | Heap size is 41 16 | 1 1 17 | 2 2 18 | 3 3 19 | 4 4 20 | 5 5 21 | 6 6 22 | 7 7 23 | 8 8 24 | 9 9 25 | 10 10 26 | 11 11 27 | 12 12 28 | 13 13 29 | 14 14 30 | 15 15 31 | 16 16 32 | 17 17 33 | 18 18 34 | 19 19 35 | 20 20 36 | Heap size is 128 37 | -------------------------------------------------------------------------------- /examples/99tests/13cond.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Conditions if then else demo" 2 | 20 REM "" 3 | 100 A=10 4 | 110 IF A=10 THEN 130 5 | 120 PRINT "This code is never reached" 6 | 130 IF A=10 THEN PRINT "A is 10" ELSE PRINT "A is not 10" 7 | 140 IF A=20 ELSE PRINT "A is not 20" 8 | 200 END 9 | 10 | -------------------------------------------------------------------------------- /examples/99tests/13cond.bas.res: -------------------------------------------------------------------------------- 1 | A is 10 2 | A is not 20 3 | -------------------------------------------------------------------------------- /examples/99tests/14fibo.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Calculates the Fibonacci numbers" 2 | 20 REM "And the Golden Ratio on an Integer BASIC" 3 | 200 REM "Main program" 4 | 210 N=19 5 | 220 DIM A(N) 6 | 230 A(1)=1 7 | 240 A(2)=1 8 | 250 FOR I=3 TO N 9 | 260 IF A(I)>16000 THEN BREAK 10 | 270 A(I)=A(I-1)+A(I-2) 11 | 280 Q=A(I): D=A(I-1) 12 | 290 PRINT #4;I,Q,D; 13 | 300 GOSUB 500 14 | 310 NEXT 15 | 320 END 16 | 500 REM "Print a decimal ratio of a fraction" 17 | 520 Z=INT(Q/D) 18 | 530 PRINT " ";Z;"."; 19 | 540 FOR J=1 TO 10 20 | 550 Z=Q%D 21 | 560 Q=Z*10 22 | 570 Z=INT(Q/D) 23 | 580 PRINT Z; 24 | 590 NEXT 25 | 600 PRINT " " 26 | 610 RETURN 27 | -------------------------------------------------------------------------------- /examples/99tests/14fibo.bas.res: -------------------------------------------------------------------------------- 1 | 3 2 1 2.0000000000 2 | 4 3 2 1.5000000000 3 | 5 5 3 1.6666666666 4 | 6 8 5 1.6000000000 5 | 7 13 8 1.6250000000 6 | 8 21 13 1.6153846153 7 | 9 34 21 1.6190476190 8 | 10 55 34 1.6176470588 9 | 11 89 55 1.6181818181 10 | 12 144 89 1.6179775280 11 | 13 233 144 1.6180555555 12 | 14 377 233 1.6180257510 13 | 15 610 377 1.6180371352 14 | 16 987 610 1.6180327868 15 | 17 1597 987 1.6180344478 16 | 18 2584 1597 1.6180338134 17 | 19 4181 2584 1.6180340557 18 | -------------------------------------------------------------------------------- /examples/99tests/15logic.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Logical expressions" 2 | 20 REM "" 3 | 100 A=10 4 | 110 B=20 5 | 120 PRINT "A="; A, "; B=";B, "; C=";C 6 | 130 IF A=10 THEN PRINT "A is 10" 7 | 140 IF NOT A=20 THEN PRINT "A is not 20" 8 | 150 IF A=10 AND B=20 THEN PRINT "A is 10 and B is 20" 9 | 160 IF A=10 OR C=10 THEN PRINT "A is 10 or C is 10" 10 | 200 PRINT "Expressions" 11 | 210 L=(A=10 AND B=20) 12 | 220 PRINT "L=(A=10 AND B=20)" 13 | 230 PRINT "L =",L 14 | 240 K=NOT L 15 | 250 PRINT "NOT L =",K 16 | 260 K=NOT NOT L 17 | 270 PRINT "NOT NOT L =",K 18 | 280 END 19 | 20 | -------------------------------------------------------------------------------- /examples/99tests/15logic.bas.res: -------------------------------------------------------------------------------- 1 | A=10 ; B=20 ; C=0 2 | A is 10 3 | A is not 20 4 | A is 10 and B is 20 5 | A is 10 or C is 10 6 | Expressions 7 | L=(A=10 AND B=20) 8 | L = -1 9 | NOT L = 0 10 | NOT NOT L = -1 11 | -------------------------------------------------------------------------------- /examples/99tests/16parable.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Draw a parable" 2 | 20 REM "" 3 | 100 PRINT "Y=X*X" 4 | 110 FOR X=-8 TO 8 5 | 120 IF X<>0 PRINT "!"; 6 | 130 IF X=0 PRINT "+";: FOR I=2 TO 8*8/2: PRINT "-";: NEXT: PRINT : GOTO 160 7 | 140 TAB(X*X/2-1) 8 | 150 PRINT "*" 9 | 160 NEXT X 10 | 200 END -------------------------------------------------------------------------------- /examples/99tests/16parable.bas.res: -------------------------------------------------------------------------------- 1 | Y=X*X 2 | ! * 3 | ! * 4 | ! * 5 | ! * 6 | ! * 7 | ! * 8 | ! * 9 | !140: Range Error 10 | -------------------------------------------------------------------------------- /examples/99tests/18func.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Function definitions" 2 | 20 REM "" 3 | 100 DEF FNS(X)=X*X 4 | 200 READ N 5 | 210 PRINT "The square of",N," is: "; FN S(N) 6 | 220 PRINT "X is",X 7 | 230 END 8 | 300 DATA 10 9 | -------------------------------------------------------------------------------- /examples/99tests/18func.bas.res: -------------------------------------------------------------------------------- 1 | The square of 10 is: 100 2 | X is 0 3 | -------------------------------------------------------------------------------- /examples/99tests/19readdata.bas.res: -------------------------------------------------------------------------------- 1 | Reading strings 2 | the quick brown fox jumps over the lazy dog 3 | HELLO WORLD 4 | Reading beyond the end 5 | Status byte is 0 6 | Attempting to read 7 | Status byte is 1 now 8 | Read data was 0 9 | Data pointer is now 4 10 | Reading from data pointer 2 now 11 | Result is quick 12 | -------------------------------------------------------------------------------- /examples/99tests/20ongo.bas: -------------------------------------------------------------------------------- 1 | 10 REM "ON GOSUB/GOTO demo program" 2 | 20 REM "" 3 | 100 PRINT "For the solution to all problems:" 4 | 110 READ I 5 | 120 IF I=-1 END 6 | 130 GOSUB 800 7 | 140 GOTO 110 8 | 800 ON I GOTO 850, 860, 870 9 | 810 REM "default" 10 | 820 PRINT "Wrong number",I : RETURN 11 | 830 REM "The cases" 12 | 850 PRINT "Meditations"; : GOTO 900 13 | 860 PRINT "Alcohol"; : GOTO 900 14 | 870 PRINT "Chocolate"; : GOTO 900 15 | 900 PRINT " is the solution" 16 | 910 RETURN 17 | 1000 DATA 1,2,3,6,1000,-10,0,-9999,-1 18 | -------------------------------------------------------------------------------- /examples/99tests/20ongo.bas.res: -------------------------------------------------------------------------------- 1 | For the solution to all problems: 2 | Meditations is the solution 3 | Alcohol is the solution 4 | Chocolate is the solution 5 | Wrong number 6 6 | Wrong number 1000 7 | Wrong number -10 8 | Wrong number 0 9 | Wrong number -9999 10 | -------------------------------------------------------------------------------- /examples/99tests/21ongosub.bas: -------------------------------------------------------------------------------- 1 | 10 REM "ON GOSUB/GOTO demo program" 2 | 20 REM "" 3 | 100 PRINT "For the solution to all problems:" 4 | 110 READ I 5 | 120 IF I=-1 END 6 | 130 ON I GOSUB 850, 860, 870 7 | 140 GOTO 110 8 | 850 PRINT "Meditation"; : GOTO 900 9 | 860 PRINT "Alcohol"; : GOTO 900 10 | 870 PRINT "Chocolate"; : GOTO 900 11 | 900 PRINT " is the solution" 12 | 910 RETURN 13 | 1000 DATA 1,2,3,6,1000,-10,0,-9999,-1 14 | -------------------------------------------------------------------------------- /examples/99tests/21ongosub.bas.res: -------------------------------------------------------------------------------- 1 | For the solution to all problems: 2 | Meditation is the solution 3 | Alcohol is the solution 4 | Chocolate is the solution 5 | -------------------------------------------------------------------------------- /examples/99tests/22trig.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Table of trigonometric functions" 2 | 20 REM "" 3 | 100 REM "Calculate PI" 4 | 110 P1=4*ATAN(1) 5 | 200 PRINT "X";: TAB(4) 6 | 205 PRINT "SIN(X)";: TAB(7) 7 | 210 PRINT "COS(X)";: TAB(7) 8 | 215 PRINT "TAN(X)" 9 | 220 FOR I=0 TO 89 STEP 5 10 | 230 X=I/360*2*P1 11 | 240 PRINT #4, I, #12, SIN(X), COS(X), TAN(X) 12 | 250 NEXT 13 | -------------------------------------------------------------------------------- /examples/99tests/23stir.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Calculate Factorial and Stirlings function" 2 | 20 REM "" 3 | 100 REM "Factorial" 4 | 110 L=20 5 | 120 DIM F(L) 6 | 130 F(1)=1 7 | 140 FOR I=2 TO L 8 | 150 F(I)=F(I-1)*I 9 | 160 NEXT 10 | 200 REM "Stirling" 11 | 210 P1=4*ATAN(1) 12 | 220 DEF FNS(N)=SQR(2*P1*N)*EXP(N*(LOG(N)-1)) 13 | 300 REM "Print table" 14 | 305 PRINT "N";: TAB(4) 15 | 310 PRINT "FACT(N)";: TAB(6) 16 | 315 PRINT "STIR(N)";: TAB(6) 17 | 320 PRINT "Accuracy (%)" 18 | 330 FOR I=1 TO L 19 | 340 PRINT #4, I, #12, F(I), FNS(I), (F(I)-FNS(I))/F(I)*100 20 | 350 NEXT 21 | 400 END 22 | -------------------------------------------------------------------------------- /examples/99tests/24mandel.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Caculate the mandelbrot set" 2 | 20 REM "The iteration cutoff, threshold, and resolution" 3 | 30 N=10 4 | 40 T=4 5 | 50 R=20 6 | 100 C0=0: C1=0 7 | 200 REM "walk through the grid" 8 | 210 FOR J=2*R+1 TO 1 STEP -1 9 | 220 FOR I=1 TO 3*R+1 10 | 230 C0=-2+(I-1)/R: C1=-1+(J-1)/R 11 | 240 GOSUB 4000 12 | 250 GOSUB 5000 13 | 280 NEXT 14 | 290 PRINT 15 | 300 NEXT 16 | 999 END 17 | 4000 REM "do an iteration on c" 18 | 4010 Z0=C0: Z1=C1 19 | 4020 FOR K=1 TO N 20 | 4030 S0=Z0*Z0: S1=Z1*Z1 21 | 4040 IF S0+S1>T THEN BREAK 22 | 4050 X0=S0-S1+C0 23 | 4060 X1=2*Z0*Z1+C1 24 | 4070 Z0=X0: Z1=X1 25 | 4080 NEXT 26 | 4090 RETURN 27 | 5000 REM "plot a point" 28 | 5010 IF K>N THEN PRINT "X"; : RETURN 29 | 5020 IF K>N/2 THEN PRINT "."; : RETURN 30 | 5030 PRINT " "; 31 | 5040 RETURN 32 | -------------------------------------------------------------------------------- /examples/99tests/25malloc.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Elementary malloc demo" 2 | 20 REM "" 3 | 100 PRINT "Allocate 16 bytes of memory with identifier 1" 4 | 110 M=MALLOC(1, 16) 5 | 120 PRINT "Address of memory segment", M 6 | 200 PRINT "Storing data" 7 | 210 FOR I=0 TO 15 8 | 220 POKE M+I, I*2 9 | 230 NEXT I 10 | 300 PRINT "Retrieving data" 11 | 310 FOR I=0 TO 15 12 | 320 PRINT I, PEEK(M+I) 13 | 330 NEXT I 14 | 400 F=FIND(1) 15 | 410 PRINT "Memory address of buffer 1 is", F 16 | 500 A0=10 17 | 510 F=FIND(A0) 18 | 520 PRINT "Memory address of variable A0 is", F 19 | 600 DIM A(8) 20 | 610 F=FIND(A()) 21 | 620 PRINT "Memory address of array A() is", F 22 | 700 A$="Hello World" 23 | 710 F=FIND(A$) 24 | 720 PRINT "Memory address of string A$ is", F 25 | 800 PRINT "HIMEM is now ", HIMEM 26 | 810 CLR 1 27 | 820 PRINT "HIMEM after CLR", HIMEM 28 | -------------------------------------------------------------------------------- /examples/99tests/25malloc.bas.res: -------------------------------------------------------------------------------- 1 | Allocate 16 bytes of memory with identifier 1 2 | Address of memory segment 65514 3 | Storing data 4 | Retrieving data 5 | 0 0 6 | 1 2 7 | 2 4 8 | 3 6 9 | 4 8 10 | 5 10 11 | 6 12 12 | 7 14 13 | 8 16 14 | 9 18 15 | 10 20 16 | 11 22 17 | 12 24 18 | 13 26 19 | 14 28 20 | 15 30 21 | Memory address of buffer 1 is 65514 22 | Memory address of variable A0 is 65507 23 | Memory address of array A() is 65468 24 | Memory address of string A$ is 65427 25 | HIMEM is now 65426 26 | HIMEM after CLR 65534 27 | -------------------------------------------------------------------------------- /examples/99tests/26eval.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Demo for the EVAL command" 2 | 20 REM "" 3 | 30 DIM A$(80) 4 | 100 A$="Y=X*X+7" 5 | 110 EVAL 1010,A$ 6 | 200 PRINT "X Y" 7 | 210 FOR X=-4 TO 4.001 STEP 0.5 8 | 220 GOSUB 1000: PRINT #4, X, Y 9 | 230 NEXT 10 | 300 END 11 | 1000 REM "The function at the end" 12 | 1010 Y=X 13 | 1020 RETURN 14 | -------------------------------------------------------------------------------- /examples/99tests/26eval.bas.res: -------------------------------------------------------------------------------- 1 | X Y 2 | -4 23 3 | -3.5 19.25 4 | -3 16 5 | -2.5 13.25 6 | -2 11 7 | -1.5 9.25 8 | -1 8 9 | -0.5 7.25 10 | 0 7 11 | 0.5 7.25 12 | 1 8 13 | 1.5 9.25 14 | 2 11 15 | 2.5 13.25 16 | 3 16 17 | 3.5 19.25 18 | 4 23 19 | -------------------------------------------------------------------------------- /examples/99tests/27splitstr.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Split a string into substrings" 2 | 20 REM "" 3 | 100 DIM A$(80) 4 | 110 A$="the quick brown fox jumps over the lazy dog" 5 | 200 FOR I 6 | 210 A=INSTR(A$, " ") 7 | 220 IF A=0 THEN PRINT A$: BREAK 8 | 230 PRINT A$(1,A-1) 9 | 240 A$=A$(A+1) 10 | 250 NEXT 11 | 300 END 12 | -------------------------------------------------------------------------------- /examples/99tests/27splitstr.bas.res: -------------------------------------------------------------------------------- 1 | the 2 | quick 3 | brown 4 | fox 5 | jumps 6 | over 7 | the 8 | lazy 9 | dog 10 | -------------------------------------------------------------------------------- /examples/99tests/28convert.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Convert strings to numbers and vice versa" 2 | 20 REM "" 3 | 100 A$="123" 4 | 110 REM "Clear the error flag" 5 | 120 @S=0 6 | 130 A=VAL(A$) 7 | 140 IF @S=0 THEN PRINT "Conversion successful, number is ", A ELSE PRINT "Number error" 8 | 200 A=123 9 | 210 A$=STR(A) 10 | 220 PRINT "The number is '";A$;"' " 11 | 300 END 12 | -------------------------------------------------------------------------------- /examples/99tests/28convert.bas.res: -------------------------------------------------------------------------------- 1 | Conversion successful, number is 123 2 | The number is '123' 3 | -------------------------------------------------------------------------------- /examples/99tests/29timestop.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Stopping after some time" 2 | 100 AFTER 10 GOTO 1000 3 | 110 T=MILLIS(1) 4 | 120 FOR I 5 | 130 IF MILLIS(1)-T>100 BREAK 6 | 140 NEXT 7 | 150 PRINT "Timer failed" 8 | 160 END 9 | 1000 PRINT "Program stopped with timer" 10 | 1010 STOP 11 | -------------------------------------------------------------------------------- /examples/99tests/29timestop.bas.res: -------------------------------------------------------------------------------- 1 | Program stopped with timer 2 | -------------------------------------------------------------------------------- /examples/99tests/30every.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Doing things from time to time" 2 | 100 EVERY 10 GOSUB 1000 3 | 110 IF I>4 END 4 | 120 GOTO 110 5 | 1000 I=I+1 6 | 1010 PRINT "Iteration", I 7 | 1020 RETURN 8 | -------------------------------------------------------------------------------- /examples/99tests/30every.bas.res: -------------------------------------------------------------------------------- 1 | Iteration 1 2 | Iteration 2 3 | Iteration 3 4 | Iteration 4 5 | Iteration 5 6 | -------------------------------------------------------------------------------- /examples/99tests/31error.bas: -------------------------------------------------------------------------------- 1 | 10 ERROR GOTO 1000 2 | 20 PRINT "main code" 3 | 30 A=1/0 4 | 100 END 5 | 1000 PRINT "error code" 6 | 1005 PRINT ERROR 7 | 1010 END 8 | -------------------------------------------------------------------------------- /examples/99tests/31error.bas.res: -------------------------------------------------------------------------------- 1 | main code 2 | error code 3 | 12 4 | -------------------------------------------------------------------------------- /examples/99tests/32euler9.bas.res: -------------------------------------------------------------------------------- 1 | Enter the circumference K of a triangle 2 | The program finds a pythagorean triangle 3 | a^2 + b^2 = c^2 4 | Primitive triple 3 4 5 5 | Circumference= 12 6 | Scale with 84 7 | Solution 252 336 420 8 | Primitive triple 7 24 25 9 | Circumference= 56 10 | Scale with 18 11 | Solution 126 432 450 12 | Primitive triple 35 12 37 13 | Circumference= 84 14 | Scale with 12 15 | Solution 420 144 444 16 | Primitive triple 45 28 53 17 | Circumference= 126 18 | Scale with 8 19 | Solution 360 224 424 20 | Primitive triple 63 16 65 21 | Circumference= 144 22 | Scale with 7 23 | Solution 441 112 455 24 | -------------------------------------------------------------------------------- /examples/99tests/33primes.bas: -------------------------------------------------------------------------------- 1 | 100 REM "Calculate the first N prime numbers" 2 | 110 REM "and output them!" 3 | 200 CLR 4 | 210 N=100 5 | 220 IF N=0 THEN 500 6 | 230 DIM P(N): P(1)=2: P(2)=3: I=2 7 | 240 IF I=N THEN 360 8 | 250 K=P(I) 9 | 260 K=K+2 10 | 270 L=SQR(K) 11 | 280 J=1 12 | 290 D=P(J) 13 | 310 M=K%D 14 | 320 IF M=0 THEN 260 15 | 330 IF D@ THEN PRINT "Maximum is ", @ : GOTO 200 7 | 230 @(1)=2: @(2)=3 8 | 240 FOR I=3 TO N 9 | 250 K=@(I-1)+2 10 | 260 L=SQR(K) 11 | 270 FOR J=1 12 | 280 IF K%@(J)=0 THEN K=K+2 : GOTO 260 13 | 290 IF @(J)>L THEN BREAK 14 | 300 NEXT J 15 | 310 @(I)=K 16 | 320 NEXT I 17 | 360 PRINT "The first", N, "primes are:" 18 | 370 FOR J=1 TO N 19 | 380 PRINT J, @(J) 20 | 390 NEXT 21 | 500 END 22 | -------------------------------------------------------------------------------- /examples/99tests/35math.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Extended math functions" 2 | 20 REM "" 3 | 100 READ A 4 | 110 PRINT "The square root of", A, "is", SQR(A) 5 | 200 READ B 6 | 210 READ E 7 | 220 PRINT B, "to the power of", E, "is", POW(B, E) 8 | 300 READ V 9 | 310 IF V<0 OR V>1000 THEN PRINT "Range Error" : GOTO 300 10 | 320 M=MAP(V, 1000, 0, 200, 100) 11 | 330 PRINT V, "mapped to the range of 200 and 100 is", M 12 | 400 END 13 | 500 DATA 2, 3, 5, 567 14 | -------------------------------------------------------------------------------- /examples/99tests/35math.bas.res: -------------------------------------------------------------------------------- 1 | The square root of 2 is 1.41421 2 | 3 to the power of 5 is 243 3 | 567 mapped to the range of 200 and 100 is 157 4 | -------------------------------------------------------------------------------- /examples/99tests/36tictac.bas.res: -------------------------------------------------------------------------------- 1 | Welcome to tictactoe 2 | The game board is numbered: 3 | 4 | 1 2 3 5 | 8 9 4 6 | 7 6 5 7 | 8 | Staring a new game 9 | Computer moves: 9 10 | Computer moves: 2 11 | Computer moves: 4 12 | Computer moves: 7 13 | Computer moves: 5 14 | The game is a draw. 15 | -------------------------------------------------------------------------------- /examples/99tests/38poetry.bas.res: -------------------------------------------------------------------------------- 1 | MIDNIGHT DREARY FIERY EYES BEGUILING ME AND MY SOUL NEVERMORE 2 | THING OF EVIL, 3 | STILL SITTING.... DARKNESS THERE, 4 | NOTHING MORE 5 | THING OF EVIL BURNED, DARKNESS THERE NEVERMORE, 6 | 7 | PROPHET BURNED 8 | DARKNESS THERE 9 | NEVERMORE 10 | BIRD OR FIEND 11 | STILL SITTING.... 12 | DARKNESS THERE ...EVERMORE 13 | 14 | 15 | -------------------------------------------------------------------------------- /examples/99tests/40forfor.bas.res: -------------------------------------------------------------------------------- 1 | 1 2 | 0 3 | -1 4 | 10 5 | 11 6 | 12 7 | 13 8 | 14 9 | 15 10 | 16 11 | 17 12 | 18 13 | 19 14 | 20 15 | 21 16 | 20 17 | 19 18 | 18 19 | 17 20 | 16 21 | 15 22 | 14 23 | 13 24 | 12 25 | 11 26 | 10 27 | 81 28 | 1 29 | 3 30 | 5 31 | 7 32 | 9 33 | 1 34 | 1.5 35 | 2 36 | 2.5 37 | 3 38 | 3.5 39 | 4 40 | 4.5 41 | 5 42 | 5.5 43 | 6 44 | 6.5 45 | 7 46 | 7.5 47 | 8 48 | 8.5 49 | 9 50 | 9.5 51 | 10 52 | This is 0: 0 53 | 1 1 54 | 1 2 55 | This is 1: 1 56 | This is 0: 0 57 | 1 58 | 2 59 | 3 60 | 4 61 | 5 62 | 6 63 | 7 64 | 8 65 | 9 66 | 10 67 | ERROR 19 68 | ERROR 10 69 | ERROR 10 70 | ERROR 10 71 | -------------------------------------------------------------------------------- /examples/99tests/41arrayfun.bas.res: -------------------------------------------------------------------------------- 1 | 1 2 | 2 3 | 3 4 | 4 5 | 5 6 | 6 7 | 7 8 | 8 9 | 9 10 | 10 11 | ERROR 16 12 | ERROR 16 13 | 0 14 | ERROR 16 15 | -1 16 | ERROR 16 17 | -1 18 | 0 19 | 0 1 20 | 1 2 21 | 2 3 22 | 3 4 23 | 4 5 24 | 5 6 25 | 6 7 26 | 7 8 27 | 8 9 28 | 9 10 29 | 9 1 30 | 10 2 31 | 11 3 32 | 12 4 33 | 13 5 34 | 14 6 35 | 15 7 36 | 16 8 37 | 17 9 38 | 18 10 39 | ERROR 16 40 | -1 41 | ERROR 16 42 | -1 43 | 1 44 | 4 45 | ERROR 16 46 | -1 47 | ERROR 16 48 | -1 49 | 1 50 | 4 51 | 9 52 | 16 53 | 25 54 | 36 55 | 49 56 | 64 57 | 81 58 | 100 59 | 121 60 | 144 61 | 169 62 | 196 63 | 225 64 | 256 65 | 289 66 | 324 67 | 361 68 | 400 69 | ERROR 16 70 | -1 71 | ERROR 16 72 | -1 73 | 4 5 74 | 7 8 75 | 4 7 76 | 4 7 77 | ERROR 16 78 | -1 79 | ERROR 16 80 | -1 81 | 4 5 82 | 7 8 83 | ERROR 16 84 | -1 85 | ERROR 16 86 | -1 87 | ERROR 18 88 | 10 89 | 0 90 | 0 91 | 0 92 | -1 93 | ERROR 18 94 | -------------------------------------------------------------------------------- /examples/99tests/42gosub.bas: -------------------------------------------------------------------------------- 1 | 10 REM "GOSUB and RETURN" 2 | 20 GOSUB 40 3 | 30 GOTO 100 4 | 40 RETURN 5 | 50 PRINT "FAIL": END 6 | 100 REM "Return without a GOSUB" 7 | 110 ERROR GOTO 140 8 | 120 RETURN 9 | 130 PRINT "FAIL": END 10 | 140 PRINT "ERROR", ERROR 11 | 200 REM "Many GOSUBs (1)" 12 | 210 ERROR GOTO 240 13 | 220 GOSUB 220 14 | 230 PRINT "FAIL": END 15 | 240 PRINT "ERROR", ERROR 16 | 300 REM "Many GOSUBs (2)" 17 | 310 ERROR GOTO 350 18 | 320 GOSUB 330 19 | 330 GOSUB 320 20 | 340 PRINT "FAIL": END 21 | 350 PRINT "ERROR", ERROR 22 | -------------------------------------------------------------------------------- /examples/99tests/42gosub.bas.res: -------------------------------------------------------------------------------- 1 | ERROR -113 2 | ERROR -114 3 | ERROR -114 4 | -------------------------------------------------------------------------------- /examples/99tests/45ongo.bas.res: -------------------------------------------------------------------------------- 1 | PASS 2 | PASS 3 | PASS WITH ERROR 13 4 | PASS 5 | PASS 6 | PASS WITH ERROR 13 7 | PASS 8 | -------------------------------------------------------------------------------- /examples/99tests/46output.bas.res: -------------------------------------------------------------------------------- 1 | Hello World says Stefan. 2 | 0 0 0 :: 3 | 10 5 6 :---: 4 | 10 5 6 :---: 5 | 10 5 6 :---: 6 | 10 5 6 :---: 7 | 10 5 6 :---: 8 | 10 5 6 :---: 9 | 10 5 6 :---: 10 | 10 6 x 11 | -10 6 x 12 | -10 -6 x 13 | -120 -270 x 14 | -120 -270x 15 | -120 -270 x 16 | A 17 | PASS WITH ERROR 10 18 | A 19 | PASS WITH ERROR 10 20 | 50 21 | PASS WITH ERROR 10 22 | 50 23 | PASS WITH ERROR 10 24 | Hello 25 | 72 26 | HH 27 | A B 28 | A 29 |  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ 30 | -------------------------------------------------------------------------------- /examples/99tests/47while.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Stuctured commands test" 2 | 110 A=0 3 | 120 B=0 4 | 130 WHILE A<10 5 | 140 PRINT A 6 | 150 A=A+1 7 | 160 B=A 8 | 170 WHILE B<10 9 | 180 PRINT B; " "; 10 | 190 B=B+1 11 | 200 WEND 12 | 210 PRINT 13 | 220 WEND 14 | 300 REM "all in one line" 15 | 310 A=0 16 | 320 B=0 17 | 330 WHILE A<10 18 | 340 PRINT A 19 | 350 A=A+1 20 | 360 B=A 21 | 370 WHILE B<10: PRINT B; " ";: B=B+1: WEND 22 | 380 PRINT 23 | 390 WEND 24 | 400 REM "Break test code" 25 | 410 A=10 26 | 420 WHILE A>0 27 | 430 A=A-1 28 | 440 IF A=4 THEN BREAK 29 | 450 PRINT A 30 | 460 WEND 31 | 500 REM "Cont test code" 32 | 510 A=10 33 | 520 WHILE A>0 34 | 530 A=A-1 35 | 540 IF A%2=0 THEN CONT 36 | 550 PRINT A 37 | 560 WEND 38 | 39 | -------------------------------------------------------------------------------- /examples/99tests/47while.bas.res: -------------------------------------------------------------------------------- 1 | 0 2 | 1 2 3 4 5 6 7 8 9 3 | 1 4 | 2 3 4 5 6 7 8 9 5 | 2 6 | 3 4 5 6 7 8 9 7 | 3 8 | 4 5 6 7 8 9 9 | 4 10 | 5 6 7 8 9 11 | 5 12 | 6 7 8 9 13 | 6 14 | 7 8 9 15 | 7 16 | 8 9 17 | 8 18 | 9 19 | 9 20 | 0 21 | 1 2 3 4 5 6 7 8 9 22 | 1 23 | 2 3 4 5 6 7 8 9 24 | 2 25 | 3 4 5 6 7 8 9 26 | 3 27 | 4 5 6 7 8 9 28 | 4 29 | 5 6 7 8 9 30 | 5 31 | 6 7 8 9 32 | 6 33 | 7 8 9 34 | 7 35 | 8 9 36 | 8 37 | 9 38 | 9 39 | 9 40 | 8 41 | 7 42 | 6 43 | 5 44 | 9 45 | 7 46 | 5 47 | 3 48 | 1 49 | -------------------------------------------------------------------------------- /examples/99tests/48until.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Repeat until test code" 2 | 110 A=10 3 | 120 REPEAT 4 | 130 PRINT A 5 | 140 A=A-1 6 | 150 UNTIL A=0 7 | 200 REM "Break test code" 8 | 210 A=10 9 | 220 REPEAT 10 | 230 PRINT A 11 | 240 A=A-1 12 | 250 IF A%5=0 THEN BREAK 13 | 260 UNTIL A=0 14 | 300 REM "Cont test code" 15 | 310 A=10 16 | 320 REPEAT 17 | 330 A=A-1 18 | 340 IF A%2=0 THEN CONT 19 | 350 PRINT A 20 | 360 UNTIL A=0 21 | 22 | -------------------------------------------------------------------------------- /examples/99tests/48until.bas.res: -------------------------------------------------------------------------------- 1 | 10 2 | 9 3 | 8 4 | 7 5 | 6 6 | 5 7 | 4 8 | 3 9 | 2 10 | 1 11 | 10 12 | 9 13 | 8 14 | 7 15 | 6 16 | 9 17 | 7 18 | 5 19 | 3 20 | 1 21 | -------------------------------------------------------------------------------- /examples/99tests/49switch.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Switch test code" 2 | 100 FOR A=0 TO 4 3 | 110 SWITCH A 4 | 120 PRINT "default" 5 | 130 CASE 1,2: PRINT "one or two" 6 | 140 CASE 3: PRINT "three" 7 | 150 SWEND 8 | 160 NEXT 9 | 210 REM "Nested switch" 10 | 220 B=8 11 | 230 FOR A=0 TO 4 12 | 240 SWITCH A 13 | 250 PRINT "default" 14 | 260 CASE 1,2: PRINT "one or two" 15 | 270 CASE 3: PRINT "three" 16 | 280 SWITCH B 17 | 290 PRINT "B: no case found" 18 | 300 CASE 8: PRINT "B is eight" 19 | 310 SWEND 20 | 320 REM 21 | 330 SWEND 22 | 340 NEXT 23 | 350 B=7 24 | 360 FOR A=0 TO 4 25 | 380 SWITCH A 26 | 390 PRINT "default" 27 | 400 CASE 1,2: PRINT "one or two" 28 | 410 CASE 3: PRINT "three" 29 | 420 SWITCH B 30 | 430 PRINT "B: no case found" 31 | 440 CASE 8: PRINT "B is eight" 32 | 450 SWEND 33 | 460 REM 34 | 470 SWEND 35 | 480 NEXT 36 | -------------------------------------------------------------------------------- /examples/99tests/49switch.bas.res: -------------------------------------------------------------------------------- 1 | default 2 | one or two 3 | one or two 4 | three 5 | default 6 | default 7 | one or two 8 | one or two 9 | three 10 | B is eight 11 | default 12 | default 13 | one or two 14 | one or two 15 | three 16 | B: no case found 17 | default 18 | -------------------------------------------------------------------------------- /examples/99tests/50teststruct.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Structured if then else test" 2 | 100 A=0 3 | 110 IF A=0 THEN PRINT "A is 0" 4 | 120 IF A=1 THEN PRINT "Failed" ELSE PRINT "A is not 1" 5 | 130 IF A=0 6 | 140 THEN PRINT "A is 0" 7 | 150 IF A=1 8 | 160 THEN PRINT "Failed" 9 | 170 ELSE PRINT "A is not 1" 10 | 200 IF A=0 THEN DO PRINT "A is 0": DEND: PRINT "block ended" 11 | 210 IF A=1 THEN PRINT "Failed" : ELSE DO PRINT "A is 1": DEND: PRINT "block ended" 12 | 300 IF A=0 THEN DO 13 | 310 PRINT "A is 0" 14 | 320 PRINT "and there is another line in the block" 15 | 330 DEND 16 | 340 ELSE 17 | 350 DO 18 | 360 PRINT "Failed" 19 | 370 DEND 20 | 400 IF A=1 THEN DO 21 | 410 PRINT "Failed" 22 | 420 PRINT "and there is another line in the block" 23 | 430 DEND 24 | 440 ELSE 25 | 450 DO 26 | 460 PRINT "A is not one" 27 | 470 PRINT "and there is another line in the block" 28 | 480 DEND 29 | 30 | 31 | -------------------------------------------------------------------------------- /examples/99tests/50teststruct.bas.res: -------------------------------------------------------------------------------- 1 | A is 0 2 | A is not 1 3 | A is 0 4 | A is not 1 5 | A is 0 6 | block ended 7 | A is 1 8 | block ended 9 | A is 0 10 | and there is another line in the block 11 | A is not one 12 | and there is another line in the block 13 | -------------------------------------------------------------------------------- /examples/99tests/51rocket.bas.inp: -------------------------------------------------------------------------------- 1 | Y 2 | 3 | 0 4 | 0 5 | 0 6 | 0 7 | 0 8 | 0 9 | 0 10 | 0 11 | 0 12 | 0 13 | 30 14 | 30 15 | 20 16 | 20 17 | 15 18 | 10 19 | 6 20 | 8 21 | 5 22 | n 23 | 24 | -------------------------------------------------------------------------------- /examples/99tests/testscript: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | BASIC=../../Basic1/basic 3 | 4 | for file in *.bas 5 | do 6 | if [ -r $file.inp ] 7 | then 8 | $BASIC $file > ${file}.tmp < ${file}.inp 9 | else 10 | $BASIC $file > ${file}.tmp 11 | fi 12 | diff ${file}.tmp ${file}.res > /dev/null 13 | if [ $? -eq 0 ] 14 | then 15 | echo "passed $file" 16 | rm ${file}.tmp 17 | else 18 | echo "failed $file" 19 | fi 20 | done 21 | 22 | rm eeprom.dat 23 | rm daten.txt 24 | -------------------------------------------------------------------------------- /examples/99testsBasic2/01hello.bas: -------------------------------------------------------------------------------- 1 | 10 print "hello world" 2 | 3 | -------------------------------------------------------------------------------- /examples/99testsBasic2/01hello.bas.res: -------------------------------------------------------------------------------- 1 | hello world 2 | -------------------------------------------------------------------------------- /examples/99testsBasic2/02print.bas: -------------------------------------------------------------------------------- 1 | 10 PRINT 2 | 20 PRINT "this is a string" 3 | 30 PRINT 10 4 | 40 A=10 5 | 50 PRINT A, 10 6 | 60 PRINT #3, A, 10, "end" 7 | 70 PRINT "the number is", A 8 | 80 PRINT "double of", A, "is", 2*A 9 | 90 PRINT "double of "; A; " is "; 2*A 10 | -------------------------------------------------------------------------------- /examples/99testsBasic2/02print.bas.res: -------------------------------------------------------------------------------- 1 | 2 | this is a string 3 | 10 4 | 10 10 5 | 10 10 end 6 | the number is 10 7 | double of 10 is 20 8 | double of 10 is 20 9 | -------------------------------------------------------------------------------- /examples/99testsBasic2/03let.bas: -------------------------------------------------------------------------------- 1 | 10 LET A=12 2 | 20 B=-15 3 | 30 PRINT A, B 4 | 40 C=(A+B)*2 5 | 50 PRINT C 6 | 60 D=(C+B)*(A+B) 7 | 70 PRINT D 8 | 80 E=INT(C) 9 | 90 F=SGN(C) 10 | 100 G=ABS(C) 11 | 110 PRINT C, E, F, G 12 | 120 A=C+E+F+G 13 | 130 PRINT A 14 | -------------------------------------------------------------------------------- /examples/99testsBasic2/03let.bas.res: -------------------------------------------------------------------------------- 1 | 12 -15 2 | -6 3 | 63 4 | -6 -6 -1 6 5 | -7 6 | -------------------------------------------------------------------------------- /examples/99testsBasic2/04goto.bas: -------------------------------------------------------------------------------- 1 | 10 PRINT "start" 2 | 20 GOTO 100 3 | 30 PRINT "never printed" 4 | 100 PRINT "jumped" 5 | -------------------------------------------------------------------------------- /examples/99testsBasic2/04goto.bas.res: -------------------------------------------------------------------------------- 1 | start 2 | jumped 3 | -------------------------------------------------------------------------------- /examples/99testsBasic2/05gosub.bas: -------------------------------------------------------------------------------- 1 | 10 PRINT "start" 2 | 20 GOSUB 100 3 | 30 PRINT "returned" 4 | 40 STOP 5 | 100 PRINT "in subroutine" 6 | 110 RETURN 7 | -------------------------------------------------------------------------------- /examples/99testsBasic2/05gosub.bas.res: -------------------------------------------------------------------------------- 1 | start 2 | in subroutine 3 | returned 4 | -------------------------------------------------------------------------------- /examples/99testsBasic2/06for.bas: -------------------------------------------------------------------------------- 1 | 10 FOR I=1 TO 10 2 | 20 A=A+I 3 | 30 NEXT I 4 | 40 PRINT A 5 | 50 FOR I=1 6 | 60 IF I=5 BREAK 7 | 70 NEXT 8 | 80 PRINT I 9 | 90 FOR I=1 TO 10 10 | 100 IF I>5 CONT 11 | 110 PRINT I 12 | 120 NEXT 13 | 130 FOR I=1 TO 2 14 | 140 FOR J=1 TO 2 15 | 150 FOR K=1 TO 2 16 | 160 FOR L=1 TO 2 17 | 170 A=A+(I+J)*(K+L) 18 | 180 NEXT 19 | 190 NEXT 20 | 200 NEXT 21 | 210 NEXT 22 | 220 PRINT A 23 | -------------------------------------------------------------------------------- /examples/99testsBasic2/06for.bas.res: -------------------------------------------------------------------------------- 1 | 55 2 | 5 3 | 1 4 | 2 5 | 3 6 | 4 7 | 5 8 | 199 9 | -------------------------------------------------------------------------------- /examples/99testsBasic2/08string1.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Strings in BASIC (1)" 2 | 20 REM "Dimensioning and comparing" 3 | 100 PRINT "Strings can be constants" 4 | 110 PRINT "Strings", "can", "be", "constants" 5 | 200 PRINT "String variables" 6 | 210 A$="... without DIM - 32 chars max" 7 | 220 PRINT A$ 8 | 230 PRINT "Length of this string", LEN(A$) 9 | 240 DIM B$(80) 10 | 250 B$="... dimensioning to any length, the memory is the limit" 11 | 260 PRINT B$ 12 | 270 PRINT "Length of this string", LEN(B$) 13 | 300 IF A$<>B$ THEN PRINT "Strings are different" 14 | 310 IF A$=A$ THEN PRINT "Strings are equal" 15 | 320 IF A$ THEN PRINT "String is not empty" 16 | 330 C$="" 17 | 340 IF C$ THEN PRINT "This never shows" 18 | 350 PRINT "... because empty strings evaluate to false" 19 | 400 END 20 | 21 | -------------------------------------------------------------------------------- /examples/99testsBasic2/08string1.bas.res: -------------------------------------------------------------------------------- 1 | Strings can be constants 2 | Strings can be constants 3 | String variables 4 | ... without DIM - 32 chars max 5 | Length of this string 30 6 | ... dimensioning to any length, the memory is the limit 7 | Length of this string 55 8 | Strings are different 9 | Strings are equal 10 | String is not empty 11 | ... because empty strings evaluate to false 12 | -------------------------------------------------------------------------------- /examples/99testsBasic2/09string2.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Strings in BASIC (2)" 2 | 20 REM "Substrings, splitting and concatenating" 3 | 100 DIM A$(80), B$(80) 4 | 110 A$="the quick brown fox jumps over the lazy dog" 5 | 120 PRINT A$ 6 | 130 PRINT "The first 3 characters-", A$(1,3) 7 | 140 PRINT "The rest of the string-", A$(4) 8 | 150 PRINT "Splitting ..." 9 | 160 FOR I=1 TO LEN(A$) 10 | 170 PRINT A$(I, I); 11 | 180 IF A$(I, I)=" " THEN PRINT 12 | 190 NEXT I 13 | 200 PRINT 14 | 210 C$=A$(1, 19) 15 | 220 D$=A$(20) 16 | 230 PRINT C$ 17 | 240 PRINT D$ 18 | 250 PRINT "Concatenating ..." 19 | 260 B$=C$ : B$(LEN(B$)+1)=D$ 20 | 270 PRINT B$ 21 | 300 END 22 | 23 | -------------------------------------------------------------------------------- /examples/99testsBasic2/09string2.bas.res: -------------------------------------------------------------------------------- 1 | the quick brown fox jumps over the lazy dog 2 | The first 3 characters- the 3 | The rest of the string- quick brown fox jumps over the lazy dog 4 | Splitting ... 5 | the 6 | quick 7 | brown 8 | fox 9 | jumps 10 | over 11 | the 12 | lazy 13 | dog 14 | the quick brown fox 15 | jumps over the lazy dog 16 | Concatenating ... 17 | the quick brown fox jumps over the lazy dog 18 | -------------------------------------------------------------------------------- /examples/99testsBasic2/10string3.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Strings in BASIC (3)" 2 | 20 REM "chars and strings" 3 | 100 DIM A$(80) 4 | 110 PRINT "Integers are chars" 5 | 120 FOR I=1 TO 26 6 | 130 A$(I)=64+I 7 | 140 NEXT I 8 | 150 PRINT A$ 9 | 200 PRINT "Chars are chars or integers, mind the ()" 10 | 210 FOR I=1 TO 10 11 | 220 C=A$(I, I) 12 | 230 PRINT A$(I, I), (A$(I, I)), C 13 | 240 NEXT I 14 | 300 PRINT "Chars are taken from the beginning" 15 | 310 FOR I=1 TO 10 16 | 320 C=A$(I) 17 | 330 PRINT C, A$(I) 18 | 340 NEXT I 19 | 400 PRINT "Chars are signed, mind the ()" 20 | 410 A$=230 21 | 420 PRINT (A$) 22 | 500 END 23 | 24 | -------------------------------------------------------------------------------- /examples/99testsBasic2/10string3.bas.res: -------------------------------------------------------------------------------- 1 | Integers are chars 2 | ABCDEFGHIJKLMNOPQRSTUVWXYZ 3 | Chars are chars or integers, mind the () 4 | A 65 65 5 | B 66 66 6 | C 67 67 7 | D 68 68 8 | E 69 69 9 | F 70 70 10 | G 71 71 11 | H 72 72 12 | I 73 73 13 | J 74 74 14 | Chars are taken from the beginning 15 | 65 ABCDEFGHIJKLMNOPQRSTUVWXYZ 16 | 66 BCDEFGHIJKLMNOPQRSTUVWXYZ 17 | 67 CDEFGHIJKLMNOPQRSTUVWXYZ 18 | 68 DEFGHIJKLMNOPQRSTUVWXYZ 19 | 69 EFGHIJKLMNOPQRSTUVWXYZ 20 | 70 FGHIJKLMNOPQRSTUVWXYZ 21 | 71 GHIJKLMNOPQRSTUVWXYZ 22 | 72 HIJKLMNOPQRSTUVWXYZ 23 | 73 IJKLMNOPQRSTUVWXYZ 24 | 74 JKLMNOPQRSTUVWXYZ 25 | Chars are signed, mind the () 26 | -26 27 | -------------------------------------------------------------------------------- /examples/99testsBasic2/11string4.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Strings in BASIC (4)" 2 | 20 REM "String arrays" 3 | 30 DIM B$(10,10) 4 | 100 REM "Read a string" 5 | 110 FOR I=1 TO 9 6 | 120 READ B$()(I) 7 | 130 NEXT I 8 | 200 REM "Print the entire string" 9 | 210 FOR I=1 TO 9 10 | 220 PRINT B$()(I) 11 | 230 NEXT I 12 | 300 REM "Substrings and arrays" 13 | 310 FOR I=1 TO 9 14 | 320 PRINT B$(1,1)(I) 15 | 330 NEXT I 16 | 400 DATA "the", "quick", "brown", "fox", "jumps", "over", "the", "lazy", "dog" 17 | -------------------------------------------------------------------------------- /examples/99testsBasic2/11string4.bas.res: -------------------------------------------------------------------------------- 1 | the 2 | quick 3 | brown 4 | fox 5 | jumps 6 | over 7 | the 8 | lazy 9 | dog 10 | t 11 | q 12 | b 13 | f 14 | j 15 | o 16 | t 17 | l 18 | d 19 | -------------------------------------------------------------------------------- /examples/99testsBasic2/12clrvars.bas: -------------------------------------------------------------------------------- 1 | 10 M=USR(0, 9) 2 | 20 PRINT "Memory size is ";M 3 | 110 DIM A(8) 4 | 120 FOR I=1 TO 8: A(I)=I: NEXT 5 | 130 FOR I=1 TO 8: PRINT I, A(I): NEXT 6 | 140 A$="Hello World" 7 | 200 PRINT "A$ is ";A$ 8 | 210 CLR A() 9 | 220 PRINT "A$ is ";A$ 10 | 300 DIM A(20) 11 | 310 FOR I=1 TO 20: A(I)=I: NEXT 12 | 320 FOR I=1 TO 20: PRINT I, A(I): NEXT 13 | -------------------------------------------------------------------------------- /examples/99testsBasic2/12clrvars.bas.res: -------------------------------------------------------------------------------- 1 | Memory size is 65535 2 | 1 1 3 | 2 2 4 | 3 3 5 | 4 4 6 | 5 5 7 | 6 6 8 | 7 7 9 | 8 8 10 | A$ is Hello World 11 | A$ is 12 | 1 1 13 | 2 2 14 | 3 3 15 | 4 4 16 | 5 5 17 | 6 6 18 | 7 7 19 | 8 8 20 | 9 9 21 | 10 10 22 | 11 11 23 | 12 12 24 | 13 13 25 | 14 14 26 | 15 15 27 | 16 16 28 | 17 17 29 | 18 18 30 | 19 19 31 | 20 20 32 | -------------------------------------------------------------------------------- /examples/99testsBasic2/13cond.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Conditions if then else demo" 2 | 20 REM "" 3 | 100 A=10 4 | 110 IF A=10 THEN 130 5 | 120 PRINT "This code is never reached" 6 | 130 IF A=10 THEN PRINT "A is 10" ELSE PRINT "A is not 10" 7 | 140 IF A=20 ELSE PRINT "A is not 20" 8 | 200 END 9 | 10 | -------------------------------------------------------------------------------- /examples/99testsBasic2/13cond.bas.res: -------------------------------------------------------------------------------- 1 | A is 10 2 | A is not 20 3 | -------------------------------------------------------------------------------- /examples/99testsBasic2/14fibo.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Calculates the Fibonacci numbers" 2 | 20 REM "And the Golden Ratio on an Integer BASIC" 3 | 200 REM "Main program" 4 | 210 N=19 5 | 220 DIM A(N) 6 | 230 A(1)=1 7 | 240 A(2)=1 8 | 250 FOR I=3 TO N 9 | 260 IF A(I)>16000 THEN BREAK 10 | 270 A(I)=A(I-1)+A(I-2) 11 | 280 Q=A(I): D=A(I-1) 12 | 290 PRINT #4;I,Q,D; 13 | 300 GOSUB 500 14 | 310 NEXT 15 | 320 END 16 | 500 REM "Print a decimal ratio of a fraction" 17 | 520 Z=INT(Q/D) 18 | 530 PRINT " ";Z;"."; 19 | 540 FOR J=1 TO 10 20 | 550 Z=Q%D 21 | 560 Q=Z*10 22 | 570 Z=INT(Q/D) 23 | 580 PRINT Z; 24 | 590 NEXT 25 | 600 PRINT " " 26 | 610 RETURN 27 | -------------------------------------------------------------------------------- /examples/99testsBasic2/14fibo.bas.res: -------------------------------------------------------------------------------- 1 | 3 2 1 2.0000000000 2 | 4 3 2 1.5000000000 3 | 5 5 3 1.6666666666 4 | 6 8 5 1.6000000000 5 | 7 13 8 1.6250000000 6 | 8 21 13 1.6153846153 7 | 9 34 21 1.6190476190 8 | 10 55 34 1.6176470588 9 | 11 89 55 1.6181818181 10 | 12 144 89 1.6179775280 11 | 13 233 144 1.6180555555 12 | 14 377 233 1.6180257510 13 | 15 610 377 1.6180371352 14 | 16 987 610 1.6180327868 15 | 17 1597 987 1.6180344478 16 | 18 2584 1597 1.6180338134 17 | 19 4181 2584 1.6180340557 18 | -------------------------------------------------------------------------------- /examples/99testsBasic2/15logic.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Logical expressions" 2 | 20 REM "" 3 | 100 A=10 4 | 110 B=20 5 | 120 PRINT "A="; A, "; B=";B, "; C=";C 6 | 130 IF A=10 THEN PRINT "A is 10" 7 | 140 IF NOT A=20 THEN PRINT "A is not 20" 8 | 150 IF A=10 AND B=20 THEN PRINT "A is 10 and B is 20" 9 | 160 IF A=10 OR C=10 THEN PRINT "A is 10 or C is 10" 10 | 200 PRINT "Expressions" 11 | 210 L=(A=10 AND B=20) 12 | 220 PRINT "L=(A=10 AND B=20)" 13 | 230 PRINT "L =",L 14 | 240 K=NOT L 15 | 250 PRINT "NOT L =",K 16 | 260 K=NOT NOT L 17 | 270 PRINT "NOT NOT L =",K 18 | 280 END 19 | 20 | -------------------------------------------------------------------------------- /examples/99testsBasic2/15logic.bas.res: -------------------------------------------------------------------------------- 1 | A=10 ; B=20 ; C=0 2 | A is 10 3 | A is not 20 4 | A is 10 and B is 20 5 | A is 10 or C is 10 6 | Expressions 7 | L=(A=10 AND B=20) 8 | L = -1 9 | NOT L = 0 10 | NOT NOT L = -1 11 | -------------------------------------------------------------------------------- /examples/99testsBasic2/16parable.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Draw a parable" 2 | 20 REM "" 3 | 100 PRINT "Y=X*X" 4 | 110 FOR X=-8 TO 8 5 | 120 IF X<>0 PRINT "!"; 6 | 130 IF X=0 PRINT "+";: FOR I=2 TO 8*8/2: PRINT "-";: NEXT: PRINT : GOTO 160 7 | 140 TAB(X*X/2-1) 8 | 150 PRINT "*" 9 | 160 NEXT X 10 | 200 END -------------------------------------------------------------------------------- /examples/99testsBasic2/16parable.bas.res: -------------------------------------------------------------------------------- 1 | Y=X*X 2 | ! * 3 | ! * 4 | ! * 5 | ! * 6 | ! * 7 | ! * 8 | ! * 9 | !* 10 | +------------------------------- 11 | !* 12 | ! * 13 | ! * 14 | ! * 15 | ! * 16 | ! * 17 | ! * 18 | ! * 19 | -------------------------------------------------------------------------------- /examples/99testsBasic2/18func.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Function definitions" 2 | 20 REM "" 3 | 100 DEF FNS(X)=X*X 4 | 200 READ N 5 | 210 PRINT "The square of",N," is: "; FN S(N) 6 | 220 PRINT "X is",X 7 | 230 END 8 | 300 DATA 10 9 | -------------------------------------------------------------------------------- /examples/99testsBasic2/18func.bas.res: -------------------------------------------------------------------------------- 1 | The square of 10 is: 100 2 | X is 0 3 | -------------------------------------------------------------------------------- /examples/99testsBasic2/19readdata.bas.res: -------------------------------------------------------------------------------- 1 | Reading strings 2 | the quick brown fox jumps over the lazy dog 3 | HELLO WORLD 4 | Reading beyond the end 5 | Status byte is 0 6 | Attempting to read 7 | Status byte is 1 now 8 | Read data was 0 9 | Data pointer is now 4 10 | Reading from data pointer 2 now 11 | Result is quick 12 | -------------------------------------------------------------------------------- /examples/99testsBasic2/20ongo.bas: -------------------------------------------------------------------------------- 1 | 10 REM "ON GOSUB/GOTO demo program" 2 | 20 REM "" 3 | 100 PRINT "For the solution to all problems:" 4 | 110 READ I 5 | 120 IF I=-1 END 6 | 130 GOSUB 800 7 | 140 GOTO 110 8 | 800 ON I GOTO 850, 860, 870 9 | 810 REM "default" 10 | 820 PRINT "Wrong number",I : RETURN 11 | 830 REM "The cases" 12 | 850 PRINT "Meditations"; : GOTO 900 13 | 860 PRINT "Alcohol"; : GOTO 900 14 | 870 PRINT "Chocolate"; : GOTO 900 15 | 900 PRINT " is the solution" 16 | 910 RETURN 17 | 1000 DATA 1,2,3,6,1000,-10,0,-9999,-1 18 | -------------------------------------------------------------------------------- /examples/99testsBasic2/20ongo.bas.res: -------------------------------------------------------------------------------- 1 | For the solution to all problems: 2 | Meditations is the solution 3 | Alcohol is the solution 4 | Chocolate is the solution 5 | Wrong number 6 6 | Wrong number 1000 7 | Wrong number -10 8 | Wrong number 0 9 | Wrong number -9999 10 | -------------------------------------------------------------------------------- /examples/99testsBasic2/21ongosub.bas: -------------------------------------------------------------------------------- 1 | 10 REM "ON GOSUB/GOTO demo program" 2 | 20 REM "" 3 | 100 PRINT "For the solution to all problems:" 4 | 110 READ I 5 | 120 IF I=-1 END 6 | 130 ON I GOSUB 850, 860, 870 7 | 140 GOTO 110 8 | 850 PRINT "Meditation"; : GOTO 900 9 | 860 PRINT "Alcohol"; : GOTO 900 10 | 870 PRINT "Chocolate"; : GOTO 900 11 | 900 PRINT " is the solution" 12 | 910 RETURN 13 | 1000 DATA 1,2,3,6,1000,-10,0,-9999,-1 14 | -------------------------------------------------------------------------------- /examples/99testsBasic2/21ongosub.bas.res: -------------------------------------------------------------------------------- 1 | For the solution to all problems: 2 | Meditation is the solution 3 | Alcohol is the solution 4 | Chocolate is the solution 5 | -------------------------------------------------------------------------------- /examples/99testsBasic2/22trig.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Table of trigonometric functions" 2 | 20 REM "" 3 | 100 REM "Calculate PI" 4 | 110 P1=4*ATAN(1) 5 | 200 PRINT "X";: TAB(4) 6 | 205 PRINT "SIN(X)";: TAB(7) 7 | 210 PRINT "COS(X)";: TAB(7) 8 | 215 PRINT "TAN(X)" 9 | 220 FOR I=0 TO 89 STEP 5 10 | 230 X=I/360*2*P1 11 | 240 PRINT #4, I, #12, SIN(X), COS(X), TAN(X) 12 | 250 NEXT 13 | -------------------------------------------------------------------------------- /examples/99testsBasic2/23stir.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Calculate Factorial and Stirlings function" 2 | 20 REM "" 3 | 100 REM "Factorial" 4 | 110 L=20 5 | 120 DIM F(L) 6 | 130 F(1)=1 7 | 140 FOR I=2 TO L 8 | 150 F(I)=F(I-1)*I 9 | 160 NEXT 10 | 200 REM "Stirling" 11 | 210 P1=4*ATAN(1) 12 | 220 DEF FNS(N)=SQR(2*P1*N)*EXP(N*(LOG(N)-1)) 13 | 300 REM "Print table" 14 | 305 PRINT "N";: TAB(4) 15 | 310 PRINT "FACT(N)";: TAB(6) 16 | 315 PRINT "STIR(N)";: TAB(6) 17 | 320 PRINT "Accuracy (%)" 18 | 330 FOR I=1 TO L 19 | 340 PRINT #4, I, #12, F(I), FNS(I), (F(I)-FNS(I))/F(I)*100 20 | 350 NEXT 21 | 400 END 22 | -------------------------------------------------------------------------------- /examples/99testsBasic2/24mandel.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Caculate the mandelbrot set" 2 | 20 REM "The iteration cutoff, threshold, and resolution" 3 | 30 N=10 4 | 40 T=4 5 | 50 R=20 6 | 100 C0=0: C1=0 7 | 200 REM "walk through the grid" 8 | 210 FOR J=2*R+1 TO 1 STEP -1 9 | 220 FOR I=1 TO 3*R+1 10 | 230 C0=-2+(I-1)/R: C1=-1+(J-1)/R 11 | 240 GOSUB 4000 12 | 250 GOSUB 5000 13 | 280 NEXT 14 | 290 PRINT 15 | 300 NEXT 16 | 999 END 17 | 4000 REM "do an iteration on c" 18 | 4010 Z0=C0: Z1=C1 19 | 4020 FOR K=1 TO N 20 | 4030 S0=Z0*Z0: S1=Z1*Z1 21 | 4040 IF S0+S1>T THEN BREAK 22 | 4050 X0=S0-S1+C0 23 | 4060 X1=2*Z0*Z1+C1 24 | 4070 Z0=X0: Z1=X1 25 | 4080 NEXT 26 | 4090 RETURN 27 | 5000 REM "plot a point" 28 | 5010 IF K>N THEN PRINT "X"; : RETURN 29 | 5020 IF K>N/2 THEN PRINT "."; : RETURN 30 | 5030 PRINT " "; 31 | 5040 RETURN 32 | -------------------------------------------------------------------------------- /examples/99testsBasic2/25malloc.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Elementary malloc demo" 2 | 20 REM "" 3 | 100 PRINT "Allocate 16 bytes of memory with identifier 1" 4 | 110 M=MALLOC(1, 16) 5 | 120 PRINT "Address of memory segment", M 6 | 200 PRINT "Storing data" 7 | 210 FOR I=0 TO 15 8 | 220 POKE M+I, I*2 9 | 230 NEXT I 10 | 300 PRINT "Retrieving data" 11 | 310 FOR I=0 TO 15 12 | 320 PRINT I, PEEK(M+I) 13 | 330 NEXT I 14 | 400 F=FIND(1) 15 | 410 PRINT "Memory address of buffer 1 is", F 16 | 500 A0=10 17 | 510 F=FIND(A0) 18 | 520 PRINT "Memory address of variable A0 is", F 19 | 600 DIM A(8) 20 | 610 F=FIND(A()) 21 | 620 PRINT "Memory address of array A() is", F 22 | 700 A$="Hello World" 23 | 710 F=FIND(A$) 24 | 720 PRINT "Memory address of string A$ is", F 25 | 800 PRINT "HIMEM is now ", HIMEM 26 | 810 CLR 1 27 | 820 PRINT "HIMEM after CLR", HIMEM 28 | -------------------------------------------------------------------------------- /examples/99testsBasic2/25malloc.bas.res: -------------------------------------------------------------------------------- 1 | Allocate 16 bytes of memory with identifier 1 2 | Address of memory segment 65519 3 | Storing data 4 | Retrieving data 5 | 0 0 6 | 1 2 7 | 2 4 8 | 3 6 9 | 4 8 10 | 5 10 11 | 6 12 12 | 7 14 13 | 8 16 14 | 9 18 15 | 10 20 16 | 11 22 17 | 12 24 18 | 13 26 19 | 14 28 20 | 15 30 21 | Memory address of buffer 1 is 65519 22 | Memory address of variable A0 is 65488 23 | Memory address of array A() is 65450 24 | Memory address of string A$ is 65409 25 | HIMEM is now 65403 26 | HIMEM after CLR 65403 27 | -------------------------------------------------------------------------------- /examples/99testsBasic2/26eval.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Demo for the EVAL command" 2 | 20 REM "" 3 | 30 DIM A$(80) 4 | 100 A$="Y=X*X+7" 5 | 110 EVAL 1010,A$ 6 | 200 PRINT "X Y" 7 | 210 FOR X=-4 TO 4.001 STEP 0.5 8 | 220 GOSUB 1000: PRINT #4, X, Y 9 | 230 NEXT 10 | 300 END 11 | 1000 REM "The function at the end" 12 | 1010 Y=X 13 | 1020 RETURN 14 | -------------------------------------------------------------------------------- /examples/99testsBasic2/26eval.bas.res: -------------------------------------------------------------------------------- 1 | X Y 2 | -4 23 3 | -3.5 19.25 4 | -3 16 5 | -2.5 13.25 6 | -2 11 7 | -1.5 9.25 8 | -1 8 9 | -0.5 7.25 10 | 0 7 11 | 0.5 7.25 12 | 1 8 13 | 1.5 9.25 14 | 2 11 15 | 2.5 13.25 16 | 3 16 17 | 3.5 19.25 18 | 4 23 19 | -------------------------------------------------------------------------------- /examples/99testsBasic2/27splitstr.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Split a string into substrings" 2 | 20 REM "" 3 | 100 DIM A$(80) 4 | 110 A$="the quick brown fox jumps over the lazy dog" 5 | 200 FOR I 6 | 210 A=INSTR(A$, " ") 7 | 220 IF A=0 THEN PRINT A$: BREAK 8 | 230 PRINT A$(1,A-1) 9 | 240 A$=A$(A+1) 10 | 250 NEXT 11 | 300 END 12 | -------------------------------------------------------------------------------- /examples/99testsBasic2/27splitstr.bas.res: -------------------------------------------------------------------------------- 1 | the 2 | quick 3 | brown 4 | fox 5 | jumps 6 | over 7 | the 8 | lazy 9 | dog 10 | -------------------------------------------------------------------------------- /examples/99testsBasic2/28convert.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Convert strings to numbers and vice versa" 2 | 20 REM "" 3 | 100 A$="123" 4 | 110 REM "Clear the error flag" 5 | 120 @S=0 6 | 130 A=VAL(A$) 7 | 140 IF @S=0 THEN PRINT "Conversion successful, number is ", A ELSE PRINT "Number error" 8 | 200 A=123 9 | 210 A$=STR(A) 10 | 220 PRINT "The number is '";A$;"' " 11 | 300 END 12 | -------------------------------------------------------------------------------- /examples/99testsBasic2/28convert.bas.res: -------------------------------------------------------------------------------- 1 | Conversion successful, number is 123 2 | The number is '123' 3 | -------------------------------------------------------------------------------- /examples/99testsBasic2/29timestop.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Stopping after some time" 2 | 100 AFTER 10 GOTO 1000 3 | 110 T=MILLIS(1) 4 | 120 FOR I 5 | 130 IF MILLIS(1)-T>100 BREAK 6 | 140 NEXT 7 | 150 PRINT "Timer failed" 8 | 160 END 9 | 1000 PRINT "Program stopped with timer" 10 | 1010 STOP 11 | -------------------------------------------------------------------------------- /examples/99testsBasic2/29timestop.bas.res: -------------------------------------------------------------------------------- 1 | Program stopped with timer 2 | -------------------------------------------------------------------------------- /examples/99testsBasic2/30every.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Doing things from time to time" 2 | 100 EVERY 10 GOSUB 1000 3 | 110 IF I>4 END 4 | 120 GOTO 110 5 | 1000 I=I+1 6 | 1010 PRINT "Iteration", I 7 | 1020 RETURN 8 | -------------------------------------------------------------------------------- /examples/99testsBasic2/30every.bas.res: -------------------------------------------------------------------------------- 1 | Iteration 1 2 | Iteration 2 3 | Iteration 3 4 | Iteration 4 5 | Iteration 5 6 | -------------------------------------------------------------------------------- /examples/99testsBasic2/31error.bas: -------------------------------------------------------------------------------- 1 | 10 ERROR GOTO 1000 2 | 20 PRINT "main code" 3 | 30 A=1/0 4 | 100 END 5 | 1000 PRINT "error code" 6 | 1005 PRINT ERROR 7 | 1010 END 8 | -------------------------------------------------------------------------------- /examples/99testsBasic2/31error.bas.res: -------------------------------------------------------------------------------- 1 | main code 2 | error code 3 | 12 4 | -------------------------------------------------------------------------------- /examples/99testsBasic2/32euler9.bas.res: -------------------------------------------------------------------------------- 1 | Enter the circumference K of a triangle 2 | The program finds a pythagorean triangle 3 | a^2 + b^2 = c^2 4 | Primitive triple 3 4 5 5 | Circumference= 12 6 | Scale with 84 7 | Solution 252 336 420 8 | Primitive triple 7 24 25 9 | Circumference= 56 10 | Scale with 18 11 | Solution 126 432 450 12 | Primitive triple 35 12 37 13 | Circumference= 84 14 | Scale with 12 15 | Solution 420 144 444 16 | Primitive triple 45 28 53 17 | Circumference= 126 18 | Scale with 8 19 | Solution 360 224 424 20 | Primitive triple 63 16 65 21 | Circumference= 144 22 | Scale with 7 23 | Solution 441 112 455 24 | -------------------------------------------------------------------------------- /examples/99testsBasic2/33primes.bas: -------------------------------------------------------------------------------- 1 | 100 REM "Calculate the first N prime numbers" 2 | 110 REM "and output them!" 3 | 200 CLR 4 | 210 N=100 5 | 220 IF N=0 THEN 500 6 | 230 DIM P(N): P(1)=2: P(2)=3: I=2 7 | 240 IF I=N THEN 360 8 | 250 K=P(I) 9 | 260 K=K+2 10 | 270 L=SQR(K) 11 | 280 J=1 12 | 290 D=P(J) 13 | 310 M=K%D 14 | 320 IF M=0 THEN 260 15 | 330 IF D@ THEN PRINT "Maximum is ", @ : GOTO 200 9 | 230 @(1)=2: @(2)=3 10 | 240 FOR I=3 TO N 11 | 250 K=@(I-1)+2 12 | 260 L=SQR(K) 13 | 270 FOR J=1 14 | 280 IF K%@(J)=0 THEN K=K+2 : GOTO 260 15 | 290 IF @(J)>L THEN BREAK 16 | 300 NEXT J 17 | 310 @(I)=K 18 | 320 NEXT I 19 | 360 PRINT "The first", N, "primes are:" 20 | 370 FOR J=1 TO N 21 | 380 PRINT J, @(J) 22 | 390 NEXT 23 | 500 END 24 | -------------------------------------------------------------------------------- /examples/99testsBasic2/35math.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Extended math functions" 2 | 20 REM "" 3 | 100 READ A 4 | 110 PRINT "The square root of", A, "is", SQR(A) 5 | 200 READ B 6 | 210 READ E 7 | 220 PRINT B, "to the power of", E, "is", POW(B, E) 8 | 300 READ V 9 | 310 IF V<0 OR V>1000 THEN PRINT "Range Error" : GOTO 300 10 | 320 M=MAP(V, 1000, 0, 200, 100) 11 | 330 PRINT V, "mapped to the range of 200 and 100 is", M 12 | 400 END 13 | 500 DATA 2, 3, 5, 567 14 | -------------------------------------------------------------------------------- /examples/99testsBasic2/35math.bas.res: -------------------------------------------------------------------------------- 1 | The square root of 2 is 1.41421 2 | 3 to the power of 5 is 243 3 | 567 mapped to the range of 200 and 100 is 157 4 | -------------------------------------------------------------------------------- /examples/99testsBasic2/36tictac.bas.res: -------------------------------------------------------------------------------- 1 | Welcome to tictactoe 2 | The game board is numbered: 3 | 4 | 1 2 3 5 | 8 9 4 6 | 7 6 5 7 | 8 | Staring a new game 9 | Computer moves: 9 10 | Computer moves: 2 11 | Computer moves: 4 12 | Computer moves: 7 13 | Computer moves: 5 14 | The game is a draw. 15 | -------------------------------------------------------------------------------- /examples/99testsBasic2/38poetry.bas.res: -------------------------------------------------------------------------------- 1 | MIDNIGHT DREARY 2 | PROPHET BEGUILING ME 3 | AND MY SOUL 4 | YET AGAIN 5 | PROPHET THRILLED ME AND MY SOUL NEVERMORE 6 | PROPHET, STILL SITTING.... 7 | AND MY SOUL 8 | NOTHING MORE 9 | FIERY EYES THRILLED ME QUOTH THE RAVEN NEVERMORE 10 | PROPHET 11 | NEVER FLITTING 12 | QUOTH THE RAVEN SLOWLY CREEPING 13 | 14 | -------------------------------------------------------------------------------- /examples/99testsBasic2/40forfor.bas.res: -------------------------------------------------------------------------------- 1 | 1 2 | 0 3 | -1 4 | 10 5 | 11 6 | 12 7 | 13 8 | 14 9 | 15 10 | 16 11 | 17 12 | 18 13 | 19 14 | 20 15 | 21 16 | 20 17 | 19 18 | 18 19 | 17 20 | 16 21 | 15 22 | 14 23 | 13 24 | 12 25 | 11 26 | 10 27 | 81 28 | 1 29 | 3 30 | 5 31 | 7 32 | 9 33 | 1 34 | 1.5 35 | 2 36 | 2.5 37 | 3 38 | 3.5 39 | 4 40 | 4.5 41 | 5 42 | 5.5 43 | 6 44 | 6.5 45 | 7 46 | 7.5 47 | 8 48 | 8.5 49 | 9 50 | 9.5 51 | 10 52 | This is 0: 0 53 | 1 1 54 | 1 2 55 | This is 1: 1 56 | This is 0: 0 57 | 1 58 | 2 59 | 3 60 | 4 61 | 5 62 | 6 63 | 7 64 | 8 65 | 9 66 | 10 67 | ERROR 19 68 | ERROR 10 69 | ERROR 10 70 | ERROR 10 71 | -------------------------------------------------------------------------------- /examples/99testsBasic2/42gosub.bas: -------------------------------------------------------------------------------- 1 | 10 REM "GOSUB and RETURN" 2 | 20 GOSUB 40 3 | 30 GOTO 100 4 | 40 RETURN 5 | 50 PRINT "FAIL": END 6 | 100 REM "Return without a GOSUB" 7 | 110 ERROR GOTO 140 8 | 120 RETURN 9 | 130 PRINT "FAIL": END 10 | 140 PRINT "ERROR", ERROR 11 | 200 REM "Many GOSUBs (1)" 12 | 210 ERROR GOTO 240 13 | 220 GOSUB 220 14 | 230 PRINT "FAIL": END 15 | 240 PRINT "ERROR", ERROR 16 | 300 REM "Many GOSUBs (2)" 17 | 310 ERROR GOTO 350 18 | 320 GOSUB 330 19 | 330 GOSUB 320 20 | 340 PRINT "FAIL": END 21 | 350 PRINT "ERROR", ERROR 22 | -------------------------------------------------------------------------------- /examples/99testsBasic2/42gosub.bas.res: -------------------------------------------------------------------------------- 1 | ERROR -113 2 | ERROR -114 3 | ERROR -114 4 | -------------------------------------------------------------------------------- /examples/99testsBasic2/43gogogo.bas.res: -------------------------------------------------------------------------------- 1 | 18 GOTOs 2 | Jumped to 430 3 | ERROR 13 4 | PASS 5 | PASS 6 | PASS 7 | PASS 8 | PASS 9 | PASS 10 | PASS 11 | PASS 12 | PASS 13 | PASS 14 | DOUBLE PASS 15 | -------------------------------------------------------------------------------- /examples/99testsBasic2/44deffn.bas: -------------------------------------------------------------------------------- 1 | 5 M=0 2 | 10 REM "DEF FN standard" 3 | 20 DEF FN A(X)=X*X 4 | 30 PRINT FNA(2), FNA(FNA(2)), FNA(FNA(FNA(2))) 5 | 40 REM "Does the variable stay" 6 | 50 X=5 7 | 60 PRINT FNA(2), FNA(FNA(2)), FNA(FNA(FNA(2))) 8 | 70 PRINT X 9 | 80 REM "Redefine and see what happens" 10 | 90 M=HIMEM 11 | 100 DEF FNA(X)=X*X*X 12 | 120 PRINT FNA(2) 13 | 130 PRINT HIMEM-M 14 | 200 REM "Define a new function" 15 | 210 DEF FNB(X)=FNA(X)*X 16 | 220 PRINT FNB(2) 17 | 230 DEF FNC(X)=FNB(X)*X 18 | 240 PRINT FNC(2) 19 | -------------------------------------------------------------------------------- /examples/99testsBasic2/44deffn.bas.res: -------------------------------------------------------------------------------- 1 | 4 16 256 2 | 4 16 256 3 | 5 4 | 8 5 | 0 6 | 16 7 | 32 8 | -------------------------------------------------------------------------------- /examples/99testsBasic2/45ongo.bas.res: -------------------------------------------------------------------------------- 1 | PASS 2 | PASS 3 | PASS WITH ERROR 13 4 | PASS 5 | PASS 6 | PASS WITH ERROR 13 7 | PASS 8 | -------------------------------------------------------------------------------- /examples/99testsBasic2/46output.bas.res: -------------------------------------------------------------------------------- 1 | Hello World says Stefan. 2 | 0 0 0 :: 3 | 10 5 6 :---: 4 | 10 5 6 :---: 5 | 10 5 6 :---: 6 | 10 5 6 :---: 7 | 10 5 6 :---: 8 | 10 5 6 :---: 9 | 10 5 6 :---: 10 | 10 6 x 11 | -10 6 x 12 | -10 -6 x 13 | -120 -270 x 14 | -120 -270x 15 | -120 -270 x 16 | Hello 17 | 72 18 | HH 19 | A B 20 | A 21 |  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ 22 | -------------------------------------------------------------------------------- /examples/99testsBasic2/47while.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Stuctured commands test" 2 | 110 A=0 3 | 120 B=0 4 | 130 WHILE A<10 5 | 140 PRINT A 6 | 150 A=A+1 7 | 160 B=A 8 | 170 WHILE B<10 9 | 180 PRINT B; " "; 10 | 190 B=B+1 11 | 200 WEND 12 | 210 PRINT 13 | 220 WEND 14 | 300 REM "all in one line" 15 | 310 A=0 16 | 320 B=0 17 | 330 WHILE A<10 18 | 340 PRINT A 19 | 350 A=A+1 20 | 360 B=A 21 | 370 WHILE B<10: PRINT B; " ";: B=B+1: WEND 22 | 380 PRINT 23 | 390 WEND 24 | 400 REM "Break test code" 25 | 410 A=10 26 | 420 WHILE A>0 27 | 430 A=A-1 28 | 440 IF A=4 THEN BREAK 29 | 450 PRINT A 30 | 460 WEND 31 | 500 REM "Cont test code" 32 | 510 A=10 33 | 520 WHILE A>0 34 | 530 A=A-1 35 | 540 IF A%2=0 THEN CONT 36 | 550 PRINT A 37 | 560 WEND 38 | 39 | -------------------------------------------------------------------------------- /examples/99testsBasic2/47while.bas.res: -------------------------------------------------------------------------------- 1 | 0 2 | 1 2 3 4 5 6 7 8 9 3 | 1 4 | 2 3 4 5 6 7 8 9 5 | 2 6 | 3 4 5 6 7 8 9 7 | 3 8 | 4 5 6 7 8 9 9 | 4 10 | 5 6 7 8 9 11 | 5 12 | 6 7 8 9 13 | 6 14 | 7 8 9 15 | 7 16 | 8 9 17 | 8 18 | 9 19 | 9 20 | 21 | 0 22 | 1 2 3 4 5 6 7 8 9 23 | 1 24 | 2 3 4 5 6 7 8 9 25 | 2 26 | 3 4 5 6 7 8 9 27 | 3 28 | 4 5 6 7 8 9 29 | 4 30 | 5 6 7 8 9 31 | 5 32 | 6 7 8 9 33 | 6 34 | 7 8 9 35 | 7 36 | 8 9 37 | 8 38 | 9 39 | 9 40 | 41 | 9 42 | 8 43 | 7 44 | 6 45 | 5 46 | 9 47 | 7 48 | 5 49 | 3 50 | 1 51 | -------------------------------------------------------------------------------- /examples/99testsBasic2/48until.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Repeat until test code" 2 | 110 A=10 3 | 120 REPEAT 4 | 130 PRINT A 5 | 140 A=A-1 6 | 150 UNTIL A=0 7 | 200 REM "Break test code" 8 | 210 A=10 9 | 220 REPEAT 10 | 230 PRINT A 11 | 240 A=A-1 12 | 250 IF A%5=0 THEN BREAK 13 | 260 UNTIL A=0 14 | 300 REM "Cont test code" 15 | 310 A=10 16 | 320 REPEAT 17 | 330 A=A-1 18 | 340 IF A%2=0 THEN CONT 19 | 350 PRINT A 20 | 360 UNTIL A=0 21 | 22 | -------------------------------------------------------------------------------- /examples/99testsBasic2/48until.bas.res: -------------------------------------------------------------------------------- 1 | 10 2 | 9 3 | 8 4 | 7 5 | 6 6 | 5 7 | 4 8 | 3 9 | 2 10 | 1 11 | 10 12 | 9 13 | 8 14 | 7 15 | 6 16 | 9 17 | 7 18 | 5 19 | 3 20 | 1 21 | -------------------------------------------------------------------------------- /examples/99testsBasic2/49switch.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Switch test code" 2 | 100 FOR A=0 TO 4 3 | 110 SWITCH A 4 | 120 PRINT "default" 5 | 130 CASE 1,2: PRINT "one or two" 6 | 140 CASE 3: PRINT "three" 7 | 150 SWEND 8 | 160 NEXT 9 | 210 REM "Nested switch" 10 | 220 B=8 11 | 230 FOR A=0 TO 4 12 | 240 SWITCH A 13 | 250 PRINT "default" 14 | 260 CASE 1,2: PRINT "one or two" 15 | 270 CASE 3: PRINT "three" 16 | 280 SWITCH B 17 | 290 PRINT "B: no case found" 18 | 300 CASE 8: PRINT "B is eight" 19 | 310 SWEND 20 | 320 REM 21 | 330 SWEND 22 | 340 NEXT 23 | 350 B=7 24 | 360 FOR A=0 TO 4 25 | 380 SWITCH A 26 | 390 PRINT "default" 27 | 400 CASE 1,2: PRINT "one or two" 28 | 410 CASE 3: PRINT "three" 29 | 420 SWITCH B 30 | 430 PRINT "B: no case found" 31 | 440 CASE 8: PRINT "B is eight" 32 | 450 SWEND 33 | 460 REM 34 | 470 SWEND 35 | 480 NEXT 36 | -------------------------------------------------------------------------------- /examples/99testsBasic2/49switch.bas.res: -------------------------------------------------------------------------------- 1 | default 2 | one or two 3 | one or two 4 | three 5 | default 6 | default 7 | one or two 8 | one or two 9 | three 10 | B is eight 11 | default 12 | default 13 | one or two 14 | one or two 15 | three 16 | B: no case found 17 | default 18 | -------------------------------------------------------------------------------- /examples/99testsBasic2/50teststruct.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Structured if then else test" 2 | 100 A=0 3 | 110 IF A=0 THEN PRINT "A is 0" 4 | 120 IF A=1 THEN PRINT "Failed" ELSE PRINT "A is not 1" 5 | 130 IF A=0 6 | 140 THEN PRINT "A is 0" 7 | 150 IF A=1 8 | 160 THEN PRINT "Failed" 9 | 170 ELSE PRINT "A is not 1" 10 | 200 IF A=0 THEN DO PRINT "A is 0": DEND: PRINT "block ended" 11 | 210 IF A=1 THEN PRINT "Failed" : ELSE DO PRINT "A is 1": DEND: PRINT "block ended" 12 | 300 IF A=0 THEN DO 13 | 310 PRINT "A is 0" 14 | 320 PRINT "and there is another line in the block" 15 | 330 DEND 16 | 340 ELSE 17 | 350 DO 18 | 360 PRINT "Failed" 19 | 370 DEND 20 | 400 IF A=1 THEN DO 21 | 410 PRINT "Failed" 22 | 420 PRINT "and there is another line in the block" 23 | 430 DEND 24 | 440 ELSE 25 | 450 DO 26 | 460 PRINT "A is not one" 27 | 470 PRINT "and there is another line in the block" 28 | 480 DEND 29 | 30 | 31 | -------------------------------------------------------------------------------- /examples/99testsBasic2/50teststruct.bas.res: -------------------------------------------------------------------------------- 1 | A is 0 2 | A is not 1 3 | A is 0 4 | A is not 1 5 | A is 0 6 | block ended 7 | A is 1 8 | block ended 9 | A is 0 10 | and there is another line in the block 11 | A is not one 12 | and there is another line in the block 13 | -------------------------------------------------------------------------------- /examples/99testsBasic2/51rocket.bas.inp: -------------------------------------------------------------------------------- 1 | Y 2 | 3 | 0 4 | 0 5 | 0 6 | 0 7 | 0 8 | 0 9 | 0 10 | 0 11 | 0 12 | 0 13 | 30 14 | 30 15 | 20 16 | 20 17 | 15 18 | 10 19 | 6 20 | 8 21 | 5 22 | n 23 | 24 | -------------------------------------------------------------------------------- /examples/99testsBasic2/52eliza-org.bas.inp: -------------------------------------------------------------------------------- 1 | 2 | I am bored 3 | indeed 4 | I feel weird 5 | shut up 6 | -------------------------------------------------------------------------------- /examples/99testsBasic2/54word.bas.inp: -------------------------------------------------------------------------------- 1 | SMOKE 2 | DINKY 3 | n 4 | -------------------------------------------------------------------------------- /examples/99testsBasic2/54word.bas.res: -------------------------------------------------------------------------------- 1 | I AM THINKING OF A WORD -- YOU GUESS IT. I WILL GIVE YOU 2 | CLUES TO HELP YOU GET IT. GOOD LUCK!! 3 | 4 | YOU ARE STARTING A NEW GAME... 5 | GUESS A FIVE LETTER WORD? THERE WERE 1 MATCHES AND THE COMMON LETTERS WERE...K 6 | FROM THE EXACT LETTER MATCHES, YOU KNOW................---K- 7 | 8 | IF YOU GIVE UP, TYPE '?' FOR YOUR NEXT GUESS. 9 | 10 | GUESS A FIVE LETTER WORD? THERE WERE 5 MATCHES AND THE COMMON LETTERS WERE...DINKY 11 | FROM THE EXACT LETTER MATCHES, YOU KNOW................DINKY 12 | YOU HAVE GUESSED THE WORD. IT TOOK 2 GUESSES! 13 | 14 | WANT TO PLAY AGAIN? -------------------------------------------------------------------------------- /examples/99testsBasic2/55valtest.bas: -------------------------------------------------------------------------------- 1 | 10 A$="1234567890" 2 | 20 FOR I=1 TO 10 3 | 30 PRINT A$(I),LEN(A$(I)),VAL(A$(I)),@V,@S 4 | 40 T$=MID$(A$,I) 5 | 50 PRINT T$,LEN(T$),VAL(T$),@V,@S 6 | 60 NEXT 7 | -------------------------------------------------------------------------------- /examples/99testsBasic2/55valtest.bas.res: -------------------------------------------------------------------------------- 1 | 1234567890 10 1.23456E9 10 0 2 | 1234567890 10 1.23456E9 10 0 3 | 234567890 9 2.34567E8 9 0 4 | 234567890 9 2.34567E8 9 0 5 | 34567890 8 3.45678E7 8 0 6 | 34567890 8 3.45678E7 8 0 7 | 4567890 7 4567890 7 0 8 | 4567890 7 4567890 7 0 9 | 567890 6 567890 6 0 10 | 567890 6 567890 6 0 11 | 67890 5 67890 5 0 12 | 67890 5 67890 5 0 13 | 7890 4 7890 4 0 14 | 7890 4 7890 4 0 15 | 890 3 890 3 0 16 | 890 3 890 3 0 17 | 90 2 90 2 0 18 | 90 2 90 2 0 19 | 0 1 0 1 0 20 | 0 1 0 1 0 21 | -------------------------------------------------------------------------------- /examples/99testsBasic2/56tinybasic.bas.inp: -------------------------------------------------------------------------------- 1 | 10 print "hello" 2 | 20 input a 3 | 25 if a=0 stop 4 | 30 for i=1 to a 5 | 40 print i, " ", i*i 6 | 50 next 7 | list 8 | run 9 | 5 10 | # 11 | 12 | -------------------------------------------------------------------------------- /examples/99testsBasic2/56tinybasic.bas.res: -------------------------------------------------------------------------------- 1 | ]]]]]]]10 print "hello" 2 | 20 input a 3 | 25 if a=0 stop 4 | 30 for i=1 to a 5 | 40 print i, " ", i*i 6 | 50 next 7 | ]hello 8 | ? 1 1 9 | 2 4 10 | 3 9 11 | 4 16 12 | 5 25 13 | ] -------------------------------------------------------------------------------- /examples/99testsBasic2/57multifunc.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Function multiline definitions" 2 | 20 REM "" 3 | 100 DEF FNS(X)=X*X 4 | 110 DEF FNT(X) 5 | 120 RETURN X*X*X 6 | 130 FEND 7 | 140 DEF FNQ(X) 8 | 150 RETURN FNS(X)*X 9 | 160 FEND 10 | 170 DEF FNR(X) 11 | 180 PRINT FNQ(X) 12 | 190 FEND 13 | 200 READ N 14 | 210 PRINT "The square of",N," is: "; FNS(N) 15 | 220 PRINT "X is",X 16 | 230 PRINT "The cube of",N," is: "; FNT(N) 17 | 240 PRINT "This can be done like this as well: "; FNQ(N) 18 | 250 PRINT "Or even like this: ";: FNR(N) 19 | 300 REM "Odd stuff" 20 | 310 PRINT "Prints ";: A=FNR(): PRINT "Returns: ",A 21 | 320 FNQ(9): FNS(11): FNT(13) 22 | 500 DATA 10 23 | -------------------------------------------------------------------------------- /examples/99testsBasic2/57multifunc.bas.res: -------------------------------------------------------------------------------- 1 | The square of 10 is: 100 2 | X is 0 3 | The cube of 10 is: 1000 4 | This can be done like this as well: 1000 5 | Or even like this: 1000 6 | Prints 0 7 | Returns: 0 8 | -------------------------------------------------------------------------------- /examples/99testsBasic2/58longnames.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Long names test program" 2 | 100 alpha=10 3 | 110 a=19 4 | 120 print a, "is not", alpha 5 | 200 name$="stefan" 6 | 210 na$="steve" 7 | 220 print name$, "is not", na$ 8 | 300 dim squares(10) 9 | 310 for number=1 to 10: squares(number)=number*number: next 10 | 320 for number=1 to 10 11 | 330 print number, squares(number), "is not", sq(number) 12 | 340 next 13 | 14 | -------------------------------------------------------------------------------- /examples/99testsBasic2/58longnames.bas.res: -------------------------------------------------------------------------------- 1 | 19 is not 10 2 | stefan is not steve 3 | 1 1 is not 0 4 | 2 4 is not 0 5 | 3 9 is not 0 6 | 4 16 is not 0 7 | 5 25 is not 0 8 | 6 36 is not 0 9 | 7 49 is not 0 10 | 8 64 is not 0 11 | 9 81 is not 0 12 | 10 100 is not 0 13 | -------------------------------------------------------------------------------- /examples/99testsBasic2/59trek.bas.inp: -------------------------------------------------------------------------------- 1 | n 2 | s 3 | w 4 | 10 5 | 150 6 | s 7 | t 8 | 180 9 | s 10 | # 11 | 12 | -------------------------------------------------------------------------------- /examples/99testsBasic2/60rantest.bas: -------------------------------------------------------------------------------- 1 | 10 REM "Test the different random number settings" 2 | 100 SET 22,"Microsoft" 3 | 110 PRINT "Microsoft mode" 4 | 120 FOR I=1 TO 10: PRINT RND(8): NEXT 5 | 130 PRINT "**" 6 | 140 PRINT RND(-18) 7 | 150 PRINT "**" 8 | 160 FOR I=1 TO 10: PRINT RND(0): NEXT 9 | 170 PRINT "**" 10 | 180 FOR I=1 TO 10: PRINT RND(1): NEXT 11 | 200 SET 22, "Apple" 12 | 210 PRINT "Apple mode" 13 | 220 FOR I=1 TO 10 14 | 230 PRINT RND(8) 15 | 240 NEXT 16 | 300 SET 22, "PaloAlto" 17 | 310 PRINT "Palo Alto mode" 18 | 320 FOR I=1 TO 10 19 | 330 PRINT RND(8) 20 | 340 NEXT 21 | 22 | -------------------------------------------------------------------------------- /examples/99testsBasic2/60rantest.bas.res: -------------------------------------------------------------------------------- 1 | Microsoft mode 2 | 5.74858E-6 3 | 0.36391 4 | 0.2067 5 | 0.14817 6 | 0.50303 7 | 0.76902 8 | 0.68064 9 | 0.1881 10 | 0.51495 11 | 0.92524 12 | ** 13 | 0.92495 14 | ** 15 | 0.92495 16 | 0.92495 17 | 0.92495 18 | 0.92495 19 | 0.92495 20 | 0.92495 21 | 0.92495 22 | 0.92495 23 | 0.92495 24 | 0.92495 25 | ** 26 | 0.18798 27 | 0.36092 28 | 0.2996 29 | 0.59018 30 | 3.52415E-2 31 | 0.25562 32 | 0.25857 33 | 0.97703 34 | 0.34959 35 | 0.94906 36 | Apple mode 37 | 4.19261 38 | 6.97598 39 | 7.85985 40 | 5.72737 41 | 0.43226 42 | 3.75033E-2 43 | 1.31136 44 | 1.30647 45 | 6.78356 46 | 7.01431 47 | Palo Alto mode 48 | 5 49 | 2 50 | 8 51 | 5 52 | 1 53 | 1 54 | 8 55 | 2 56 | 8 57 | 4 58 | -------------------------------------------------------------------------------- /examples/99testsBasic2/61euler.bas: -------------------------------------------------------------------------------- 1 | 10 REM 'Function to calculate the greatest common divisor (GCD)' 2 | 100 DEF FNG() 3 | 110 WHILE B <> 0 4 | 120 T = B 5 | 130 B = A % B 6 | 140 A = T 7 | 150 WEND 8 | 160 RETURN A 9 | 170 FEND 10 | 200 WHILE -1 11 | 210 READ A,B 12 | 220 IF @S<>0 THEN BREAK 13 | 230 PRINT "The greatest common denominator of",A,"and",B,"is: ";FNG() 14 | 240 WEND 15 | 250 END 16 | 300 DATA 18,27,54,63,128,371,34,85 17 | -------------------------------------------------------------------------------- /examples/99testsBasic2/61euler.bas.res: -------------------------------------------------------------------------------- 1 | The greatest common denominator of 18 and 27 is: 9 2 | The greatest common denominator of 54 and 63 is: 9 3 | The greatest common denominator of 128 and 371 is: 1 4 | The greatest common denominator of 34 and 85 is: 17 5 | -------------------------------------------------------------------------------- /examples/99testsBasic2/testscript: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | BASIC=../../Basic2/Posix/basic 3 | 4 | for file in *.bas 5 | do 6 | if [ -r $file.inp ] 7 | then 8 | $BASIC $file > ${file}.tmp < ${file}.inp 9 | else 10 | $BASIC $file > ${file}.tmp 11 | fi 12 | diff ${file}.tmp ${file}.res > /dev/null 13 | if [ $? -eq 0 ] 14 | then 15 | echo "passed $file" 16 | rm ${file}.tmp 17 | else 18 | echo "failed $file" 19 | fi 20 | done 21 | 22 | rm eeprom.dat 23 | rm daten.txt 24 | -------------------------------------------------------------------------------- /misc/PS2Keyboard.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/misc/PS2Keyboard.zip -------------------------------------------------------------------------------- /misc/PicoSerial-master.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/misc/PicoSerial-master.zip -------------------------------------------------------------------------------- /misc/UTFT.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/misc/UTFT.pdf -------------------------------------------------------------------------------- /test/aled.bas: -------------------------------------------------------------------------------- 1 | 10 PINM 3,192 2 | 20 PINM 4,192 3 | 30 PINM 5,192 4 | 40 AWRITE 3,255 5 | 50 AWRITE 4,255 6 | 60 AWRITE 5,255 7 | 100 FOR I=255 TO 0 STEP -1 8 | 110 AWRITE 3,I 9 | 120 AWRITE 4,I 10 | 130 AWRITE 5,I 11 | 140 DELAY 10 12 | 150 NEXT 13 | -------------------------------------------------------------------------------- /test/bench.bas: -------------------------------------------------------------------------------- 1 | 10 T=MILLIS(1): FOR I=1 TO 10000000: A=5: NEXT: T=MILLIS(1)-T 2 | 20 S=MILLIS(1): FOR I=1 TO 10000000: NEXT: S=MILLIS(1)-S 3 | 30 U=MILLIS(1): FOR I=1 TO 10000000: : NEXT: U=MILLIS(1)-U 4 | 35 PRINT "Times in 0.1 micro seconds units" 5 | 40 PRINT "Token time:",U-S 6 | 50 PRINT "Assigment time:",T-S-(U-S)*4, T-S 7 | 60 PRINT "Loop time:",S 8 | -------------------------------------------------------------------------------- /test/bench.txt: -------------------------------------------------------------------------------- 1 | LGT with float 2 | 3 | Token time: 74 4 | Assigment time: 66 362 5 | Loop time: 259 6 | 7 | LGT without float 8 | 9 | Token time: 62 10 | Assigment time: 7 255 11 | Loop time: 151 12 | 13 | XMC with float (BASICFULL) 14 | 15 | Token time: 103 16 | Assigment time: 257 669 17 | Loop time: 431 18 | 19 | XMC with float (BASICTINYWITHFLOAT) 20 | 21 | Token time: 103 22 | Assigment time: 256 668 23 | Loop time: 431 24 | 25 | XMC without float (BASICMINIMAL) 26 | 27 | Token time: 90 28 | Assigment time: 243 603 29 | Loop time: 283 30 | 31 | UNO without float 32 | 33 | Token time: 192 34 | Assigment time: 107 875 35 | Loop time: 434 36 | 37 | ESP32 with float (No network function) 38 | 39 | Token time: 174 40 | Assigment time: -303 393 41 | Loop time: 189 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /test/bench2.bas: -------------------------------------------------------------------------------- 1 | 10 T=MILLIS(1): FOR I=1 TO 10000: A=5: NEXT: T=MILLIS(1)-T 2 | 20 S=MILLIS(1): FOR I=1 TO 10000: A=5*6: NEXT: S=MILLIS(1)-S 3 | 30 U=MILLIS(1): FOR I=1 TO 10000: : NEXT: U=MILLIS(1)-U 4 | 40 V=MILLIS(1): FOR I=1 TO 10000: NEXT: V=MILLIS(1)-V 5 | 50 PRINT "Loop time", V/10 6 | 60 PRINT "Token time", (U-V)/10 7 | 70 PRINT "Assignment time", (T-U)/10 8 | 80 PRINT "Multiplication time", (S-T)/10 9 | -------------------------------------------------------------------------------- /test/tread1.bas: -------------------------------------------------------------------------------- 1 | 10 READ A 2 | 20 PRINT A 3 | 30 READ B,C 4 | 40 PRINT B,C 5 | 50 READ A(1),A(2),A(3) 6 | 100 DATA 1,2,3,4,5 7 | -------------------------------------------------------------------------------- /utility/arduinoterm: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | python3 /Users/stefan/Documents/Technology/tinybasic/monitor.py 3 | python3 /Users/stefan/Documents/Technology/tinybasic/utility/monitor.py 4 | -------------------------------------------------------------------------------- /utility/dosify: -------------------------------------------------------------------------------- 1 | cat $1 | sed 's/\/\/.*$//g' | perl -pe 's/\r\n|\n|\r/\r\n/g' | sed 's/^#undef.*MSDOS/#define MSDOS/' 2 | -------------------------------------------------------------------------------- /utility/tc201.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slviajero/tinybasic/b75ea160583a48c78ff181c4caf37053f5ef0684/utility/tc201.zip --------------------------------------------------------------------------------