Cut a rectangle: Difference between revisions

Content added Content deleted
(Added XPL0 example.)
m (→‎{{header|Wren}}: Minor tidy, reran with latest version.)
Line 3,690: Line 3,690:
{{trans|C}}
{{trans|C}}
{{libheader|Wren-fmt}}
{{libheader|Wren-fmt}}
Last two are very slooow to emerge (just under 10 mins overall).
Last two are very slooow to emerge (about mins overall).
<syntaxhighlight lang="ecmascript">import "/fmt" for Fmt
<syntaxhighlight lang="ecmascript">import "./fmt" for Fmt


var grid = []
var grid = []
Line 3,712: Line 3,712:
for (i in 0..3) {
for (i in 0..3) {
if (grid[t + next[i]] == 0) {
if (grid[t + next[i]] == 0) {
System.write("") // guard against VM recursion bug
walk.call(y + dir[i][0], x + dir[i][1])
walk.call(y + dir[i][0], x + dir[i][1])
}
}
Line 3,755: Line 3,754:
cnt = cnt * 2
cnt = cnt * 2
} else if ((w&1 == 0) && recur) {
} else if ((w&1 == 0) && recur) {
System.write("") // guard against VM recursion bug
solve.call(w, h, false)
solve.call(w, h, false)
}
}