Compare commits
	
		
			No commits in common. "f2252f2d46251127df640239408224f120e208ea" and "285653fd1ddfcecba4a6cafc18a83fca32b83bde" have entirely different histories.
		
	
	
		
			f2252f2d46
			...
			285653fd1d
		
	
		
							
								
								
									
										58
									
								
								LS47.scad
									
									
									
									
									
								
							
							
						
						
									
										58
									
								
								LS47.scad
									
									
									
									
									
								
							| 
						 | 
					@ -18,51 +18,33 @@ off=tilesize*1.1;
 | 
				
			||||||
//height 1/8"
 | 
					//height 1/8"
 | 
				
			||||||
tileheight=tilesize/8;
 | 
					tileheight=tilesize/8;
 | 
				
			||||||
fontheight=tileheight*0.5;
 | 
					fontheight=tileheight*0.5;
 | 
				
			||||||
corner=tileheight*2;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
//accomodate for Ё
 | 
					//accomodate for Ё
 | 
				
			||||||
if (alphabet=="ru") { 
 | 
					if (alphabet=="ru") { 
 | 
				
			||||||
        fontheight=fontheight*0.9;
 | 
					        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
 | 
					//this produces one tile
 | 
				
			||||||
module tilec(letter, x, y, c) {
 | 
					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]) {
 | 
					  translate([x*off,(6-y)*off,0]) {
 | 
				
			||||||
    difference() {
 | 
					    difference() {
 | 
				
			||||||
      color(c) union() {
 | 
					      color(c)
 | 
				
			||||||
        cube([tilesize,tilesize-corner,tileheight]);
 | 
					      cube([tilesize,tilesize,tileheight]);
 | 
				
			||||||
        translate([corner, tilesize-corner,0])
 | 
					      color(c)
 | 
				
			||||||
          cube([tilesize-2*corner, corner, tileheight]);
 | 
					        translate([tilesize*.4,tilesize*.4,tileheight*.51])
 | 
				
			||||||
        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)
 | 
					        linear_extrude (height=tileheight/2)
 | 
				
			||||||
          text(letter, font=font, size=tilesize*.45,
 | 
					          text(letter, font=font, size=tilesize*.45,
 | 
				
			||||||
               halign="center", valign="baseline");
 | 
					               halign="center", valign="baseline");
 | 
				
			||||||
      }
 | 
					      color(c)
 | 
				
			||||||
      color("white")
 | 
					      translate([tilesize*.83, tilesize/2, tileheight*.76])
 | 
				
			||||||
      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)
 | 
					        linear_extrude(height=tileheight/4)
 | 
				
			||||||
            arrow(abs(xx));
 | 
					          text(str(x), font=font2, size=tilesize*.2,
 | 
				
			||||||
      color("white")
 | 
					               halign="center", valign="center");
 | 
				
			||||||
      translate([tilesize*0.5, tilesize*(0.5+dy*0.3), tileheight*.76])
 | 
					      color(c)
 | 
				
			||||||
        scale(4*[1,dy,1])
 | 
					      translate([tilesize/2, tilesize*.14, tileheight*.76])
 | 
				
			||||||
        linear_extrude(height=tileheight/4)
 | 
					        linear_extrude(height=tileheight/4)
 | 
				
			||||||
          arrow(abs(yy));
 | 
					          text(str(y), font=font2, size=tilesize*.2,
 | 
				
			||||||
 | 
					               halign="center", valign="center");
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -81,34 +63,34 @@ module tiles(letters) {
 | 
				
			||||||
if (alphabet=="en") {
 | 
					if (alphabet=="en") {
 | 
				
			||||||
    // latin variant of tiles
 | 
					    // latin variant of tiles
 | 
				
			||||||
    tiles(
 | 
					    tiles(
 | 
				
			||||||
        ["□", "A", "B", "C", "D", "E", "F",
 | 
					        ["_", "A", "B", "C", "D", "E", "F",
 | 
				
			||||||
        "G", "H", "I", "J", "K", "L", "M",
 | 
					        "G", "H", "I", "J", "K", "L", "M",
 | 
				
			||||||
        "N", "O", "P", "Q", "R", "S", "T",
 | 
					        "N", "O", "P", "Q", "R", "S", "T",
 | 
				
			||||||
        "U", "V", "W", "X", "Y", "Z", ".",
 | 
					        "U", "V", "W", "X", "Y", "Z", ".",
 | 
				
			||||||
        "/", ":", "?", "!", "'", "(", ")",
 | 
					 | 
				
			||||||
        "0", "1", "2", "3", "4", "5", "6",
 | 
					        "0", "1", "2", "3", "4", "5", "6",
 | 
				
			||||||
        "7", "8", "9", ",", "-", "+", "*"]
 | 
					        "7", "8", "9", ",", "-", "+", "*",
 | 
				
			||||||
 | 
					        "/", ":", "?", "!", "'", "(", ")"]
 | 
				
			||||||
    );
 | 
					    );
 | 
				
			||||||
} else if (alphabet=="ru") {
 | 
					} else if (alphabet=="ru") {
 | 
				
			||||||
    // variant of tiles thanks to Stas Bushuev
 | 
					    // variant of tiles thanks to Stas Bushuev
 | 
				
			||||||
    // (see https://github.com/Xitsa/ls47 for other versions)
 | 
					    // (see https://github.com/Xitsa/ls47 for other versions)
 | 
				
			||||||
    tiles(
 | 
					    tiles(
 | 
				
			||||||
        ["□", "А", "Б", "В", "Г", "Д", "Е",
 | 
					        ["_", "А", "Б", "В", "Г", "Д", "Е",
 | 
				
			||||||
        "Ё", "Ж", "З", "И", "Й", "К", "Л",
 | 
					        "Ё", "Ж", "З", "И", "Й", "К", "Л",
 | 
				
			||||||
        "М", "Н", "О", "П", "Р", "С", "Т",
 | 
					        "М", "Н", "О", "П", "Р", "С", "Т",
 | 
				
			||||||
        "У", "Ф", "Х", "Ц", "Ч", "Ш", "Щ",
 | 
					        "У", "Ф", "Х", "Ц", "Ч", "Ш", "Щ",
 | 
				
			||||||
        "Ъ", "Ы", "Ь", "Э", "Ю", "Я", ".",
 | 
					        "Ъ", "Ы", "Ь", "Э", "Ю", "Я", "/",
 | 
				
			||||||
        "0", "1", "2", "3", "4", "5", "6",
 | 
					        "0", "1", "2", "3", "4", "5", "6",
 | 
				
			||||||
        "7", "8", "9", "/", ",", "?", "!"]
 | 
					        "7", "8", "9", ".", ",", "?", "!"]
 | 
				
			||||||
    );
 | 
					    );
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
//the token
 | 
					//the token
 | 
				
			||||||
translate([-off/2,off/2,0]) {
 | 
					translate([-off/2,off/2,0]) {
 | 
				
			||||||
    color("red") difference() {
 | 
					    color("red") difference() {
 | 
				
			||||||
      cylinder(h=tileheight, d=tilesize);
 | 
					      cylinder(h=tileheight, d=tilesize*.7);
 | 
				
			||||||
      translate([0,0,-.1])
 | 
					      translate([0,0,-.1])
 | 
				
			||||||
        cylinder(h=tileheight*1.2, d=tilesize-2*tileheight);
 | 
					        cylinder(h=tileheight*1.2, d=tilesize*.7-tileheight);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,8 +1,6 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# LS47 hand-computable cipher
 | 
					# 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
 | 
					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,
 | 
					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
 | 
					to be able to encrypt some structured information. We also describe a simple
 | 
				
			||||||
| 
						 | 
					@ -36,9 +34,9 @@ _ a b c d e f
 | 
				
			||||||
g h i j k l m
 | 
					g h i j k l m
 | 
				
			||||||
n o p q r s t
 | 
					n o p q r s t
 | 
				
			||||||
u v w x y z .
 | 
					u v w x y z .
 | 
				
			||||||
/ : ? ! ' ( )
 | 
					 | 
				
			||||||
0 1 2 3 4 5 6
 | 
					0 1 2 3 4 5 6
 | 
				
			||||||
7 8 9 , - + *
 | 
					7 8 9 , - + *
 | 
				
			||||||
 | 
					/ : ? ! ' ( )
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Zoomed in, it's very practical to have extra position information written on
 | 
					Zoomed in, it's very practical to have extra position information written on
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue