Copy and paste the out into the browser console and assign it to a variable called `qr`. Then run the following code to generate and display the string in the viewer:
(function(qr) {
let start = ' L L L L K L L L L K'
let draw = val => {$('.names').value = val; main() };
let decode = val => val.replaceAll('d','a ').replaceAll('r',' a ').replaceAll('u',' a ').replaceAll('l',' a');
let size = 4
let on = (s) => {
let ret = ''
let line = 'r'.repeat(s-1)+'l'.repeat(s-1)
for (let i=0; i<s-1; i++) ret += line + 'd';
ret += line
ret += 'u'.repeat(s-1)
return ret
}
let right_cell = (s) => 'r'.repeat(s)
let left_cell = (s) => 'l'.repeat(s)
let down_cell = (s) => 'd'.repeat(s)
// draw(decode(on(3)+next_cell(3)+on(3)+next_cell(3)+next_cell(3)+on(3)+next_cell(3)))
let str = start
for (line of qr) {
for (val of line) {
str += val ? (on(size) + right_cell(size)) : right_cell(size)
}
console.debug(`A ${left_cell(size).repeat(line.length)}, ${size}, ${line.length} line ${line}`)
str += left_cell(size).repeat(line.length)
str += down_cell(size)
}
console.log(str);
draw(decode(str))
})(qr)
What was your motivation for the following function?
function rotateLine(position) {
if (position < halfabet) {
context.rotate((-90 \* Math.PI) / 180);
} else if (position > halfabet) {
context.rotate((90 \* Math.PI) / 180);
} else if (position === halfabet) {
context.rotate((180 \* Math.PI) / 180);
}
}
I'm sure you have your reasons, but when I was writing the alphabet to make a spiral I found the rotation reverse on me at 'n' which is where the other cases of rotateline() kick in. Why isn't this function just:
function rotateLine(position) {
context.rotate((-90 \* Math.PI) / 180);
}
Is it because it creates uninteresting results for actual names? Everyone just becomes spiral variations?
Update: wow I did not expect this response, I am so happy that people are enjoying Names! I have gathered some ideas for new features and improvements from the comments, I will see if I can implement them.
I'm impressed by the responses here. I wonder if it's possible to write something in plain language that can be read, which is also represented by the image it generates.
An attempt:
pick a card, any card. pick a card, any card. pick a card, any card. pick a card, any card.
Yeah, some people in the comments got really creative but it would definitely be nice if sharing it would be easier. I might also add a download as png button at the bottom of the canvas. (Can already be done by right clicking but thats not very user friendly)
I wondered what word would represent a square and did a quick guess with otto (a German name), which was actually very close (after investigating a bit more I'm even more surprised).
Repeating a string 4 times creates fun patterns with 360, 180 or 90 degree rotational symmetry (modifiable by adding spaces) which make nice looking avatars:
> hello i need help i'm trapped in a giant painting by wassily kandinsky and i can't find my way out of here what should i do?
a lot of these are very cool and artful and incredibly creative, and I mean, the QR code generator, what can I say, but I think this one is my favorite
[+] [-] toppy|3 years ago|reply
[+] [-] xcambar|3 years ago|reply
[+] [-] lawrenceyan|3 years ago|reply
Very cool!
[+] [-] jstjnsn|3 years ago|reply
[+] [-] chrisshroba|3 years ago|reply
And the code used to generate it:
First some python to create a qr code from the link and output it as a json list of booleans:
Copy and paste the out into the browser console and assign it to a variable called `qr`. Then run the following code to generate and display the string in the viewer:[+] [-] w-m|3 years ago|reply
[+] [-] abhayhegde|3 years ago|reply
[+] [-] KyleBerezin|3 years ago|reply
[+] [-] johnfn|3 years ago|reply
[+] [-] probablypower|3 years ago|reply
[+] [-] jstjnsn|3 years ago|reply
[+] [-] jamesgreenleaf|3 years ago|reply
An attempt:
pick a card, any card. pick a card, any card. pick a card, any card. pick a card, any card.
[+] [-] nonethewiser|3 years ago|reply
.
[+] [-] elil17|3 years ago|reply
piet mondrian piet mondrian piet mondrian
pot
a. pan
[+] [-] binarymax|3 years ago|reply
[+] [-] jstjnsn|3 years ago|reply
[+] [-] jstjnsn|3 years ago|reply
[+] [-] azeemba|3 years ago|reply
[+] [-] aordano|3 years ago|reply
[+] [-] ManDeJan|3 years ago|reply
z...z.z...zz...lk.w...l..g..l.l..g...z...f..f.f..f..k.wg.r.a
[+] [-] teddyh|3 years ago|reply
[+] [-] shevis|3 years ago|reply
[+] [-] creepycrawler|3 years ago|reply
[+] [-] warent|3 years ago|reply
[+] [-] spdustin|3 years ago|reply
That was unexpectedly fun!
[+] [-] andrelaszlo|3 years ago|reply
bbddffhhjjlln..n..p..p..r..r..t..t..v..v..x..x..z..z..n.n..n.n..o.o..o.o..p.p..p.p..q.q..q.q..r.r..r.r..s.s..s.s..t.t..t.t..u.u..u.u..v.v..v.v..w.w..w.w..x.x..x.x..y.y..y.y..z.z..z.z..a...z.a...z..a...z.a...z..b...z.b...z..b...z.b...z..c...z.c...z..c...z.c...z..d...z.d...z..d...z.d...z..e...z.e...z..e...z.e...z..f...z.f...z..f...z.f...z..g...z.g...z..g...z.g...z..h...z.h...z..h...z.h...z..i...z.i...z..i...z.i...z..j...z.j...z..j...z.j...z..k...z.k...z..k...z.k...z..l...z.l...z..l...z.l...z..m..z.m..z..m..z.m..z..n.z.n.z..n.z.n.z..o.z.o.x
[+] [-] zulu-inuoe|3 years ago|reply
[+] [-] unknown|3 years ago|reply
[deleted]
[+] [-] unknown|3 years ago|reply
[deleted]
[+] [-] pavon|3 years ago|reply
tile tile tile, tile tile tile tile, tile tile tile, tile tile tile tile, tile tile tile, tile tile tile tile, tile tile tile, tile tile tile tile
Another fun tiling:
ugoldfish, goldfish swim goldfish, goldfish swim goldfish, goldfish swim goldfish, goldfish swim
[+] [-] cycomanic|3 years ago|reply
[+] [-] kris_wayton|3 years ago|reply
[+] [-] grose|3 years ago|reply
[+] [-] pavon|3 years ago|reply
"grosegrosegrosegrose" "grose grose grose grose"
[+] [-] shevis|3 years ago|reply
[+] [-] thih9|3 years ago|reply
[+] [-] w-m|3 years ago|reply
one-two-one-two
hello i need help i'm trapped in a giant painting by wassily kandinsky and i can't find my way out of here what should i do?
no no no no
[+] [-] RheingoldRiver|3 years ago|reply
a lot of these are very cool and artful and incredibly creative, and I mean, the QR code generator, what can I say, but I think this one is my favorite
[+] [-] jstjnsn|3 years ago|reply
[+] [-] Rexxar|3 years ago|reply
[+] [-] ipince|3 years ago|reply
[+] [-] RheingoldRiver|3 years ago|reply
[+] [-] rawgabbit|3 years ago|reply
Love
[+] [-] jstjnsn|3 years ago|reply
[+] [-] memorable|3 years ago|reply
Some kind of square thingy