We are currently working on new rules for what content should and shouldn't be allowed on this website, and are looking for feedback! See Esolang:2026 topicality proposal to view and give feedback on the current draft.

SWING

From Esolang
Jump to navigation Jump to search

SWING is an esoteric programming language created by Alan Kubiak, written in DPL.

Characteristics

The SWING programming language works using numerical values only.

OPCodes

ADD: 120
MINUS: 140
MULTIPLY: 160
DIVIDE: 180
MODULO: 200
EQUAL TO: 220
SMALLER THAN: 240
BIGGER THAN: 260
NOT EQUAL TO: 280
END: 500
UNCONDITIONAL JUMP: 700
PUSH VALUE: 300
PRINT: 800
CALCULATION: 900
INPUT: 400
RANDOM: 600
SLEEP: 50
IF: 10
END IF: 20
PAUSE: 30
REMARK: 0

SWING Virtual Machine

The SWING virtual machine interprets the OPCodes and the arguments line by line.

Examples

Remark

0
 This is a remark. It is not interpreted by the virtual machine.

Hello, World!

0
 SWING @ Hello, World
300
 1 
 50
300
 2 
 50
10
 1 
220
 2
300
 1 
 72
300
 2 
 101
300
 3 
 108
300
 4 
 108
300
 5 
 111
800
 1
800
 2
800
 3
800
 4
800
 5
300
 1 
 44
300
 2 
 32
300
 3 
 87
300
 4 
 111
300
 5 
 114
800
 1
800
 2
800
 3
800
 4
800
 5
300
 1 
 108
300
 2 
 100
300
 3 
 33
800
 1
800
 2
800
 3
20
500

Counting program

0
 SWING @ Counting Program
300
 1 
 0
300
 2 
 1
400
 3
300
 4 
 777
900
 1 
120
 2 
 1
800
 1
10
 1 
220
 3
300
 1 
 0
700
 33
20
700
 14
800
 4
500

Devine game

0
 SWING @ Devine Random Value
600
 5 
 100
400
 4
0
 FOUND
10
 4 
220
 5
800
 777
300
 3 
 50
20
0
 TOO SMALL
10
 4 
240
 5
800
 300
20
0
 TOO BIG
10
 4 
260
 5
800
 400
20
0
 CHECK FOUND
10
 3 
280
 50
700
 6
20
500

External resources