about summary refs log tree commit diff stats
path: root/html/edit.mu.html
blob: 8251e997e0418e9da50162ddae8286c8285add36 (plain) (blame)
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Mu - edit.mu</title>
<meta name="Generator" content="Vim/7.4">
<meta name="plugin-version" content="vim7.4_v1">
<meta name="syntax" content="none">
<meta name="settings" content="use_css,pre_wrap,no_foldcolumn,expand_tabs,prevent_copy=">
<meta name="colorscheme" content="minimal">
<style type="text/css">
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; }
body { font-family: monospace; color: #eeeeee; background-color: #080808; }
* { font-size: 1em; }
.Delimiter { color: #c000c0; }
.Comment { color: #8080ff; }
.Constant { color: #008080; }
.Special { color: #ff6060; }
.Identifier { color: #008080; }
.muRecipe { color: #ff8700; }
.CommentedCode { color: #6c6c6c; }
-->
</style>

<script type='text/javascript'>
<!--

-->
</script>
</head>
<body>
<pre id='vimCodeElement'>
<span class="muRecipe">recipe</span> main [
  <span class="Identifier">default-space</span>:address:array:location<span class="Special"> &lt;- </span>new location:type, <span class="Constant">30:literal</span>
  switch-to-display
  draw-bounding-box <span class="Constant">0:literal/screen</span>, <span class="Constant">5:literal</span>, <span class="Constant">5:literal</span>, <span class="Constant">30:literal</span>, <span class="Constant">45:literal</span>
  wait-for-key-from-keyboard
  return-to-console
]

<span class="muRecipe">recipe</span> draw-bounding-box [
  <span class="Identifier">default-space</span>:address:array:location<span class="Special"> &lt;- </span>new location:type, <span class="Constant">30:literal</span>
  screen:address<span class="Special"> &lt;- </span><span class="Identifier">next-ingredient</span>
  <span class="Comment"># sanity-check the box bounds</span>
  top:number<span class="Special"> &lt;- </span><span class="Identifier">next-ingredient</span>
  <span class="Delimiter">{</span>
    out?:boolean<span class="Special"> &lt;- </span>lesser-than top:number, <span class="Constant">0:literal</span>
    <span class="Identifier">break-unless</span> out?:boolean
    top:number<span class="Special"> &lt;- </span>copy <span class="Constant">0:literal</span>
  <span class="Delimiter">}</span>
  left:number<span class="Special"> &lt;- </span><span class="Identifier">next-ingredient</span>
  <span class="Delimiter">{</span>
    out?:boolean<span class="Special"> &lt;- </span>lesser-than left:number, <span class="Constant">0:literal</span>
    <span class="Identifier">break-unless</span> out?:boolean
    left:number<span class="Special"> &lt;- </span>copy <span class="Constant">0:literal</span>
  <span class="Delimiter">}</span>
  bottom:number<span class="Special"> &lt;- </span><span class="Identifier">next-ingredient</span>
  <span class="Delimiter">{</span>
    height:number<span class="Special"> &lt;- </span>screen-height screen:address
    out?:boolean<span class="Special"> &lt;- </span>greater-or-equal bottom:number, height:number
    <span class="Identifier">break-unless</span> out?:boolean
    bottom:number<span class="Special"> &lt;- </span>subtract height:number, <span class="Constant">1:literal</span>
  <span class="Delimiter">}</span>
  right:number<span class="Special"> &lt;- </span><span class="Identifier">next-ingredient</span>
  <span class="Delimiter">{</span>
    width:number<span class="Special"> &lt;- </span>screen-width screen:address
    out?:boolean<span class="Special"> &lt;- </span>greater-or-equal right:number, width:number
    <span class="Identifier">break-unless</span> out?:boolean
    right:number<span class="Special"> &lt;- </span>subtract width:number, <span class="Constant">1:literal</span>
  <span class="Delimiter">}</span>
<span class="CommentedCode">#?   print-integer screen:address, bottom:number</span>
<span class="CommentedCode">#?   print-character screen:address, 32:literal/space</span>
<span class="CommentedCode">#?   print-integer screen:address, right:number</span>
  <span class="Comment"># top border</span>
  move-cursor screen:address, top:number, left:number
  print-character screen:address, <span class="Constant">9484:literal/down-right</span>, <span class="Constant">245:literal/grey</span>
  x:number<span class="Special"> &lt;- </span>add left:number, <span class="Constant">1:literal</span>  <span class="Comment"># exclude corner</span>
  <span class="Delimiter">{</span>
    continue?:boolean<span class="Special"> &lt;- </span>lesser-than x:number, right:number
    <span class="Identifier">break-unless</span> continue?:boolean
    print-character screen:address, <span class="Constant">9472:literal/horizontal</span>, <span class="Constant">245:literal/grey</span>
    x:number<span class="Special"> &lt;- </span>add x:number, <span class="Constant">1:literal</span>
    <span class="Identifier">loop</span>
  <span class="Delimiter">}</span>
  print-character screen:address, <span class="Constant">9488:literal/down-left</span>, <span class="Constant">245:literal/grey</span>
  <span class="Comment"># bottom border</span>
  move-cursor screen:address, bottom:number, left:number
  print-character screen:address, <span class="Constant">9492:literal/up-right</span>, <span class="Constant">245:literal/grey</span>
  x:number<span class="Special"> &lt;- </span>add left:number, <span class="Constant">1:literal</span>  <span class="Comment"># exclude corner</span>
  <span class="Delimiter">{</span>
    continue?:boolean<span class="Special"> &lt;- </span>lesser-than x:number, right:number
    <span class="Identifier">break-unless</span> continue?:boolean
    print-character screen:address, <span class="Constant">9472:literal/horizontal</span>, <span class="Constant">245:literal/grey</span>
    x:number<span class="Special"> &lt;- </span>add x:number, <span class="Constant">1:literal</span>
    <span class="Identifier">loop</span>
  <span class="Delimiter">}</span>
  print-character screen:address, <span class="Constant">9496:literal/up-left</span>, <span class="Constant">245:literal/grey</span>
  <span class="Comment"># left and right borders</span>
  x:number<span class="Special"> &lt;- </span>add top:number, <span class="Constant">1:literal</span>  <span class="Comment"># exclude corner</span>
  <span class="Delimiter">{</span>
    continue?:boolean<span class="Special"> &lt;- </span>lesser-than x:number, bottom:number
    <span class="Identifier">break-unless</span> continue?:boolean
    move-cursor screen:address, x:number, left:number
    print-character screen:address, <span class="Constant">9474:literal/vertical</span>, <span class="Constant">245:literal/grey</span>
    move-cursor screen:address, x:number, right:number
    print-character screen:address, <span class="Constant">9474:literal/vertical</span>, <span class="Constant">245:literal/grey</span>
    x:number<span class="Special"> &lt;- </span>add x:number, <span class="Constant">1:literal</span>
    <span class="Identifier">loop</span>
  <span class="Delimiter">}</span>
  <span class="Comment"># position cursor inside box</span>
  move-cursor screen:address, top:number, left:number
  cursor-down screen:address
  cursor-right screen:address
]
</pre>
</body>
</html>
<!-- vim: set foldmethod=manual : -->