ZYXBasic+

From Esolang
Jump to navigation Jump to search

ZYXBasic+ is a sequel to ZYXBasic made by user:Marcel364. This new version adds colour and sound support, makes things easier to program, and just like the other one, is made on Scratch. Some say this is on the borderline of not being an esolang.

Commands

The original commands can be found here.

New Commands

16 new commands have been added. Text in bold is the command, AA and BB are variables, NUM is a number.

Command Pseudonym What it does
mulAANUM MULtiply Multiplies AA by NUM
mlvAABB MuLtiply Variables Multiplies AA by BB
divAANUM DIVide Divides AA by NUM
dvvAABB DiVide Variables Divides AA by BB
modAANUM MODulo Modulos AA by NUM
mdvAABB MoDulo Variables Modulos AA by BB
colNUMNUM COLour Changes the foreground and background colour indices respectively (see below)
clvAABB CoLour Variables Changes the foreground colour index to AA and the background colour to index BB
sndNUM SouND Plays a square wave with pitch NUM (-360 [-3 octaves] – 360 [+3 octaves])
sdvAA SounD Variable Plays a square wave with the pitch set to AA
sds SounD Stop Stops the sound currently playing
sinAA SINe Performs a sine (in degrees from -1 to 1) calculation to AA
cosAA COSine Performs a cosine calculation to AA
tanAA TANgent Performs a tangent calculation to AA
rndAA RouND Rounds AA
rngAANUM Random Number Generation Generates a random number from 0 to NUM and puts it into AA

Colour Palette

Here is the full colour palette (colours may not be exact due to the brightness block being inexact) Note: it only checks for the last 2 digits, as the indices are moduloed by 100.

Index Hex code
0 Default
1

#000000

2

#202020

3

#404040

4

#606060

5

#808080

6

#A0A0A0

7

#C0C0C0

8

#E0E0E0

9

#FFFFFF

10

#400000

11

#800000

12

#C00000

13

#FF0000

14

#FF4040

15

#FF8080

16

#FFC0C0

17

#402000

18

#804000

19

#C06000

20

#FF8000

21

#FFA040

22

#FFC080

23

#FFE0C0

24

#404000

25

#808000

26

#C0C000

27

#FFFF00

28

#FFFF40

29

#FFFF80

30

#FFFFC0

31

#204000

32

#408000

33

#60C000

34

#80FF00

35

#A0FF40

36

#C0FF80

37

#E0FFC0

38

#004000

39

#008000

40

#00C000

41

#00FF00

42

#40FF40

43

#80FF80

44

#C0FFC0

45

#004020

46

#008040

47

#00C060

48

#00FF80

49

#40FFA0

50

#80FFC0

51

#C0FFE0

52

#004040

53

#008080

54

#00C0C0

55

#00FFFF

56

#40FFFF

57

#80FFFF

58

#C0FFFF

59

#002040

60

#004080

61

#0060C0

62

#0080FF

63

#40A0FF

64

#80C0FF

65

#C0E0FF

66

#000040

67

#000080

68

#0000C0

69

#0000FF

70

#4040FF

71

#8080FF

72

#C0C0FF

73

#200040

74

#400080

75

#6000C0

76

#8000FF

77

#A040FF

78

#C080FF

79

#E0C0FF

80

#400040

81

#800080

82

#C000C0

83

#FF00FF

84

#FF40FF

85

#FF80FF

86

#FFC0FF

87

#400020

88

#800040

89

#C00060

90

#FF0080

91

#FF40A0

92

#FF80C0

93

#FFC0E0

94 User-defined
95 User-defined
96 User-defined
97 User-defined
98 User-defined
99 User-defined

Example Code

This code will generate a rainbow circle that makes an oscillating sound.

cng011
str020
cgv0201
sin02
mul0220
cng0239
str030
cgv0301
cos03
mul0315
cng0321.5
mvv0203
clv0001
prt 
sdv02
gto1

External Resources

ZYXBasic+ interpreter

Footnote

User:Aadenboy, if you're reading this, come make some improvements to this page as well! ;) (remove when done)