Compare commits

...

3 commits

Author SHA1 Message Date
Mirek Kratochvil f2252f2d46 optimize some stuff 2025-08-28 20:49:59 +02:00
Mirek Kratochvil a5b52ec8eb redirect 2025-03-10 08:41:20 +01:00
Mirek Kratochvil 2b01cedd0b add warning about the other repo 2023-09-09 13:54:16 +02:00
2 changed files with 42 additions and 22 deletions

View file

@ -18,33 +18,51 @@ off=tilesize*1.1;
//height 1/8"
tileheight=tilesize/8;
fontheight=tileheight*0.5;
corner=tileheight*2;
//accomodate for Ё
if (alphabet=="ru") {
fontheight=fontheight*0.9;
}
module arrow(n) {
if (n>=1) for(i=[0:n-1]) translate([i-(n-1)/2,0,0]) polygon([[0.45,0],[0,0.7],[-0.45,0]]);
}
//this produces one tile
module tilec(letter, x, y, c) {
xx = ((x+3)%7)-3;
yy = ((y+3)%7)-3;
dx = sign(xx);
dy = sign(yy);
translate([x*off,(6-y)*off,0]) {
difference() {
color(c)
cube([tilesize,tilesize,tileheight]);
color(c)
translate([tilesize*.4,tilesize*.4,tileheight*.51])
color(c) union() {
cube([tilesize,tilesize-corner,tileheight]);
translate([corner, tilesize-corner,0])
cube([tilesize-2*corner, corner, tileheight]);
translate([corner, tilesize-corner, 0])
cylinder(tileheight, corner, corner);
translate([tilesize-corner, tilesize-corner, 0])
cylinder(tileheight, corner, corner);
};
color("white") {
translate([tilesize*(0.5-dx*0.13),tilesize*(0.275-dy*0.13),tileheight*.51])
linear_extrude (height=tileheight/2)
text(letter, font=font, size=tilesize*.45,
halign="center", valign="baseline");
color(c)
translate([tilesize*.83, tilesize/2, tileheight*.76])
}
color("white")
translate([tilesize*(0.5+dx*0.3), tilesize*0.5, tileheight*.76])
scale(4*[dx,1,1])
rotate([0,0,-90])
linear_extrude(height=tileheight/4)
arrow(abs(xx));
color("white")
translate([tilesize*0.5, tilesize*(0.5+dy*0.3), tileheight*.76])
scale(4*[1,dy,1])
linear_extrude(height=tileheight/4)
text(str(x), font=font2, size=tilesize*.2,
halign="center", valign="center");
color(c)
translate([tilesize/2, tilesize*.14, tileheight*.76])
linear_extrude(height=tileheight/4)
text(str(y), font=font2, size=tilesize*.2,
halign="center", valign="center");
arrow(abs(yy));
}
}
}
@ -63,34 +81,34 @@ module tiles(letters) {
if (alphabet=="en") {
// latin variant of tiles
tiles(
["_", "A", "B", "C", "D", "E", "F",
["", "A", "B", "C", "D", "E", "F",
"G", "H", "I", "J", "K", "L", "M",
"N", "O", "P", "Q", "R", "S", "T",
"U", "V", "W", "X", "Y", "Z", ".",
"/", ":", "?", "!", "'", "(", ")",
"0", "1", "2", "3", "4", "5", "6",
"7", "8", "9", ",", "-", "+", "*",
"/", ":", "?", "!", "'", "(", ")"]
"7", "8", "9", ",", "-", "+", "*"]
);
} else if (alphabet=="ru") {
// variant of tiles thanks to Stas Bushuev
// (see https://github.com/Xitsa/ls47 for other versions)
tiles(
["_", "А", "Б", "В", "Г", "Д", "Е",
["", "А", "Б", "В", "Г", "Д", "Е",
"Ё", "Ж", "З", "И", "Й", "К", "Л",
"М", "Н", "О", "П", "Р", "С", "Т",
"У", "Ф", "Х", "Ц", "Ч", "Ш", "Щ",
"Ъ", "Ы", "Ь", "Э", "Ю", "Я", "/",
"Ъ", "Ы", "Ь", "Э", "Ю", "Я", ".",
"0", "1", "2", "3", "4", "5", "6",
"7", "8", "9", ".", ",", "?", "!"]
"7", "8", "9", "/", ",", "?", "!"]
);
}
//the token
translate([-off/2,off/2,0]) {
color("red") difference() {
cylinder(h=tileheight, d=tilesize*.7);
cylinder(h=tileheight, d=tilesize);
translate([0,0,-.1])
cylinder(h=tileheight*1.2, d=tilesize*.7-tileheight);
cylinder(h=tileheight*1.2, d=tilesize-2*tileheight);
}
}

View file

@ -1,6 +1,8 @@
# LS47 hand-computable cipher
**This repository is a mirror, please point all activity/issues to https://git.e-x-a.org/exa/ls47**
This is a slight improvement of the ElsieFour cipher as described by Alan
Kaminsky [1]. We use 7x7 characters instead of original (barely fitting) 6x6,
to be able to encrypt some structured information. We also describe a simple
@ -34,9 +36,9 @@ _ a b c d e f
g h i j k l m
n o p q r s t
u v w x y z .
/ : ? ! ' ( )
0 1 2 3 4 5 6
7 8 9 , - + *
/ : ? ! ' ( )
```
Zoomed in, it's very practical to have extra position information written on