Code Snippets BASIC

Short texts BASIC 🧑‍💻 Code snippets BASIC ✍️ Reading lists BASIC 👀

QBasic Gorillas

‘ Q B a s i c G o r i l l a s ‘ ‘ Copyright (C) IBM Corporation 1991 ‘ ‘ Your mission is to hit your opponent with the exploding banana ‘ by varying the angle and power of your throw, taking into account ‘ wind speed, gravity, and the city […]

QBASIC Code for a simple calculator program

CLS SCREEN 13 PRINT “CALCULATOR-” PRINT “ENTER YOUR EXPRESSION” PRINT “EXAMPLE-58 * 20” PRINT “THE TERMS SHOULD BE SEPARATED BY SPACE OR ERROR WILL OCCUR” INPUT “ENTER YOUR EXPRESSION-“; EXP$ EXP$ = EXP$ + ” ” INDEX = 1 DIM TERMS(3) AS INTEGER FOR I = 1 TO LEN(EXP$) CURRENTTOKEN$ = MID$(EXP$, I, 1) IF […]

autoexec.bas

## INSTRUCTION 1. open on [MSXPen](http://msxpen.com/?gist=e7cf8a58bb345f6d4aeefb7c46ebc9b9) 2. show in fullscreen 3. wait patiently the completion of circle(*) 4. press any key when you want to reset the line (*) the execution can be accelerated by holding down the F12 key. The work was created with a Philips VG-8235 (“MSX2 Europe” on the emulator). 100 SCREEN […]

Generate List of Equal Area Partitioning of a Square into 7 Rectangles

VERSION 1.0 CLASS BEGIN MultiUse = -1 ‘True END Attribute VB_Name = “Pieces” Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = False Attribute VB_Exposed = False Option Explicit Private x1_(1 To 7) As Double ‘ left Private y1_(1 To 7) As Double ‘ bottom Private x2_(1 To 7) As Double ‘ right […]

A QB64 roguelike in 50 lines

NewGame: SCREEN 0: RANDOMIZE TIMER: WIDTH 80, 60: HP = 100: XP = 0: Level = 1: _FULLSCREEN NewLevel: CLS: NewCave = 0: Col = 40: Row = 30: TYPE MonDef: X AS INTEGER: Y AS INTEGER: END TYPE: DIM Monsters(15) AS MonDef: DIM SHARED K$ FOR X = 2 TO 79: FOR Y = […]