Fusion-BASIC logo

Fusion-BASIC Documentation

Introduction

Welcome to the Fusion-BASIC documentation. Fusion-BASIC is a new programming language designed to simplify coding with a focus on ease of use and readability.

Fusion-BASIC takes inspiration from Python and BASIC to make switching easier.

Installation

To install Fusion-BASIC, follow these steps:

  1. Download the Fusion-BASIC zip file.
  2. Copy and paste a files into where you will put your scripts.
  3. You can run scripts by running RUN("scriptname.fbasic") in the shell.

Syntax

Fusion-BASIC has a simple and intuitive syntax. Here are some basic functions:

Examples

Here are some examples to get you started:


# Hello World in Fusion-BASIC
VAR message = "Hello, World!"
PRINT(message)
            

# Variables in Fusion-BASIC
PRINT("what is your name?")
VAR name = INPUT()
PRINT("what is your age?")
VAR age = INPUT_INT()
PRINT("Name:")
PRINT(name)
PRINT("Age:")
PRINT(age)
PRINT("End of script...")
            

# This is a script written by David Callanan
# this script adds 'oop' at the end of every word! feel free to customize this.

FUN oopify(prefix) -> prefix + "oop"

FUN join(elements, separator)
	VAR result = ""
	VAR len = LEN(elements)

	FOR i = 0 TO len THEN
		VAR result = result + elements/i
		IF i != len - 1 THEN VAR result = result + separator
	END

	RETURN result
END

FUN map(elements, func)
	VAR new_elements = []

	FOR i = 0 TO LEN(elements) THEN
		APPEND(new_elements, func(elements/i))
	END

	RETURN new_elements
END

PRINT("Greetings universe!")

FOR i = 0 TO 5 THEN
	PRINT(join(map(["l", "h"], oopify), ", "))
END