Projekt:Schach

aus Kamelopedia, der wüsten Enzyklopädie
Version vom 25. Juli 2007, 17:10 Uhr von WiMu (Diskussion | Beiträge) (Muss gleich aufhören)
Zur Navigation springen Zur Suche springen
Herzlich Willkommen beim Kamelopedia Online-Schach!
Herzlich Willkommen beim Kamelopedia Online-Schach!
Herzlich Willkommen beim Kamelopedia Online-Schach!
Herzlich Willkommen beim Kamelopedia Online-Schach!
Herzlich Willkommen beim Kamelopedia Online-Schach!
Herzlich Willkommen beim Kamelopedia Online-Schach!
Herzlich Willkommen beim Kamelopedia Online-Schach!
Herzlich Willkommen beim Kamelopedia Online-Schach!
Herzlich Willkommen beim Kamelopedia Online-Schach!
Herzlich Willkommen beim Kamelopedia Online-Schach!
Herzlich Willkommen beim Kamelopedia Online-Schach!
Herzlich Willkommen beim Kamelopedia Online-Schach!
Herzlich Willkommen beim Kamelopedia Online-Schach!
Herzlich Willkommen beim Kamelopedia Online-Schach!
Herzlich Willkommen beim Kamelopedia Online-Schach!


Alles geklaut aus der englischen Uncyclopedia.
Und so funktioniert's:

Das Schachbrett

Die Vorlage:Schachbrett erzeugt ein Schachbrett. Logisch, oder?
So sieht der Quelltext aus:

{{Schachbrett|
 |  |  |  |  |  |  |  |  |=
 |  |  |  |  |  |  |  |  |=
 |  |  |  |  |  |  |  |  |=
 |  |  |  |  |  |  |  |  |=
 |  |  |  |  |  |  |  |  |=
 |  |  |  |  |  |  |  |  |=
 |  |  |  |  |  |  |  |  |=
 |  |  |  |  |  |  |  |  |=
 }}

Jede Zeile steht für eine Zeile ( 1, 2, 3, 4 ...usw.) und jede Spalte für eine Spalte ( a, b, c, d ... usw.). Wieder logisch, gell? Heraus kommt dann das hier:

a b c d e f g h
8 8
7 7
6 6
5 5
4 4
3 3
2 2
1 1
a b c d e f g h

Hübsch, nicht wahr?

Die Figuren

Um richtig toll Schach spielen zu können braucht man auch Figuren, richtig? Haben wir! Zunächst das Basis-Set:

Figur .gif .png code .gif .png code
Bauer Datei:Schach wb.gif wb Datei:Schach sb.gif sb
Turm Datei:Schach wt.gif wt Datei:Schach st.gif st
Pferd Datei:Schach wp.gif wp Datei:Schach sp.gif sp
Läufer Datei:Schach wl.gif wl Datei:Schach sl.gif sl
Dame Datei:Schach wd.gif wd Datei:Schach sd.gif sd
König Datei:Schach wk.gif wk sk

Jede Figur hat ein Kürzel aus zwei Buchstaben. Der erste Buchstabe steht für die Farbe (s = schwarz, w = weiß ... mehr Farben kommen demnächst ;-)), der zweite Buchstabe für die Figur (b = Bauer, t = Turm, usw.).
Also: schwarzer Bauer: sb; weiße Dame: wd.
Wie Du vielleicht gemerkt hast ist jede Figur doppelt vorhanden, einmal als .gif und einmal als .png; pngs sind zwar hübscher, lassen sich aber – im Gegensatz zu gifs – nicht animieren. Außerdem gibt's zuweilen Kommpa ... Kommbo ... Kompatibilli ... manche Browser sind zu doof für für png. Die Spieler müssen sich vorher entscheiden, ob sie mit gifs oder pngs spielen wollen (mischen klappt erst, wenn sich unser Servergott dazu bequemt hat das update zu machen). Dazu wird in die Vorlage img=gif oder img=png eingetragen.
Die Kürzel der Figuren kommen nun an die entsprechende Stelle in der Vorlage. Probieren wir mal die Grundaufstellung aus, einmal in .gif, einmal in .png:

gif:

{{Schachbrett|img=gif
|st|sp|sl|sd|sk|sl|sp|st|=
|sb|sb|sb|sb|sb|sb|sb|sb|=
|  |  |  |  |  |  |  |  |=
|  |  |  |  |  |  |  |  |=
|  |  |  |  |  |  |  |  |=
|  |  |  |  |  |  |  |  |=
|wb|wb|wb|wb|wb|wb|wb|wb|=
|wt|wp|wl|wd|wk|wl|wp|wt|=
}}

png:

{{Schachbrett|img=png
|st|sp|sl|sd|sk|sl|sp|st|=
|sb|sb|sb|sb|sb|sb|sb|sb|=
|  |  |  |  |  |  |  |  |=
|  |  |  |  |  |  |  |  |=
|  |  |  |  |  |  |  |  |=
|  |  |  |  |  |  |  |  |=
|wb|wb|wb|wb|wb|wb|wb|wb|=
|wt|wp|wl|wd|wk|wl|wp|wt|=
}}
Ergebnis mit img=gif: Ergebnis mit img=png:
a b c d e f g h
8 8
7 7
6 6
5 5
4 4
3 3
2 2
1 1
a b c d e f g h
a b c d e f g h
8 8
7 7
6 6
5 5
4 4
3 3
2 2
1 1
a b c d e f g h

Sicher ist dir aufgefallen, dass die Figuren exakt dort sind, wo sie auch im Quelltext stehen. Probieren wir also mal etwas anderes. Vielleicht die berühmte Pferdekopf-Stellung, an der selbst so mancher Großmeister gescheitert ist:

{{Schachbrett|img=png
 |wp|wp|wp|wp|  |  |  |  |=
 |wp|wp|sk|wp|  |  |  |  |=
 |wp|wp|wp|wp|  |  |  |  |=
 |wp|wp|wp|wp|  |  |  |wp|=
 |wp|wp|wp|wp|wp|  |wp|wp|=
 |  |  |  |  |wp|wp|wp|wp|=
 |  |  |  |  |  |wp|wp|wp|=
 |  |  |  |  |  |  |wp|wp|=
 }}
a b c d e f g h
8 8
7 7
6 6
5 5
4 4
3 3
2 2
1 1
a b c d e f g h

Schachbrett advanced

Die Vorlage erlaubt auch einige optische Spielereien (mehr sind in Planung). Am wichtigsten ist wohl der Parameter size=Zahl. Hiermit lässt sich – oh Wunder – die Größe des Schachbretts verändern (die Grundeinstellung ist size=44):

{{Schachbrett|img=png|size=40   {{Schachbrett|img=png|size=30   {{Schachbrett|img=png|size=20
|wp|wp|wp|wp|  |  |  |  |=      |wp|wp|wp|wp|  |  |  |  |=      |wp|wp|wp|wp|  |  |  |  |=
|wp|wp|sk|wp|  |  |  |  |=      |wp|wp|sk|wp|  |  |  |  |=      |wp|wp|sk|wp|  |  |  |  |=
|wp|wp|wp|wp|  |  |  |  |=      |wp|wp|wp|wp|  |  |  |  |=      |wp|wp|wp|wp|  |  |  |  |=
|wp|wp|wp|wp|  |  |  |wp|=      |wp|wp|wp|wp|  |  |  |wp|=      |wp|wp|wp|wp|  |  |  |wp|=
|wp|wp|wp|wp|wp|  |wp|wp|=      |wp|wp|wp|wp|wp|  |wp|wp|=      |wp|wp|wp|wp|wp|  |wp|wp|=
|  |  |  |  |wp|wp|wp|wp|=      |  |  |  |  |wp|wp|wp|wp|=      |  |  |  |  |wp|wp|wp|wp|=
|  |  |  |  |  |wp|wp|wp|=      |  |  |  |  |  |wp|wp|wp|=      |  |  |  |  |  |wp|wp|wp|=
|  |  |  |  |  |  |wp|wp|=      |  |  |  |  |  |  |wp|wp|=      |  |  |  |  |  |  |wp|wp|=
}}                              }}                              }}
Ergebnis mit size=40: Ergebnis mit size=30: Ergebnis mit size=20:
a b c d e f g h
8 8
7 7
6 6
5 5
4 4
3 3
2 2
1 1
a b c d e f g h
a b c d e f g h
8 8
7 7
6 6
5 5
4 4
3 3
2 2
1 1
a b c d e f g h
a b c d e f g h
8 8
7 7
6 6
5 5
4 4
3 3
2 2
1 1
a b c d e f g h

Ist das nicht Klasse? Aber noch nicht genug! Mit weiß=Farbe und schwarz=Farbe lassen sich zudem die Schwarzen und weißen Felder entsprechend einfärben!!! Eine Übersicht über die Fabcodes gibt's hier.

{{Schachbrett|img=png|weiß=pink|schwarz=turquoise {{Schachbrett|img=png|weiß=#FFFF00|schwarz=#00CD00
|st|sp|sl|sd|sk|sl|sp|st|=                        |st|sp|sl|sd|sk|sl|sp|st|=
|sb|sb|sb|sb|sb|sb|sb|sb|=                        |sb|sb|sb|sb|sb|sb|sb|sb|=
|  |  |  |  |  |  |  |  |=                        |  |  |  |  |  |  |  |  |=
|  |  |  |  |  |  |  |  |=                        |  |  |  |  |  |  |  |  |=
|  |  |  |  |  |  |  |  |=                        |  |  |  |  |  |  |  |  |=
|  |  |  |  |  |  |  |  |=                        |  |  |  |  |  |  |  |  |=
|wb|wb|wb|wb|wb|wb|wb|wb|=                        |wb|wb|wb|wb|wb|wb|wb|wb|=
|wt|wp|wl|wd|wk|wl|wp|wt|=                        |wt|wp|wl|wd|wk|wl|wp|wt|=
}}                                                }}
Ergebnis mit weiß=pink und schwarz=turquoise: Ergebnis mit weiß=#FFFF00 und schwarz=#00CD00:
a b c d e f g h
8 8
7 7
6 6
5 5
4 4
3 3
2 2
1 1
a b c d e f g h
a b c d e f g h
8 8
7 7
6 6
5 5
4 4
3 3
2 2
1 1
a b c d e f g h

Na, ist das nix?