ced579b679709b38ba31b018ce7bb540bc42f1a5
[stratum0-wiki.git] / Gesellschaftsspiel-Replikator%2FScrabbleBrett.mw
1 <PRE>
2
3
4 // Scrabble Spielbrett
5 // (ein Viertel)
6 // 2014-05-15 V1.2
7 // by Stratum 0
8 // License: WTFPL
9
10 // $fn=20;
11
12 Kante = 14;
13 Kantenbreite = 1;
14 Hoehe = 4;
15 Randhoehe = 2;
16 Abstand=0;
17 Zaehler=1;
18 Viertelfeld=8;
19
20
21
22 //Hauptprogramm
23
24 intersection()
25 {
26 ViertelBrett();
27 cube ([Kante*(Viertelfeld+0.5), Kante*(Viertelfeld+0.5), Kante*(Viertelfeld+0.5)]);
28 }
29
30
31 module ViertelBrett()
32 {
33
34 for (i = [1:Viertelfeld])
35 {
36 for (j = [1:Viertelfeld])
37 {
38 translate([(Kante+Abstand)*i+Abstand,(Kante+Abstand)*j,0])
39 {
40 //Dreifacher Wortwert
41 if ((i==1) && (j==1)) { Feld("red"); Striche(3);}
42 if ((i==1) && (j==8)) { Feld("red"); Striche(3);}
43 if ((i==8) && (j==1)) { Feld("red"); Striche(3);}
44
45 //Doppelter Wortwert
46 if ((i==2) && (j==2)) { Feld("pink"); Striche(2);}
47 if ((i==3) && (j==3)) { Feld("pink"); Striche(2);}
48 if ((i==4) && (j==4)) { Feld("pink"); Striche(2);}
49 if ((i==5) && (j==5)) { Feld("pink"); Striche(2);}
50 if ((i==8) && (j==8)) { Feld("pink"); Striche(2);}
51
52 // Dreifacher Buchstabenwert
53 if ((i==2) && (j==6)) { Feld("blue"); Punkte(3);}
54 if ((i==6) && (j==2)) { Feld("blue"); Punkte(3);}
55 if ((i==6) && (j==6)) { Feld("blue"); Punkte(3);}
56
57 // Doppelter Buchstabenwert
58 if ((i==7) && (j==7)) { Feld("lightblue"); Punkte(2); }
59 if ((i==3) && (j==7)) { Feld("lightblue"); Punkte(2);}
60 if ((i==7) && (j==3)) { Feld("lightblue"); Punkte(2);}
61 if ((i==8) && (j==4)) { Feld("lightblue"); Punkte(2);}
62 if ((i==4) && (j==8)) { Feld("lightblue"); Punkte(2);}
63 if ((i==1) && (j==4)) { Feld("lightblue"); Punkte(2);}
64 if ((i==4) && (j==1)) { Feld("lightblue"); Punkte(2);}
65
66 // ansonsten normales Feld
67 Feld("lightgreen");
68 }
69 } // End For J
70 } // End For I
71
72
73 }
74
75 // Basisfeld erstellen
76 module Feld(Farbe)
77 {
78 difference()
79 {
80 cube([Kante, Kante, Hoehe+Randhoehe], center=false);
81
82 translate ([Kantenbreite,Kantenbreite,Hoehe-Randhoehe])
83 color (Farbe)
84 cube([Kante-Kantenbreite-Kantenbreite, Kante-Kantenbreite-Kantenbreite, Hoehe+Randhoehe], center=false);
85
86 };
87
88 }
89
90 module Punkte(AnzahlPunkte)
91 {
92 if (AnzahlPunkte==2)
93 {
94 translate ([Kante/3, Kante/3, Hoehe-Randhoehe]) cylinder(Randhoehe/2,2,1, center=false);
95 translate ([Kante/3*2, Kante/3*2, Hoehe-Randhoehe]) cylinder(Randhoehe/2,2,1, center=false);
96 }
97 if (AnzahlPunkte==3)
98 {
99 translate ([Kante/4, Kante/4, Hoehe-Randhoehe]) cylinder(Randhoehe/2,2,1, center=false);
100 translate ([Kante/4*2, Kante/4*2, Hoehe-Randhoehe]) cylinder(Randhoehe/2,2,1, center=false);
101 translate ([Kante/4*3, Kante/4*3, Hoehe-Randhoehe]) cylinder(Randhoehe/2,2,1, center=false);
102 }
103 }
104
105
106
107 module Striche(AnzahlStriche)
108 {
109 if (AnzahlStriche==2)
110 {
111 translate ([Kante/3-Kantenbreite/2, Kante/4, Hoehe-Randhoehe]) cube([Randhoehe/2,Kante/2,Randhoehe/2]);
112 translate ([Kante/3*2-Kantenbreite/2, Kante/4, Hoehe-Randhoehe]) cube([Randhoehe/2,Kante/2,Randhoehe/2]);
113 }
114 if (AnzahlStriche==3)
115 {
116 translate ([Kante/4, Kante/4, Hoehe-Randhoehe]) cube([Randhoehe/2,Kante/2,Randhoehe/2]);
117 translate ([Kante/4*2, Kante/4, Hoehe-Randhoehe]) cube([Randhoehe/2,Kante/2,Randhoehe/2]);
118 translate ([Kante/4*3, Kante/4, Hoehe-Randhoehe]) cube([Randhoehe/2,Kante/2,Randhoehe/2]);
119 }
120 }
121
122
123
124
125 </PRE>
This page took 0.044716 seconds and 3 git commands to generate.