I'm too lost, so let's return to mazemaking... I guess? print random slashes. submissions may be written in any language.
there's a book about this one-line Commodore 64 program, which prints a maze by randomly printing either a / or \ character ad infinitum:
I didn't read the book, so I can't tell you any more than that. here's what the output looks like on the Commodore:

your challenge is to do that. as any language is allowed, there is no fixed API.
entry #1
comments 0
hawk.thue ASCII text
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 | $::=\
$::=/
::=
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$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$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
|
entry #2
comments 0
dir project
readme.txt ASCII text
| No, I'm not going to export the project. You'll have to import it in Godot yourself to run it. Here's why:
- Code guessing is about submitting code, not binaries
- Godot is not that hard to install
- It was too much work
|
entry #3
comments 0
cg109.raku ASCII text
| my $n = (2..^20).pick;
say <\ />.roll($n).join for ^(2..^20).pick;
|
entry #4
comments 0
preview.html ASCII text, with CRLF line terminators
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 | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<style>
@font-face {
font-family: 'Slashes';
src: url('slash.ttf') format('truetype');
}
#display {
font-family: 'Slashes', monospace;
font-feature-settings: 'calt' 1;
}
</style>
</head>
<body>
<h2>Make the maze.</h2>
<textarea id="input" rows="7" style="width:99%;">
aaaaaaaaaaaaaaaaaaaaaaaaaaa
bbbbbbbbbbbbbbbbbbbbbbbbbbb
ccccccccccccccccccccccccccc
ddddddddddddddddddddddddddd
eeeeeeeeeeeeeeeeeeeeeeeeeee
fffffffffffffffffffffffffff
</textarea>
<pre id="display" style="font-size:32px; margin-top:10px;"></pre>
<script>
const input = document.getElementById('input');
const display = document.getElementById('display');
display.textContent = input.value;
input.addEventListener('input', () => { display.textContent = input.value; });
</script>
</body>
</html>
|
slash.ttf TrueType Font data, 11 tables, 1st "GSUB", 2 names, Microsoft, language 0x409, type 1 string, SlashesRegular
entry #5
comments 0
index.html ASCII text
1
2
3
4
5
6
7
8
9
10
11
12 | <!DOCTYPE html>
<html lang="en">
<head>
<script src="https://codeguessing.gay/43/p5.min.js"></script>
<meta charset="utf-8" />
</head>
<body>
<main>
</main>
<script src="sketch.js"></script>
</body>
</html>
|
sketch.js ASCII text
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 | let t = 0;
let state = [];
let offsets = [];
let offset = 50;
let w = 20;
let c;
function setup() {
createCanvas(400, 400);
c = (width - 2 * offset) / w;
for(let i = 0; i < c; i++) {
state[i] = [];
offsets[i] = [];
for(let j = 0; j < c; j++) {
state[i][j] = random() > 0.5;
offsets[i][j] = [2 * random() - 1, 2 * random() - 1];
}
}
}
function rand(n) {
let r = noise(n, 0.01 * t);
r = 2 * r - 1;
let s = Math.sign(r);
return r;
}
function dotLine(x1, y1, x2, y2) {
let len = dist(x1, y1, x2, y2);
let spread = 6;
strokeWeight(2);
for(let i = 0; i < len; i += 3) {
for(let j = 0; j < 2; j++) {
let px = lerp(x1, x2, i / len);
let py = lerp(y1, y2, i / len);
let seed = x1 * 120 + y1 * 203 + x2 * 324 + y2 * 415 + i * 25 + j * 13 + x1 * y1 * x2 * y2 * i * j;
let rx = rand(seed), ry = rand(seed + 10000);
stroke(0x20, 0xd3, 0xff, 100 * (rx + ry) + 150);
point(px + spread * rx, py + spread * ry);
}
}
strokeWeight(1);
for(let i = 0; i < len; i += 3) {
for(let j = 0; j < 2; j++) {
let px = lerp(x1, x2, i / len);
let py = lerp(y1, y2, i / len);
let seed = x1 * 634 + y1 * 2345 + x2 * 543 + y2 * 234 + i * 756 + j * 43 + x1 * y1 * x2 * y2 * i * j;
let rx = rand(seed), ry = rand(seed + 10000);
stroke(200, 240, 255);
point(px + 3 * rx, py + 3 * ry);
}
}
stroke(255, 255, 255);
strokeWeight(1);
line(x1, y1, x2, y2);
}
let scaling = 0.12;
function offsettedX(x, y) {
if(y >= offsets.length) {
return x;
}
if(x >= offsets[y].length) {
return x;
}
return x + scaling * offsets[y][x][0];
}
function offsettedY(x, y) {
if(y >= offsets.length) {
return y;
}
if(x >= offsets[y].length) {
return y;
}
return y + scaling * offsets[y][x][1];
}
function backslash(x, y) {
dotLine(
offset + w * offsettedX(x, y),
offset + w * offsettedY(x, y),
offset + w * offsettedX(x + 1, y + 1),
offset + w * offsettedY(x + 1, y + 1)
);
}
function forwardslash(x, y) {
dotLine(
offset + w * offsettedX(x + 1, y),
offset + w * offsettedY(x + 1, y),
offset + w * offsettedX(x, y + 1),
offset + w * offsettedY(x, y + 1)
);
}
function draw() {
background(35, 0, 60);
for(let i = 0; i < state.length; i++) {
for(let j = 0; j < state[i].length; j++) {
if(i * state.length + j > 0.1 * t) {
continue;
}
if(state[i][j]) {
backslash(j, i);
} else {
forwardslash(j, i);
}
}
}
t++;
}
|
entry #6
comments 0
girlmoder.vim data
| qqa=rand()%2?'/':'\'
qxqr60@qoq30@r
|
entry #7
comments 0
slashes.cpp ASCII text
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 | #include <cstdint>
#include <iostream>
#include <type_traits>
#include <utility>
#ifndef WIDTH
#define WIDTH 30
#endif // !WIDTH
#ifndef HEIGHT
#define HEIGHT 10
#endif // !HEIGHT
constexpr std::uint32_t get_seed()
{
return (__TIME__[0] - '0') * 1e5 +
(__TIME__[1] - '0') * 1e4 +
(__TIME__[3] - '0') * 1e3 +
(__TIME__[4] - '0') * 1e2 +
(__TIME__[6] - '0') * 1e1 +
(__TIME__[7] - '0') * 1e0;
}
template<bool B>
struct Slash;
template<>
struct Slash<false>
{
static constexpr char content = '/';
};
template<>
struct Slash<true>
{
static constexpr char content = '\\';
};
template<std::uint32_t seed, std::uint32_t next>
struct LCG;
template<std::uint32_t seed>
struct LCG<seed, 0>
{
static constexpr std::uint32_t state = seed;
};
template<std::uint32_t seed, std::uint32_t next>
struct LCG
{
static constexpr std::uint32_t state = (1103515245 * LCG<seed, next - 1>::state + 12345) % 0x7fffffff;
};
template <std::uint32_t y, std::uint32_t x>
struct Maze
{
static constexpr char entry = Slash<LCG<get_seed(), y * WIDTH + x>::state & 1>::content;
};
template <std::uint32_t area, std::uint32_t current>
struct Program;
template <typename F, std::size_t... I>
constexpr void static_for_impl(F&& f, std::index_sequence<I...>) {
(f(std::integral_constant<std::size_t, I>{}), ...);
}
template <std::size_t N, typename F>
constexpr void static_for(F&& f) {
static_for_impl(f, std::make_index_sequence<N>{});
}
int main()
{
static_for<WIDTH * HEIGHT>([](auto i){
constexpr std::size_t idx = decltype(i)::value;
std::cout << Maze<i / WIDTH, i % WIDTH>::entry;
if constexpr (i % WIDTH == WIDTH - 1) {
std::cout << std::endl;
}
});
return 0;
}
|
post a comment