jdBasic Try Live

Beginner Guide

Learn BASIC Programming
step-by-step with jdBasic

Start coding instantly in your browser with the jdBasic online REPL. This page teaches the essentials: variables, loops, conditions, arrays, and simple projects.

No installation

Use the browser REPL to run BASIC immediately.

Beginner-friendly

Short lessons with copy/paste examples.

Project-focused

Build small programs you can expand.

Quick Start (2 minutes)

Open the REPL, paste the code, and hit Run.

Hello World

' Hello, World!
PRINT "Hello from jdBasic!"
PRINT "Type your name:"
INPUT "Name: "; name$
PRINT "Nice to meet you, "; name$

Tip: Strings often use $ (like name$) in classic BASIC style.

Lessons (Basics You’ll Actually Use)

Lesson 1: Variables + Printing

Store values and show output.

' Numbers
age = 21
score = 10 + 5

' Strings
name$ = "Ada"

PRINT "Name: "; name$
PRINT "Age: "; age
PRINT "Score: "; score
  • Numbers are stored like age = 21
  • Strings often use $ (e.g., name$)
  • Use PRINT to output. Semicolons combine parts on one line.

Lesson 2: Conditions (IF / ELSE)

Make decisions in your program.

INPUT "Enter a number: "; n

IF n > 10 THEN
  PRINT "Big number"
ELSEIF n > 0 THEN
  PRINT "Positive"
ELSE
  PRINT "Zero or negative"
ENDIF

Use conditions to branch logic:

  • IF ... THEN runs a block when true
  • ELSEIF checks another condition
  • ELSE is the fallback

Lesson 3: Loops (FOR / NEXT)

Repeat work efficiently.

' Count from 1 to 5
FOR i = 1 TO 5
  PRINT "i = "; i
NEXT i

' Sum numbers 1..100
sum = 0
FOR i = 1 TO 100
  sum = sum + i
NEXT i
PRINT "Sum = "; sum

Loops are ideal for:

  • Counting and generating sequences
  • Accumulating totals
  • Processing arrays

Lesson 4: Arrays (Lists) + Simple Processing

Store multiple values and compute results.

nums = [10, 20, 30, 40, 50]

' Multiply all values (array math)
nums = nums * 2 + 5
PRINT nums

' Find max via loop (classic style)
maxv = nums[0]
FOR i = 0 TO LEN(nums) - 1
  IF nums[i] > maxv THEN maxv = nums[i]
NEXT i
PRINT "Max = "; maxv

Two approaches:

  • Array math for concise operations
  • Loops for classic step-by-step logic

Mini Project: Number Guessing Game

Practice input, conditions, and loops.

' Number Guessing Game
' (Assumes a random function is available in your environment.)
target = INT(RND() * 100) + 1
tries = 0

PRINT "Guess a number from 1 to 100."

DO
  INPUT "Your guess: "; g
  tries = tries + 1

  IF g < target THEN
    PRINT "Too low!"
  ELSEIF g > target THEN
    PRINT "Too high!"
  ELSE
    PRINT "Correct! Tries: "; tries
  ENDIF
LOOP UNTIL g = target

If your REPL uses a different random function, just swap the target line. (This is a template you can adapt.)

Next Steps

Recommended Pages (Create Next)

  • /basic-examples — copy/paste examples
  • /basic-games — small game tutorials
  • /basic-vs-python — comparison article (great SEO)

Internal links between these pages will help Google understand your site structure.

FAQ

Can I learn BASIC without installing anything?

Yes — use the jdBasic online REPL to run code in your browser.

Is jdBasic good for beginners?

Yes. BASIC is easy to read, and jdBasic adds modern features while keeping the learning curve gentle.

Where is the documentation?

Start with the Manual and the Language Reference.

What should I build first?

Try the number guessing game above, then build a small text adventure or a simple 2D demo.