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 Index Hex code Index Hex code Index Hex code Index Hex code
0 Default 20

#FF8000

40

#00C000

60

#004080

80

#400040

1

#000000

21

#FFA040

41

#00FF00

61

#0060C0

81

#800080

2

#202020

22

#FFC080

42

#40FF40

62

#0080FF

82

#C000C0

3

#404040

23

#FFE0C0

43

#80FF80

63

#40A0FF

83

#FF00FF

4

#606060

24

#404000

44

#C0FFC0

64

#80C0FF

84

#FF40FF

5

#808080

25

#808000

45

#004020

65

#C0E0FF

85

#FF80FF

6

#A0A0A0

26

#C0C000

46

#008040

66

#000040

86

#FFC0FF

7

#C0C0C0

27

#FFFF00

47

#00C060

67

#000080

87

#400020

8

#E0E0E0

28

#FFFF40

48

#00FF80

68

#0000C0

88

#800040

9

#FFFFFF

29

#FFFF80

49

#40FFA0

69

#0000FF

89

#C00060

10

#400000

30

#FFFFC0

50

#80FFC0

70

#4040FF

90

#FF0080

11

#800000

31

#204000

51

#C0FFE0

71

#8080FF

91

#FF40A0

12

#C00000

32

#408000

52

#004040

72

#C0C0FF

92

#FF80C0

13

#FF0000

33

#60C000

53

#008080

73

#200040

93

#FFC0E0

14

#FF4040

34

#80FF00

54

#00C0C0

74

#400080

94 User-defined
15

#FF8080

35

#A0FF40

55

#00FFFF

75

#6000C0

95 User-defined
16

#FFC0C0

36

#C0FF80

56

#40FFFF

76

#8000FF

96 User-defined
17

#402000

37

#E0FFC0

57

#80FFFF

77

#A040FF

97 User-defined
18

#804000

38

#004000

58

#C0FFFF

78

#C080FF

98 User-defined
19

#C06000

39

#008000

59

#002040

79

#E0C0FF

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