Skip to content

Commit 14989b4

Browse files
fix: Readme being updated early
1 parent 26e2bc4 commit 14989b4

File tree

1 file changed

+50
-88
lines changed

1 file changed

+50
-88
lines changed

README.md

Lines changed: 50 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ It is up to you to discover most of the language through the progression system.
5151
However, every good README needs a hello world.
5252

5353
```ruby
54-
print("Hello, World!")
54+
print "Hello, World!"
5555
```
5656
This can be written into a book, and right-clicked into a Copper Golem. right-click again to run.
5757
<br />
@@ -73,14 +73,14 @@ You can join our discord server [here](https://discord.gg/2eR2hdYJMc).
7373
## Oxidisation and progression
7474
After a certain number of instruction executions, the golem will begin to oxidise.
7575
Interacting with the golem while holding an axe removes the rust.\
76-
If the golem is fully oxidised, it will not run anymore, but upon scraping it with an axe you will find example programs that explain the language of GolemScript.
76+
If the golem is fully oxidised, it will not run anymore, but upon scraping it with an axe you will find example programs that explain the language of GolemScript.\
7777
This process can be avoided however, by waxing the golem. As with anything copper, you can also scrape off the wax.
7878

7979

8080
## GolemScript Documentation
8181
The following (excellent) language documentation was written by xokz, from the MinecraftCommands discord.
8282

83-
By: xokz (Edited by RevolvingMadness)
83+
By: xokz
8484

8585
Code goes in a book and quill. Code can span multiple pages, but make sure there is a new line after every page!. The name of the book does not matter.
8686
Right click the minecart with the book to set the golems code, and right-click the minecart with a empty hand to execute the code.
@@ -90,7 +90,7 @@ Comments are indicated with a '#' and last until the end of the line. There are
9090

9191
EX.
9292
```ruby
93-
# This will not do anything since it is a comment
93+
# this will not do anything since it is a comment
9494
```
9595

9696
## 2. Variables
@@ -107,70 +107,55 @@ let str = "Hello"
107107
let x = 1
108108
let arr = [9, 2, -3, 6]
109109
let var = ["hello", "world"]
110-
# 'fizz' is now 8
111-
let fizz = foo + x
112-
# 'buzz' is now 'world'
113-
let buzz = var[x]
114-
# 'bar' is now 4
115-
let bar = var[2] + 7
110+
let fizz = foo + x # this will be 8
111+
let buzz = var[x] # this will be 'world'
112+
let bar = var[2] + 7 # this will be 4
116113
let obj = {a:1,b:2+3}
117114
```
118115

119116
Variables can be changed by simply redeclaring them.
120117

121118
EX.
122119
```ruby
123-
# 'foo' is now 7
124120
let foo = 7
125-
# 'foo' is now 8 instead of 7
126-
let foo = 8
121+
let foo = 8 # foo is now 8 instead of 7
127122
```
128123

129124
Arrays can be added and removed from via addition and subtraction.
130125

131126
EX.
132127
```ruby
133128
let arr = [0, 1, 2]
134-
# 'arr' is now [0, 1, 2]
135-
let arr = arr + 3
136-
# 'arr' is now [0, 1, 2, 3]
137-
let arr = arr - 1
138-
# 'arr' is now [0, 1, 2]
139-
let arr = arr - -1
140-
# 'arr' is now [1, 2]
129+
let arr = arr + 3 # arr is now [0,1,2,3]
130+
let arr = arr - 1 # arr is now [0,1,2]
131+
let arr = arr - -1 # arr is now [1,2]
141132
```
142133

143134
Objects can be added and removed from via addition and subtraction.
144135

145136
EX.
146137
```ruby
147138
let obj = {a:1,b:2,c:3}
148-
# 'obj' is now {a:1,b:2,c:3}
149-
let obj = obj - "a"
150-
# 'obj' is now {b:2,c:3}
151-
let obj = obj + {c:5,d:4}
152-
# 'obj' is now {b:2,c:5,d:4}
139+
let obj = obj - "a" # obj is now {b:2,c:3}
140+
let obj = obj + {c:5,d:4} # obj is now {b:2,c:5,d:4}
153141
```
154142

155143
Strings can be added to with addition.
156144

157145
EX.
158146
```ruby
159147
let str = "hello"
160-
print(str)
161-
# This will print 'hello'
148+
print str # this will print 'hello'
162149
let var = str + ", world!"
163-
print(var)
164-
# This will print 'hello, world!'
150+
print var # this will print 'hello, world!'
165151
```
166152

167153
Strings are just arrays of characters, so they can be indexed just like an array.
168154

169155
EX.
170156
```ruby
171157
let str = "hello, world!"
172-
print(str[1])
173-
# This will print 'e'
158+
print str[1] # this will print 'e'
174159
```
175160

176161
## 3. Printing
@@ -184,20 +169,13 @@ let bar = "xokz"
184169
let arr = [0, 4, 7]
185170
let obj = {hello:"world"}
186171

187-
print("Hello, world!")
188-
# This will print 'Hello, world!'
189-
print(foo)
190-
# This will print 8
191-
print(name)
192-
# This will print 'xokz'
193-
print(arr)
194-
# This will print '[0, 4, 7]'
195-
print(arr[1])
196-
# This will print 4
197-
print(arr[1] + foo)
198-
# This will print 12
199-
print(obj["hello"])
200-
# This will print 'world'
172+
print "Hello, world!" # this will print 'Hello, world!'
173+
print foo # this will print 8
174+
print name # this will print 'xokz'
175+
print arr # this will print '[0, 4, 7]'
176+
print arr[1] # this will print 4
177+
print arr[1] + foo # this will print 12
178+
print obj["hello"] # this will print 'world'
201179
```
202180

203181
## 4. Sleep
@@ -208,10 +186,8 @@ The provided value is how many ticks the golem will sleep for.
208186
EX.
209187
```ruby
210188
let time = 7
211-
# Sleep for 7 ticks
212-
sleep time
213-
# Sleep for 2 seconds, since 1 second is 20 ticks
214-
sleep 40
189+
sleep time # sleep for 7 ticks
190+
sleep 40 # sleep for 2 seconds, since 1 second is 20 ticks
215191
```
216192

217193
## 5. If Statements
@@ -223,26 +199,22 @@ EX.
223199
```ruby
224200
let foo = 0
225201
if foo
226-
print("success!")
227-
# This will not print since the condition results in 0
202+
print "success!" # this will not print since the condition results in 0
228203
end
229204

230205
let foo = 5
231206
if foo
232-
print("success!")
233-
# This will print because the condition did not result in 0
207+
print "success!" # this will print because the condition did not result in 0
234208
end
235209

236210
let bar = ""
237211
if bar
238-
print("success!")
239-
# This will not print since the condition results in an empty string
212+
print "success!" # this will not print since the condition results in an empty string
240213
end
241214

242215
let bar = "i love this datapack"
243216
if bar
244-
print("success!")
245-
# This will print since the condition did not result in an empty string
217+
print "success!" # this will print since the condition did not result in an empty string
246218
end
247219
```
248220

@@ -256,15 +228,13 @@ let foo = 7
256228
let bar = 5
257229

258230
if foo > bar
259-
print("success")
260-
# This will print since foo is greater than bar
231+
print "success" # this will print since foo is greater than bar
261232
end
262233

263234
let var = "hello, world"
264235

265236
if var = "goodbye, world"
266-
print("success")
267-
# This will not print since var is not "goodbye, world"
237+
print "success" # this will not print since var is not "goodbye, world"
268238
end
269239
```
270240

@@ -273,9 +243,8 @@ Strings and arrays have lengths, which can be compared against integers.
273243
EX.
274244
```ruby
275245
let str = "hello"
276-
# This will execute because the str of is less than ten
277246
if str < 10
278-
print("Success!")
247+
print "The length of the string is less than 10!"
279248
end
280249
```
281250

@@ -288,25 +257,24 @@ They execute while a condition is met.
288257

289258
EX.
290259
```ruby
260+
# this will print the numbers 0-19
291261
let i = 0
292-
# This will print the numbers 0-19
293262
while i < 20
294-
print(i)
263+
print i
295264
let i = i + 1
296265
end
297266

298-
# This will run forever
267+
# this will go on forever
299268
while 1
300-
print("wheee!")
269+
print "wheee!"
301270
end
302271
```
303272

304-
`N` loops execute a set number of times.
273+
N loops execute a set number of times.
305274

306275
```ruby
307-
# This will execute 10 times
308276
loop 10
309-
print("Loop")
277+
print "This will print 10 times"
310278
end
311279
```
312280

@@ -318,8 +286,7 @@ The array can use variables or literals.
318286
EX.
319287
```ruby
320288
let var = 1
321-
move(0, var, 0)
322-
# The golem will jump up one block
289+
move [0, var, 0] # the golem will jump up one block
323290
```
324291

325292
## 8. Getblock
@@ -330,14 +297,11 @@ EX.
330297
```ruby
331298
let best_block = "minecraft:dirt"
332299

333-
getblock(0, -1, 0)
334-
# The block under the golem is a dirt block in this example
335-
print(BLOCK)
336-
# This will print 'minecraft:dirt'
300+
getblock [0, -1, 0] # the block under the golem is a dirt block in this example
301+
print BLOCK # will print 'minecraft:dirt'
337302

338-
# This will execute because the block below is dirt
339303
if BLOCK = best_block
340-
print("Yes, dirt is the best.")
304+
print "Yes, dirt is the best." # this will print because the block below is dirt
341305
end
342306
```
343307

@@ -349,10 +313,10 @@ The slot number is 0 indexed.
349313

350314
EX.
351315
```ruby
352-
# In slot 6, we have put a dirt block.
316+
# in slot 6, we have put a dirt block.
353317

354-
place(5, [1, 0, 1])
355-
# This will place a dirt block diagonally to the
318+
place 5, [1,0,1]
319+
# this will place a dirt block diagonally to the
356320
# golem, provided there is not already a block there
357321
```
358322

@@ -361,10 +325,9 @@ The pickaxe will still lose durability.
361325

362326
EX.
363327
```ruby
364-
# In slot 7, we have an iron pickaxe.
328+
# in slot 7, we have an iron pickaxe.
365329

366-
# This will mine the dirt block we placed earlier and take it back into the inventory.
367-
place(6, [1, 0, 1])
330+
place 6, [1,0,1] # this will mine the dirt block we placed earlier and take it back into the inventory.
368331
```
369332

370333
If there is nothing in the slot, then nothing will happen.
@@ -376,9 +339,9 @@ It can be indexed like any other array.
376339

377340
EX.
378341
```ruby
379-
# If there is dirt in the first slot, print a message.
342+
# if there is dirt in the first slot, print a message.
380343
if INVENTORY[0] = "minecraft:dirt"
381-
print("yeah you got the good stuff")
344+
print "yeah you got the good stuff"
382345
end
383346
```
384347

@@ -392,6 +355,5 @@ EX.
392355
```ruby
393356
let regex = /ab?c/
394357
match regex, "abcdefg"
395-
# This prints 'abc'
396-
print(MATCH)
358+
print MATCH # prints "abc"
397359
```

0 commit comments

Comments
 (0)