-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathtry.html
More file actions
29 lines (24 loc) · 695 Bytes
/
try.html
File metadata and controls
29 lines (24 loc) · 695 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<!doctype html>
<title>glua playground</title>
<center>open your console for all the action.</center>
<center><a href="https://github.com/fiatjaf/glua">back to GitHub</a></center>
<br>
<br>
<center>a simple example you can run now (copy and paste in the console):</center>
<pre style="max-width: 400px; margin: auto">
<code>
var state = {count: 18}
glua.runWithGlobals({
increase: function (n) { state.count += n },
state: state
}, `
print('initial value: ', state.count)
increase(5) -- increasing by 5
`)
console.log('now the value is:', state.count)
</code>
</pre>
<script src=dist/glua.min.js></script>
<script>
console.log('use the global `glua` for all the action.')
</script>