From 1417d976b8c0ded4966119120391cfa0270ec2be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Fra=C3=9F?= Date: Tue, 20 Mar 2018 20:48:46 +0100 Subject: [PATCH] persistenz mit localstorage - kleiner hack <-) --- makefile | 236 ++++++++++--------- quelldatein/aufbau/aktor.ts | 12 + quelldatein/aufbau/aktor_.ts | 124 ++++++++++ quelldatein/aufbau/akzeptoraufgabe.ts | 19 +- quelldatein/aufbau/annehmer.ts | 25 ++ quelldatein/aufbau/aufgabe.ts | 6 + quelldatein/aufbau/aufgabe_.ts | 2 + quelldatein/aufbau/befoerderer.ts | 27 +++ quelldatein/aufbau/erzeuger.ts | 27 +++ quelldatein/aufbau/leser.ts | 31 +++ quelldatein/aufbau/partie.ts | 69 ++++-- quelldatein/aufbau/richtung.ts | 18 ++ quelldatein/aufbau/schreiber.ts | 29 +++ quelldatein/aufbau/stelle.ts | 18 ++ quelldatein/aufbau/symbol.ts | 18 ++ quelldatein/aufbau/transduktoraufgabe.ts | 19 +- quelldatein/aufbau/verwerfer.ts | 25 ++ quelldatein/aufbau/welt.ts | 46 +++- quelldatein/daten/aufgaben.dat.js | 18 +- quelldatein/haupt.ts | 31 +-- quelldatein/manifestation/speicher/partie.ts | 124 ++++++++++ quelldatein/manifestation/web/partie.css | 86 ------- quelldatein/manifestation/web/partie.scss | 122 ++++++++++ quelldatein/manifestation/web/partie.ts | 2 + quelldatein/manifestation/web/vtm.css | 168 ------------- quelldatein/manifestation/web/vtm.html | 4 +- quelldatein/manifestation/web/vtm.scss | 211 +++++++++++++++++ werkzeuge/bauen.sh | 2 +- werkzeuge/zuruecksetzen.sh | 4 + 29 files changed, 1121 insertions(+), 402 deletions(-) create mode 100644 quelldatein/aufbau/aktor_.ts create mode 100644 quelldatein/manifestation/speicher/partie.ts delete mode 100644 quelldatein/manifestation/web/partie.css create mode 100644 quelldatein/manifestation/web/partie.scss delete mode 100644 quelldatein/manifestation/web/vtm.css create mode 100644 quelldatein/manifestation/web/vtm.scss create mode 100755 werkzeuge/zuruecksetzen.sh diff --git a/makefile b/makefile index 320a194..bd4abb3 100644 --- a/makefile +++ b/makefile @@ -1,115 +1,139 @@ -all: erzeugnis/vtm.html erzeugnis/vtm.css erzeugnis/aufgaben.dat.js erzeugnis/vtm.js +cmd_md := mkdir -p +cmd_rm := rm -rf +cmd_echo := echo # -e +cmd_cp := cp -ruv +cmd_cat := cat +cmd_tsc := tsc --allowUnreachableCode +cmd_sass := sass + +dir_quelldatein := quelldatein +dir_erzeugnis := erzeugnis + +all: \ + ${dir_erzeugnis}/vtm.html \ + ${dir_erzeugnis}/vtm.css \ + ${dir_erzeugnis}/vtm.dat.js \ + ${dir_erzeugnis}/vtm.js .PHONY: all clear: - @ echo "-- zurücksetzen …" - @ rm -f erzeugnis + @ ${cmd_echo} "-- zurücksetzen …" + @ ${cmd_rm} ${dir_erzeugnis} .PHONY: clear -erzeugnis/vtm.html: quelldatein/manifestation/web/vtm.html - @ echo "-- Struktur …" - @ mkdir -p erzeugnis - @ cp quelldatein/manifestation/web/vtm.html erzeugnis/vtm.html +${dir_erzeugnis}/vtm.html: \ + ${dir_quelldatein}/manifestation/web/vtm.html + @ ${cmd_echo} "-- Struktur …" + @ ${cmd_md} ${dir_erzeugnis} + @ ${cmd_cp} ${dir_quelldatein}/manifestation/web/vtm.html ${dir_erzeugnis}/vtm.html -erzeugnis/vtm.css: quelldatein/manifestation/web/vtm.css quelldatein/manifestation/web/partie.css - @ echo "-- Gestaltung …" - @ mkdir -p erzeugnis - @ cat quelldatein/manifestation/web/vtm.css quelldatein/manifestation/web/partie.css > erzeugnis/vtm.css +${dir_erzeugnis}/vtm.css: \ + ${dir_quelldatein}/manifestation/web/vtm.scss \ + ${dir_quelldatein}/manifestation/web/partie.scss + @ ${cmd_echo} "-- Gestaltung …" + @ ${cmd_md} ${dir_erzeugnis} + @ ${cmd_cat} \ + ${dir_quelldatein}/manifestation/web/vtm.scss \ + ${dir_quelldatein}/manifestation/web/partie.scss \ + | ${cmd_sass} --stdin > ${dir_erzeugnis}/vtm.css -erzeugnis/aufgaben.dat.js: \ - quelldatein/daten/aufgaben.dat.js \ - quelldatein/daten/zeichenketten/de.dat.js \ - quelldatein/daten/zeichenketten/en.dat.js - @ echo "-- Daten …" - @ mkdir -p erzeugnis - @ cat \ - quelldatein/daten/aufgaben.dat.js \ - quelldatein/daten/zeichenketten/de.dat.js \ - quelldatein/daten/zeichenketten/en.dat.js \ - > erzeugnis/daten.js +${dir_erzeugnis}/vtm.dat.js: \ + ${dir_quelldatein}/daten/aufgaben.dat.js \ + ${dir_quelldatein}/daten/zeichenketten/de.dat.js \ + ${dir_quelldatein}/daten/zeichenketten/en.dat.js + @ ${cmd_echo} "-- Daten …" + @ ${cmd_md} ${dir_erzeugnis} + @ ${cmd_cat} \ + ${dir_quelldatein}/daten/aufgaben.dat.js \ + ${dir_quelldatein}/daten/zeichenketten/de.dat.js \ + ${dir_quelldatein}/daten/zeichenketten/en.dat.js \ + > ${dir_erzeugnis}/vtm.dat.js -erzeugnis/vtm.js: \ - quelldatein/basis/typen.ts \ - quelldatein/basis/fehlermonade.ts \ - quelldatein/helfer/verschiedenes.ts \ - quelldatein/helfer/mathematik.ts \ - quelldatein/helfer/vektor.ts \ - quelldatein/helfer/hashmap.ts \ - quelldatein/helfer/xmlknoten.ts \ - quelldatein/helfer/uebersetzung.ts \ - quelldatein/daten.ts \ - quelldatein/aufbau/richtung.ts \ - quelldatein/aufbau/symbol.ts \ - quelldatein/aufbau/stelle.ts \ - quelldatein/aufbau/zustand.ts \ - quelldatein/aufbau/figur.ts \ - quelldatein/aufbau/aktor.ts \ - quelldatein/aufbau/erzeuger.ts \ - quelldatein/aufbau/befoerderer.ts \ - quelldatein/aufbau/schreiber.ts \ - quelldatein/aufbau/leser.ts \ - quelldatein/aufbau/verwerfer.ts \ - quelldatein/aufbau/annehmer.ts \ - quelldatein/aufbau/welt.ts \ - quelldatein/aufbau/test.ts \ - quelldatein/aufbau/akzeptortest.ts \ - quelldatein/aufbau/transduktortest.ts \ - quelldatein/aufbau/aufgabe.ts \ - quelldatein/aufbau/akzeptoraufgabe.ts \ - quelldatein/aufbau/transduktoraufgabe.ts \ - quelldatein/aufbau/aufgabe_.ts \ - quelldatein/aufbau/modus.ts \ - quelldatein/aufbau/partie.ts \ - quelldatein/manifestation/manifestation.ts \ - quelldatein/manifestation/position.ts \ - quelldatein/manifestation/svg/svg.ts \ - quelldatein/manifestation/svg/figur.ts \ - quelldatein/manifestation/svg/aktor.ts \ - quelldatein/manifestation/svg/partie.ts \ - quelldatein/manifestation/web/partie.ts \ - quelldatein/haupt.ts - @ echo "-- Logik …" - @ mkdir -p erzeugnis - @ tsc \ - --allowUnreachableCode \ - quelldatein/basis/typen.ts \ - quelldatein/basis/fehlermonade.ts \ - quelldatein/helfer/verschiedenes.ts \ - quelldatein/helfer/mathematik.ts \ - quelldatein/helfer/vektor.ts \ - quelldatein/helfer/hashmap.ts \ - quelldatein/helfer/xmlknoten.ts \ - quelldatein/helfer/uebersetzung.ts \ - quelldatein/daten.ts \ - quelldatein/aufbau/richtung.ts \ - quelldatein/aufbau/symbol.ts \ - quelldatein/aufbau/stelle.ts \ - quelldatein/aufbau/zustand.ts \ - quelldatein/aufbau/figur.ts \ - quelldatein/aufbau/aktor.ts \ - quelldatein/aufbau/erzeuger.ts \ - quelldatein/aufbau/befoerderer.ts \ - quelldatein/aufbau/schreiber.ts \ - quelldatein/aufbau/leser.ts \ - quelldatein/aufbau/verwerfer.ts \ - quelldatein/aufbau/annehmer.ts \ - quelldatein/aufbau/welt.ts \ - quelldatein/aufbau/test.ts \ - quelldatein/aufbau/akzeptortest.ts \ - quelldatein/aufbau/transduktortest.ts \ - quelldatein/aufbau/aufgabe.ts \ - quelldatein/aufbau/akzeptoraufgabe.ts \ - quelldatein/aufbau/transduktoraufgabe.ts \ - quelldatein/aufbau/aufgabe_.ts \ - quelldatein/aufbau/modus.ts \ - quelldatein/aufbau/partie.ts \ - quelldatein/manifestation/manifestation.ts \ - quelldatein/manifestation/position.ts \ - quelldatein/manifestation/svg/svg.ts \ - quelldatein/manifestation/svg/figur.ts \ - quelldatein/manifestation/svg/aktor.ts \ - quelldatein/manifestation/svg/partie.ts \ - quelldatein/manifestation/web/partie.ts \ - quelldatein/haupt.ts \ - --outFile erzeugnis/vtm.js +${dir_erzeugnis}/vtm.js: \ + ${dir_quelldatein}/basis/typen.ts \ + ${dir_quelldatein}/basis/fehlermonade.ts \ + ${dir_quelldatein}/helfer/verschiedenes.ts \ + ${dir_quelldatein}/helfer/mathematik.ts \ + ${dir_quelldatein}/helfer/vektor.ts \ + ${dir_quelldatein}/helfer/hashmap.ts \ + ${dir_quelldatein}/helfer/xmlknoten.ts \ + ${dir_quelldatein}/helfer/uebersetzung.ts \ + ${dir_quelldatein}/daten.ts \ + ${dir_quelldatein}/aufbau/richtung.ts \ + ${dir_quelldatein}/aufbau/symbol.ts \ + ${dir_quelldatein}/aufbau/stelle.ts \ + ${dir_quelldatein}/aufbau/zustand.ts \ + ${dir_quelldatein}/aufbau/figur.ts \ + ${dir_quelldatein}/aufbau/aktor.ts \ + ${dir_quelldatein}/aufbau/erzeuger.ts \ + ${dir_quelldatein}/aufbau/befoerderer.ts \ + ${dir_quelldatein}/aufbau/schreiber.ts \ + ${dir_quelldatein}/aufbau/leser.ts \ + ${dir_quelldatein}/aufbau/verwerfer.ts \ + ${dir_quelldatein}/aufbau/annehmer.ts \ + ${dir_quelldatein}/aufbau/aktor_.ts \ + ${dir_quelldatein}/aufbau/welt.ts \ + ${dir_quelldatein}/aufbau/test.ts \ + ${dir_quelldatein}/aufbau/akzeptortest.ts \ + ${dir_quelldatein}/aufbau/transduktortest.ts \ + ${dir_quelldatein}/aufbau/aufgabe.ts \ + ${dir_quelldatein}/aufbau/akzeptoraufgabe.ts \ + ${dir_quelldatein}/aufbau/transduktoraufgabe.ts \ + ${dir_quelldatein}/aufbau/aufgabe_.ts \ + ${dir_quelldatein}/aufbau/modus.ts \ + ${dir_quelldatein}/aufbau/partie.ts \ + ${dir_quelldatein}/manifestation/manifestation.ts \ + ${dir_quelldatein}/manifestation/position.ts \ + ${dir_quelldatein}/manifestation/svg/svg.ts \ + ${dir_quelldatein}/manifestation/svg/figur.ts \ + ${dir_quelldatein}/manifestation/svg/aktor.ts \ + ${dir_quelldatein}/manifestation/svg/partie.ts \ + ${dir_quelldatein}/manifestation/web/partie.ts \ + ${dir_quelldatein}/manifestation/speicher/partie.ts \ + ${dir_quelldatein}/haupt.ts + @ ${cmd_echo} "-- Logik …" + @ ${cmd_md} ${dir_erzeugnis} + @ ${cmd_tsc} \ + ${dir_quelldatein}/basis/typen.ts \ + ${dir_quelldatein}/basis/fehlermonade.ts \ + ${dir_quelldatein}/helfer/verschiedenes.ts \ + ${dir_quelldatein}/helfer/mathematik.ts \ + ${dir_quelldatein}/helfer/vektor.ts \ + ${dir_quelldatein}/helfer/hashmap.ts \ + ${dir_quelldatein}/helfer/xmlknoten.ts \ + ${dir_quelldatein}/helfer/uebersetzung.ts \ + ${dir_quelldatein}/daten.ts \ + ${dir_quelldatein}/aufbau/richtung.ts \ + ${dir_quelldatein}/aufbau/symbol.ts \ + ${dir_quelldatein}/aufbau/stelle.ts \ + ${dir_quelldatein}/aufbau/zustand.ts \ + ${dir_quelldatein}/aufbau/figur.ts \ + ${dir_quelldatein}/aufbau/aktor.ts \ + ${dir_quelldatein}/aufbau/erzeuger.ts \ + ${dir_quelldatein}/aufbau/befoerderer.ts \ + ${dir_quelldatein}/aufbau/schreiber.ts \ + ${dir_quelldatein}/aufbau/leser.ts \ + ${dir_quelldatein}/aufbau/verwerfer.ts \ + ${dir_quelldatein}/aufbau/annehmer.ts \ + ${dir_quelldatein}/aufbau/aktor_.ts \ + ${dir_quelldatein}/aufbau/welt.ts \ + ${dir_quelldatein}/aufbau/test.ts \ + ${dir_quelldatein}/aufbau/akzeptortest.ts \ + ${dir_quelldatein}/aufbau/transduktortest.ts \ + ${dir_quelldatein}/aufbau/aufgabe.ts \ + ${dir_quelldatein}/aufbau/akzeptoraufgabe.ts \ + ${dir_quelldatein}/aufbau/transduktoraufgabe.ts \ + ${dir_quelldatein}/aufbau/aufgabe_.ts \ + ${dir_quelldatein}/aufbau/modus.ts \ + ${dir_quelldatein}/aufbau/partie.ts \ + ${dir_quelldatein}/manifestation/manifestation.ts \ + ${dir_quelldatein}/manifestation/position.ts \ + ${dir_quelldatein}/manifestation/svg/svg.ts \ + ${dir_quelldatein}/manifestation/svg/figur.ts \ + ${dir_quelldatein}/manifestation/svg/aktor.ts \ + ${dir_quelldatein}/manifestation/svg/partie.ts \ + ${dir_quelldatein}/manifestation/web/partie.ts \ + ${dir_quelldatein}/manifestation/speicher/partie.ts \ + ${dir_quelldatein}/haupt.ts \ + --outFile ${dir_erzeugnis}/vtm.js diff --git a/quelldatein/aufbau/aktor.ts b/quelldatein/aufbau/aktor.ts index 2e4172c..01ed6ce 100644 --- a/quelldatein/aufbau/aktor.ts +++ b/quelldatein/aufbau/aktor.ts @@ -36,6 +36,18 @@ module mod_vtm_aufbau */ verwenden(figur : klasse_figur) : void; + + /** + * @author kcf + */ + exportieren() : any; + + + /** + * @author kcf + */ + // static importieren(roh : any) : schnittstelle_aktor; + } } diff --git a/quelldatein/aufbau/aktor_.ts b/quelldatein/aufbau/aktor_.ts new file mode 100644 index 0000000..d65eeaf --- /dev/null +++ b/quelldatein/aufbau/aktor_.ts @@ -0,0 +1,124 @@ +/* + * Verrückte Turing-Maschinen — A turing complete game + * Copyright (C) 2016 Christian Fraß + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +module mod_vtm_aufbau + { + + /** + * @author kcf + */ + export function aktor_exportieren(aktor : schnittstelle_aktor) : any + { + if (aktor instanceof klasse_erzeuger) + { + return { + "art": "erzeuger", + "angaben": aktor.exportieren() + }; + } + else if (aktor instanceof klasse_annehmer) + { + return { + "art": "annehmer", + "angaben": aktor.exportieren() + }; + } + else if (aktor instanceof klasse_verwerfer) + { + return { + "art": "verwerfer", + "angaben": aktor.exportieren() + }; + } + else if (aktor instanceof klasse_befoerderer) + { + return { + "art": "befoerderer", + "angaben": aktor.exportieren() + }; + } + else if (aktor instanceof klasse_schreiber) + { + return { + "art": "schreiber", + "angaben": aktor.exportieren() + }; + } + else if (aktor instanceof klasse_leser) + { + return { + "art": "leser", + "angaben": aktor.exportieren() + }; + } + else + { + let meldung : string = "unbehandelte Klasse"; + throw (new Error(meldung)); + } + } + + + /** + * @author kcf + */ + export function aktor_importieren(aktor_roh : any) : schnittstelle_aktor + { + switch (aktor_roh["art"]) + { + case "erzeuger": + { + return klasse_erzeuger.importieren(aktor_roh["angaben"]); + break; + } + case "annehmer": + { + return klasse_annehmer.importieren(aktor_roh["angaben"]); + break; + } + case "verwerfer": + { + return klasse_verwerfer.importieren(aktor_roh["angaben"]); + break; + } + case "befoerderer": + { + return klasse_befoerderer.importieren(aktor_roh["angaben"]); + break; + } + case "schreiber": + { + return klasse_schreiber.importieren(aktor_roh["angaben"]); + break; + } + case "leser": + { + return klasse_leser.importieren(aktor_roh["angaben"]); + break; + } + default: + { + let meldung : string = "unbehandelte Art"; + throw (new Error(meldung)); + break; + } + } + } + + } + diff --git a/quelldatein/aufbau/akzeptoraufgabe.ts b/quelldatein/aufbau/akzeptoraufgabe.ts index 6edb708..ea8d985 100644 --- a/quelldatein/aufbau/akzeptoraufgabe.ts +++ b/quelldatein/aufbau/akzeptoraufgabe.ts @@ -26,6 +26,12 @@ module mod_vtm_aufbau implements schnittstelle_aufgabe { + /** + * @author kcf + */ + private id : string; + + /** * @author kcf */ @@ -47,14 +53,25 @@ module mod_vtm_aufbau /** * @author kcf */ - public constructor(titel : string, text : string, tests : Array) + public constructor(id : string, titel : string, text : string, tests : Array) { + this.id = id; this.titel_ = titel; this.text_ = text; this.tests_ = tests; } + /** + * @author kcf + * @implementation + */ + public id_lesen() : string + { + return this.id; + } + + /** * @author kcf * @implementation diff --git a/quelldatein/aufbau/annehmer.ts b/quelldatein/aufbau/annehmer.ts index d97046a..f331463 100644 --- a/quelldatein/aufbau/annehmer.ts +++ b/quelldatein/aufbau/annehmer.ts @@ -52,6 +52,31 @@ module mod_vtm_aufbau figur.annehmen(); } + + /** + * @author kcf + * @implementation + */ + public exportieren() : any + { + return { + }; + } + + + /** + * @author kcf + * @implementation + */ + public static importieren(roh : any) : klasse_annehmer + { + return ( + new klasse_annehmer + ( + ) + ); + } + } } diff --git a/quelldatein/aufbau/aufgabe.ts b/quelldatein/aufbau/aufgabe.ts index 1f6d59b..4ef4b54 100644 --- a/quelldatein/aufbau/aufgabe.ts +++ b/quelldatein/aufbau/aufgabe.ts @@ -25,6 +25,12 @@ module mod_vtm_aufbau export interface schnittstelle_aufgabe { + /** + * @author kcf + */ + id_lesen() : string; + + /** * @author kcf */ diff --git a/quelldatein/aufbau/aufgabe_.ts b/quelldatein/aufbau/aufgabe_.ts index efca4d4..9b94236 100644 --- a/quelldatein/aufbau/aufgabe_.ts +++ b/quelldatein/aufbau/aufgabe_.ts @@ -37,6 +37,7 @@ module mod_vtm_aufbau return ( new klasse_akzeptoraufgabe ( + aufgabe_roh["id"], aufgabe_roh["parameter"]["titel"], aufgabe_roh["parameter"]["text"], aufgabe_roh["parameter"]["tests"].map @@ -52,6 +53,7 @@ module mod_vtm_aufbau return ( new klasse_transduktoraufgabe ( + aufgabe_roh["id"], aufgabe_roh["parameter"]["titel"], aufgabe_roh["parameter"]["text"], aufgabe_roh["parameter"]["tests"].map diff --git a/quelldatein/aufbau/befoerderer.ts b/quelldatein/aufbau/befoerderer.ts index 37882b1..345ca96 100644 --- a/quelldatein/aufbau/befoerderer.ts +++ b/quelldatein/aufbau/befoerderer.ts @@ -69,6 +69,33 @@ module mod_vtm_aufbau figur.bewegen(this.richtung); } + + /** + * @author kcf + * @implementation + */ + public exportieren() : any + { + return { + "richtung": richtung_exportieren(this.richtung), + }; + } + + + /** + * @author kcf + * @implementation + */ + public static importieren(roh : any) : klasse_befoerderer + { + return ( + new klasse_befoerderer + ( + richtung_importieren(roh["richtung"]) + ) + ); + } + } } diff --git a/quelldatein/aufbau/erzeuger.ts b/quelldatein/aufbau/erzeuger.ts index b849415..ac9332e 100644 --- a/quelldatein/aufbau/erzeuger.ts +++ b/quelldatein/aufbau/erzeuger.ts @@ -69,6 +69,33 @@ module mod_vtm_aufbau figur.bewegen(this.richtung); } + + /** + * @author kcf + * @implementation + */ + public exportieren() : any + { + return { + "richtung": richtung_exportieren(this.richtung), + }; + } + + + /** + * @author kcf + * @implementation + */ + public static importieren(roh : any) : klasse_erzeuger + { + return ( + new klasse_erzeuger + ( + richtung_importieren(roh["richtung"]) + ) + ); + } + } } diff --git a/quelldatein/aufbau/leser.ts b/quelldatein/aufbau/leser.ts index 39af600..c348820 100644 --- a/quelldatein/aufbau/leser.ts +++ b/quelldatein/aufbau/leser.ts @@ -126,6 +126,37 @@ module mod_vtm_aufbau figur.bewegen(richtung); } + + /** + * @author kcf + * @implementation + */ + public exportieren() : any + { + return { + "richtung": richtung_exportieren(this.richtung), + "symbol_links": symbol_exportieren(this.symbol_links), + "symbol_rechts": symbol_exportieren(this.symbol_rechts), + }; + } + + + /** + * @author kcf + * @implementation + */ + public static importieren(roh : any) : klasse_leser + { + return ( + new klasse_leser + ( + richtung_importieren(roh["richtung"]), + symbol_importieren(roh["symbol_links"]), + symbol_importieren(roh["symbol_rechts"]) + ) + ); + } + } } diff --git a/quelldatein/aufbau/partie.ts b/quelldatein/aufbau/partie.ts index 7660910..4a546f5 100644 --- a/quelldatein/aufbau/partie.ts +++ b/quelldatein/aufbau/partie.ts @@ -122,22 +122,6 @@ module mod_vtm_aufbau } - /** - * @author kcf - */ - public welt_leeren(bescheid_geben : boolean = true) : void - { - this.welt = klasse_welt.blanko(); - if (bescheid_geben) - { - this.benachrichtigen("aenderung_welt", {}); - } - else - { - // nichts tun - } - } - /** * @author kcf */ @@ -173,7 +157,7 @@ module mod_vtm_aufbau public aufgabe_setzen(aufgabe : schnittstelle_aufgabe) : void { this.aufgabe = aufgabe; - this.welt_leeren(); + // this.welt_leeren(); this.benachrichtigen("aenderung_aufgabe", {}); this.zuruecksetzen(); } @@ -188,6 +172,40 @@ module mod_vtm_aufbau } + /** + * @author kcf + */ + public welt_setzen(welt : mod_vtm_aufbau.klasse_welt, bescheid_geben : boolean = true) : void + { + this.welt = welt; + if (bescheid_geben) + { + this.benachrichtigen("aenderung_welt", {}); + } + else + { + // nichts tun + } + } + + + /** + * @author kcf + */ + public welt_leeren(bescheid_geben : boolean = true) : void + { + this.welt = klasse_welt.blanko(); + if (bescheid_geben) + { + this.benachrichtigen("aenderung_welt", {}); + } + else + { + // nichts tun + } + } + + /** * @author kcf */ @@ -218,7 +236,20 @@ module mod_vtm_aufbau else { this.welt.feld_wechseln(stelle, umgekehrt); - this.benachrichtigen("aenderung_welt", {}); + this.benachrichtigen + ( + "aenderung_welt", + { + "art": "feld_wechseln", + "angaben": + { + "stelle": stelle, + "umgekehrt": umgekehrt, + "feld": this.welt.feld_holen(stelle), + } + } + ) + ; } } @@ -341,7 +372,7 @@ module mod_vtm_aufbau } } } - + } } diff --git a/quelldatein/aufbau/richtung.ts b/quelldatein/aufbau/richtung.ts index 52ac83f..c02891b 100644 --- a/quelldatein/aufbau/richtung.ts +++ b/quelldatein/aufbau/richtung.ts @@ -33,5 +33,23 @@ module mod_vtm_aufbau return mod_vtm_helfer.mod(richtung1 + richtung2, 6); } + + /** + * @author kcf + */ + export function richtung_exportieren(richtung : typ_richtung) : int + { + return richtung; + } + + + /** + * @author kcf + */ + export function richtung_importieren(richtung_ : int) : typ_richtung + { + return richtung_; + } + } diff --git a/quelldatein/aufbau/schreiber.ts b/quelldatein/aufbau/schreiber.ts index 7205992..3a236d0 100644 --- a/quelldatein/aufbau/schreiber.ts +++ b/quelldatein/aufbau/schreiber.ts @@ -86,6 +86,35 @@ module mod_vtm_aufbau figur.bewegen(this.richtung); } + + /** + * @author kcf + * @implementation + */ + public exportieren() : any + { + return { + "richtung": richtung_exportieren(this.richtung), + "symbol": symbol_exportieren(this.symbol), + }; + } + + + /** + * @author kcf + * @implementation + */ + public static importieren(roh : any) : klasse_schreiber + { + return ( + new klasse_schreiber + ( + richtung_importieren(roh["richtung"]), + symbol_importieren(roh["symbol"]) + ) + ); + } + } } diff --git a/quelldatein/aufbau/stelle.ts b/quelldatein/aufbau/stelle.ts index 3a62a27..df378d0 100644 --- a/quelldatein/aufbau/stelle.ts +++ b/quelldatein/aufbau/stelle.ts @@ -78,6 +78,24 @@ module mod_vtm_aufbau { return {"u": (stelle1.u + stelle2.u), "v": (stelle1.v + stelle2.v)}; } + + /** + * @author kcf + */ + export function stelle_exportieren(stelle : typ_stelle) : string + { + return stelle_hash(stelle); + } + + + /** + * @author kcf + */ + export function stelle_importieren(stelle_ : string) : typ_stelle + { + return stelle_von_hash(stelle_); + } + } diff --git a/quelldatein/aufbau/symbol.ts b/quelldatein/aufbau/symbol.ts index e5b2cc7..e81d5f5 100644 --- a/quelldatein/aufbau/symbol.ts +++ b/quelldatein/aufbau/symbol.ts @@ -33,5 +33,23 @@ module mod_vtm_aufbau return (symbol1 === symbol2); } + + /** + * @author kcf + */ + export function symbol_exportieren(symbol : typ_symbol) : int + { + return symbol; + } + + + /** + * @author kcf + */ + export function symbol_importieren(symbol_ : int) : typ_symbol + { + return symbol_; + } + } diff --git a/quelldatein/aufbau/transduktoraufgabe.ts b/quelldatein/aufbau/transduktoraufgabe.ts index 4819662..9fdec85 100644 --- a/quelldatein/aufbau/transduktoraufgabe.ts +++ b/quelldatein/aufbau/transduktoraufgabe.ts @@ -26,6 +26,12 @@ module mod_vtm_aufbau implements schnittstelle_aufgabe { + /** + * @author kcf + */ + private id : string; + + /** * @author kcf */ @@ -47,14 +53,25 @@ module mod_vtm_aufbau /** * @author kcf */ - public constructor(titel : string, text : string, tests : Array) + public constructor(id : string, titel : string, text : string, tests : Array) { + this.id = id; this.titel_ = titel; this.text_ = text; this.tests_ = tests; } + /** + * @author kcf + * @implementation + */ + public id_lesen() : string + { + return this.id; + } + + /** * @author kcf * @implementation diff --git a/quelldatein/aufbau/verwerfer.ts b/quelldatein/aufbau/verwerfer.ts index 9b1afde..d837a94 100644 --- a/quelldatein/aufbau/verwerfer.ts +++ b/quelldatein/aufbau/verwerfer.ts @@ -52,6 +52,31 @@ module mod_vtm_aufbau figur.verwerfen(); } + + /** + * @author kcf + * @implementation + */ + public exportieren() : any + { + return { + }; + } + + + /** + * @author kcf + * @implementation + */ + public static importieren(roh : any) : klasse_verwerfer + { + return ( + new klasse_verwerfer + ( + ) + ); + } + } } diff --git a/quelldatein/aufbau/welt.ts b/quelldatein/aufbau/welt.ts index 424fd34..e9ed907 100644 --- a/quelldatein/aufbau/welt.ts +++ b/quelldatein/aufbau/welt.ts @@ -36,7 +36,7 @@ module mod_vtm_aufbau */ public constructor ( - felder : mod_vtm_helfer.klasse_hashmap = new mod_vtm_helfer.klasse_hashmap(stelle_hash) + felder : mod_vtm_helfer.klasse_hashmap = (new mod_vtm_helfer.klasse_hashmap(stelle_hash)) ) { this.felder = felder; @@ -298,6 +298,50 @@ module mod_vtm_aufbau } return welt; } + + + /** + * @author kcf + */ + public exportieren() : any + { + let roh : any = {}; + roh["felder"] = {}; + this.felder.iterieren + ( + (stelle, aktor) => + { + let stelle_ : string = stelle_exportieren(stelle); + let aktor_ : any = aktor_exportieren(aktor); + roh["felder"][stelle_] = aktor_; + } + ) + ; + return roh; + } + + + /** + * @author kcf + */ + public static importieren(roh : any) : klasse_welt + { + let felder : mod_vtm_helfer.klasse_hashmap = (new mod_vtm_helfer.klasse_hashmap(stelle_hash)); + for (let stelle_ in roh["felder"]) + { + let stelle : typ_stelle = stelle_importieren(stelle_); + let aktor_ : schnittstelle_aktor = roh["felder"][stelle_]; + let aktor : schnittstelle_aktor = aktor_importieren(aktor_); + felder.setzen(stelle, aktor); + } + return ( + new klasse_welt + ( + felder + ) + ); + } + } } diff --git a/quelldatein/daten/aufgaben.dat.js b/quelldatein/daten/aufgaben.dat.js index 0af2668..f45a867 100644 --- a/quelldatein/daten/aufgaben.dat.js +++ b/quelldatein/daten/aufgaben.dat.js @@ -3,6 +3,7 @@ jsonp_behandlung( "schluessel": "aufgaben", "wert": [ { + "id": "einfuehrung", "art": "akzeptor", "parameter": { "titel": "Einführung", @@ -16,6 +17,7 @@ jsonp_behandlung( } }, { + "id": "start_symbol", "art": "akzeptor", "parameter": { "titel": "Start-Symbol", @@ -45,6 +47,7 @@ jsonp_behandlung( } }, { + "id": "dreifaltigkeit", "art": "akzeptor", "parameter": { "titel": "Dreifaltigkeit", @@ -66,6 +69,7 @@ jsonp_behandlung( } }, { + "id": "abwechslung_erfreuet", "art": "akzeptor", "parameter": { "titel": "Abwechslung erfreuet", @@ -95,6 +99,7 @@ jsonp_behandlung( } }, { + "id": "ans_ende", "art": "transduktor", "parameter": { "titel": "Ans Ende", @@ -108,6 +113,7 @@ jsonp_behandlung( } }, { + "id": "tauschen", "art": "transduktor", "parameter": { "titel": "Tauschen", @@ -125,10 +131,11 @@ jsonp_behandlung( } }, { + "id": "waehlerisch", "art": "transduktor", "parameter": { "titel": "Wählerisch", - "text": "aus der Eingabe (${s0} / ${s1}) alle ${s0} entfernen und alle ${s1} beibehalten", + "text": "aus der Eingabe alle ${s0} entfernen und alle ${s1} beibehalten", "tests": [ { "eingabe": [0,0,0,1,0], @@ -150,6 +157,7 @@ jsonp_behandlung( } }, { + "id": "dekorator", "art": "transduktor", "parameter": { "titel": "Dekorator", @@ -167,10 +175,11 @@ jsonp_behandlung( } }, { + "id": "alpha_und_omega", "art": "akzeptor", "parameter": { "titel": "Alpha und Omega", - "text": "Eingaben(${s0} / ${s1}), die mit den gleichen Symbolen anfangen und enden", + "text": "Eingaben (${s0} / ${s1}), die mit den gleichen Symbolen anfangen und enden", "tests": [ { "eingabe": [], @@ -200,6 +209,7 @@ jsonp_behandlung( } }, { + "id": "an_den_anfang", "art": "transduktor", "parameter": { "titel": "An den Anfang", @@ -213,6 +223,7 @@ jsonp_behandlung( } }, { + "id": "a_n_b_n", "art": "akzeptor", "parameter": { "titel": "a^n b^n", @@ -238,6 +249,9 @@ jsonp_behandlung( "eingabe": [0,0,0,0,0,0,0,1,1,1,1,1,1,1], "annehmen": true } + ], + "hinweise": [ + "Ein Wort ist genau dann Element der Sprache ${s0}^n ${s1}^n, wenn sie entweder 1) leer ist (also n = 0 gilt) oder 2) sie mit ${s0} beginnt, mit ${s1} endet und dazwischen ein Wort der Form ${s0}^(n-1) ${s1}^(n-1) steht … Stichwort: Rekursion" ] } } diff --git a/quelldatein/haupt.ts b/quelldatein/haupt.ts index 0a580f1..14ed1b8 100644 --- a/quelldatein/haupt.ts +++ b/quelldatein/haupt.ts @@ -39,8 +39,8 @@ function aufgaben_eintragen(behandler : (aufgabe : mod_vtm_aufbau.schnittstelle_ { let praefix : string = ( { - "akzeptor": "AKZ", - "transduktor": "TRA", + "akzeptor": mod_vtm_helfer.uebersetzung_holen("aufbau.aufgaben.arten.akzeptor.kuerzel"), + "transduktor": mod_vtm_helfer.uebersetzung_holen("aufbau.aufgaben.arten.transduktor.kuerzel"), }[aufgabe_roh["art"]] ); let titel : string = ("[" + praefix + "]" + " " + aufgabe_roh["parameter"]["titel"]); @@ -78,7 +78,7 @@ function aufgaben_eintragen(behandler : (aufgabe : mod_vtm_aufbau.schnittstelle_ */ function haupt() : void { - // uebersetzungen + // Übersetzungen { let sprachen : Array = navigator.languages.map(sprache => sprache); let sprache_nativ : string = "de"; @@ -87,9 +87,9 @@ function haupt() : void mod_vtm_helfer.uebersetzung_einrichten(sprachen); mod_vtm_helfer.uebersetzung_anwenden(document); } - // hilfe + // Hilfe { - // einleitung + // Einleitung { document.querySelector("#hilfe_einleitung").innerHTML = ( mod_vtm_helfer.uebersetzung_holen @@ -103,9 +103,9 @@ function haupt() : void ) ); } - // aktoren + // Aktoren { - // arten + // Arten { let von_x : float = -0.5; let von_y : float = -0.5; @@ -116,27 +116,27 @@ function haupt() : void [ { "aufbau": (new mod_vtm_aufbau.klasse_erzeuger()), - "kontext": document.querySelector("#hilfe_aktoren_aktor_erzeuger"), + "bereich": document.querySelector("#hilfe_aktoren_aktor_erzeuger"), }, { "aufbau": (new mod_vtm_aufbau.klasse_annehmer()), - "kontext": document.querySelector("#hilfe_aktoren_aktor_annehmer"), + "bereich": document.querySelector("#hilfe_aktoren_aktor_annehmer"), }, { "aufbau": (new mod_vtm_aufbau.klasse_verwerfer()), - "kontext": document.querySelector("#hilfe_aktoren_aktor_verwerfer"), + "bereich": document.querySelector("#hilfe_aktoren_aktor_verwerfer"), }, { "aufbau": (new mod_vtm_aufbau.klasse_befoerderer()), - "kontext": document.querySelector("#hilfe_aktoren_aktor_befoerderer"), + "bereich": document.querySelector("#hilfe_aktoren_aktor_befoerderer"), }, { "aufbau": (new mod_vtm_aufbau.klasse_schreiber()), - "kontext": document.querySelector("#hilfe_aktoren_aktor_schreiber"), + "bereich": document.querySelector("#hilfe_aktoren_aktor_schreiber"), }, { "aufbau": (new mod_vtm_aufbau.klasse_leser()), - "kontext": document.querySelector("#hilfe_aktoren_aktor_leser"), + "bereich": document.querySelector("#hilfe_aktoren_aktor_leser"), }, ] .forEach @@ -145,14 +145,14 @@ function haupt() : void { let manifestor = (new mod_vtm_manifestation.klasse_svg_aktor(eintrag.aufbau, mod_vtm_aufbau.stelle_null())); let xmlknoten : mod_vtm_helfer.schnittstelle_xmlknoten = mod_vtm_manifestation.svg_wurzel(von_x, von_y, bis_x, bis_y, breite, hoehe, [manifestor.darstellen()]); - eintrag.kontext.querySelector(".hilfe_aktoren_aktor_bild").innerHTML = xmlknoten.darstellen(); + eintrag.bereich.querySelector(".hilfe_aktoren_aktor_bild").innerHTML = xmlknoten.darstellen(); } ) ; } } } - // spiel + // Spiel { let aufbau : mod_vtm_aufbau.klasse_partie; aufgaben_eintragen @@ -162,6 +162,7 @@ function haupt() : void ; aufbau = (new mod_vtm_aufbau.klasse_partie(mod_vtm_aufbau.aufgabe_holen(0))); (new mod_vtm_manifestation.klasse_web_partie(aufbau, document.querySelector("#bereich_mitte"))).einrichten(); + (new mod_vtm_manifestation.klasse_speicher_partie(aufbau)).einrichten(); } } diff --git a/quelldatein/manifestation/speicher/partie.ts b/quelldatein/manifestation/speicher/partie.ts new file mode 100644 index 0000000..6f4cf07 --- /dev/null +++ b/quelldatein/manifestation/speicher/partie.ts @@ -0,0 +1,124 @@ +/* + * Verrückte Turing-Maschinen — A turing complete game + * Copyright (C) 2016 Christian Fraß + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +module mod_vtm_manifestation + { + + /** + * @author kcf + */ + export class klasse_speicher_partie + extends klasse_manifestation + { + + /** + * @author kcf + */ + public constructor(aufbau : mod_vtm_aufbau.klasse_partie) + { + super(aufbau); + } + + + /** + * @author kcf + * @override + */ + public einrichten() : void + { + this.aufbau.lauschen + ( + "aenderung_aufgabe", + (angaben) => + { + // console.info("aenderung_aufgabe", angaben); + let id : string = this.aufbau.aufgabe_lesen().id_lesen(); + let key : string = ("vtm_" + id); + if (key in localStorage) + { + let item : string = localStorage.getItem(key); + let welt : mod_vtm_aufbau.klasse_welt = mod_vtm_aufbau.klasse_welt.importieren(JSON.parse(item)); + this.aufbau.welt_setzen(welt, false); + } + else + { + this.aufbau.welt_leeren(); + // nichts tun + } + } + ) + ; + this.aufbau.lauschen + ( + "aenderung_welt", + (angaben) => + { + let id : string = this.aufbau.aufgabe_lesen().id_lesen(); + let key : string = ("vtm_" + id); + let item : string = JSON.stringify(this.aufbau.welt_lesen().exportieren()); + localStorage.setItem(key, item); + } + ) + ; + this.aufbau.lauschen + ( + "aenderung_figur", + (angaben) => + { + // console.info("aenderung_figur", angaben); + } + ) + ; + this.aufbau.lauschen + ( + "aenderung_modus", + (angaben) => + { + // console.info("aenderung_modus", angaben); + } + ) + ; + this.darstellen(); + this.binden(); + } + + + /** + * @author kcf + * @implementation + */ + public darstellen() : void + { + console.warn("empty"); + } + + + + /** + * @author kcf + * @implementation + */ + public binden() : void + { + console.warn("empty"); + } + + } + + } + diff --git a/quelldatein/manifestation/web/partie.css b/quelldatein/manifestation/web/partie.css deleted file mode 100644 index a3f9643..0000000 --- a/quelldatein/manifestation/web/partie.css +++ /dev/null @@ -1,86 +0,0 @@ -.rahmen - { - stroke: none; - fill: hsl( 0, 0%, 25%); - } - -.rahmen:hover - { - /* - fill: hsl( 0, 0%, 37.5%); - transition: 0.25s ease; - */ - } - -.figur - { - stroke: none; - fill: hsl( 0, 0%, 0%); - } - -.pfeil - { - stroke: none; - } - -.erzeuger - { - fill: hsl( 0, 0%, 100%); - } - -.neutral - { - fill: hsl( 0, 0%, 50%); - } - -.symbol_0 - { - fill: hsl(000.0000000000000, 50%, 50%); - background-color: hsl(000.0000000000000, 50%, 50%); - } - -.symbol_1 - { - fill: hsl(222.4922359499621, 50%, 50%); - background-color: hsl(222.4922359499621, 50%, 50%); - } - -.symbol_2 - { - fill: hsl(084.9844718999243, 50%, 50%); - background-color: hsl(084.9844718999243, 50%, 50%); - } - -.symbol_3 - { - fill: hsl(307.4767078498864, 50%, 50%); - background-color: hsl(307.4767078498864, 50%, 50%); - } - -.kreis - { - stroke: none; - } - -.positiv - { - fill: hsl( 0, 0%, 100%); - } - -.negativ - { - /* - fill: hsl( 0, 0%, 0%); - */ - display: none; - } - -.eintrag - { - /* - stroke: black; - stroke-width: 0.01; - */ - stroke: none; - } - diff --git a/quelldatein/manifestation/web/partie.scss b/quelldatein/manifestation/web/partie.scss new file mode 100644 index 0000000..c0a4edd --- /dev/null +++ b/quelldatein/manifestation/web/partie.scss @@ -0,0 +1,122 @@ +/* + * Verrückte Turing-Maschinen — A turing complete game + * Copyright (C) 2016 Christian Fraß + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +$phi: 0.6180339887498949; + +/* +$farbton_symbol_0: 000.0000000000000; +$farbton_symbol_1: 222.4922359499621; +$farbton_symbol_2: 084.9844718999243; +$farbton_symbol_3: 307.4767078498864; + */ + +$offset: 0; +$farbton_symbol_0: ((($phi*($offset+0))%1)*360); +$farbton_symbol_1: ((($phi*($offset+1))%1)*360); +$farbton_symbol_2: ((($phi*($offset+2))%1)*360); +$farbton_symbol_3: ((($phi*($offset+3))%1)*360); + +$saettigung_symbol: 50%; +$helligkeit_symbol: 50%; + +.rahmen + { + stroke: none; + fill: hsl( 0, 0%, 25%); + } + +.rahmen:hover + { + /* + fill: hsl( 0, 0%, 37.5%); + transition: 0.25s ease; + */ + } + +.figur + { + stroke: none; + fill: hsl( 0, 0%, 0%); + } + +.pfeil + { + stroke: none; + } + +.erzeuger + { + fill: hsl( 0, 0%, 100%); + } + +.neutral + { + fill: hsl( 0, 0%, 50%); + } + +.symbol_0 + { + fill: hsl($farbton_symbol_0, $saettigung_symbol, $helligkeit_symbol); + background-color: hsl($farbton_symbol_0, $saettigung_symbol, $helligkeit_symbol); + } + +.symbol_1 + { + fill: hsl($farbton_symbol_1, $saettigung_symbol, $helligkeit_symbol); + background-color: hsl($farbton_symbol_1, $saettigung_symbol, $helligkeit_symbol); + } + +.symbol_2 + { + fill: hsl($farbton_symbol_2, $saettigung_symbol, $helligkeit_symbol); + background-color: hsl($farbton_symbol_2, $saettigung_symbol, $helligkeit_symbol); + } + +.symbol_3 + { + fill: hsl($farbton_symbol_3, $saettigung_symbol, $helligkeit_symbol); + background-color: hsl($farbton_symbol_3, $saettigung_symbol, $helligkeit_symbol); + } + +.kreis + { + stroke: none; + } + +.positiv + { + fill: hsl( 0, 0%, 100%); + } + +.negativ + { + /* + fill: hsl( 0, 0%, 0%); + */ + display: none; + } + +.eintrag + { + /* + stroke: black; + stroke-width: 0.01; + */ + stroke: none; + } + diff --git a/quelldatein/manifestation/web/partie.ts b/quelldatein/manifestation/web/partie.ts index 348a2f0..6f801f3 100644 --- a/quelldatein/manifestation/web/partie.ts +++ b/quelldatein/manifestation/web/partie.ts @@ -56,6 +56,7 @@ module mod_vtm_manifestation super(aufbau); this.bereich = bereich; this.intervall = (new klasse_nichts()); + /* this.aufbau.lauschen ( "aenderung_welt", @@ -65,6 +66,7 @@ module mod_vtm_manifestation } ) ; + */ } diff --git a/quelldatein/manifestation/web/vtm.css b/quelldatein/manifestation/web/vtm.css deleted file mode 100644 index b397421..0000000 --- a/quelldatein/manifestation/web/vtm.css +++ /dev/null @@ -1,168 +0,0 @@ -html - { - margin: 0; - height: 100%; - - background-color: hsl(120, 0%, 0%); - color: hsl(120, 0%, 100%); - - font-family: monospace; - line-height: 200%; - } - -body - { - margin: 0; - padding: 8px; - height: 100%; - - background-color: hsl(120, 0%, 6.125%); - color: hsl(120, 0%, 93.75%); - } - -a - { - color: hsl(120, 50%, 50%); - text-decoration: none; - cursor: pointer; - } - -a:hover - { - color: hsl(120, 50%, 75%); - } - -li - { - list-style-type: "» "; - } - -body > header - { - font-size: 200%; - margin: 8px; - } - -#radio_hilfe, -#radio_spiel - { - display: none; - } - -#radio_hilfe:checked ~ #hilfe {} -#radio_hilfe:checked ~ #spiel {display: none;} - -#radio_spiel:checked ~ #hilfe {display: none;} -#radio_spiel:checked ~ #spiel {} - -#spiel - { - display: flex; - flex-direction: row; - flex-wrap: nowrap; - } - -.bereich - { - margin: 8px; - padding: 8px; - - background-color: hsl(120, 0%, 12.5%); - color: hsl(120, 0%, 87.5%); - } - -#bereich_links - { - flex-basis: 19%; - flex-grow: 1; - flex-shrink: 1; - } - -#bereich_mitte - { - flex-basis: 62%; - flex-grow: 1; - flex-shrink: 0; - - min-width: 800px; - - text-align: center; - } - -#bereich_rechts - { - flex-basis: 19%; - flex-grow: 1; - flex-shrink: 1; - } - -#hilfe section > header - { - font-size: 150%; - } - -#knoepfe > * - { - margin: 2px; - } - -#knoepfe.initial > #knopf_schritt {} -#knoepfe.initial > #knopf_testen {} -#knoepfe.initial > #knopf_anhalten {display: none;} -#knoepfe.initial > #knopf_bearbeiten {display: none;} -#knoepfe.initial > #knopf_leeren {} - -#knoepfe.ungewiss_laufend > #knopf_schritt {display: none;} -#knoepfe.ungewiss_laufend > #knopf_testen {display: none;} -#knoepfe.ungewiss_laufend > #knopf_anhalten {} -#knoepfe.ungewiss_laufend > #knopf_bearbeiten {display: none;} -#knoepfe.ungewiss_laufend > #knopf_leeren {display: none;} - -#knoepfe.ungewiss_stehend > #knopf_schritt {} -#knoepfe.ungewiss_stehend > #knopf_testen {} -#knoepfe.ungewiss_stehend > #knopf_anhalten {display: none;} -#knoepfe.ungewiss_stehend > #knopf_bearbeiten {} -#knoepfe.ungewiss_stehend > #knopf_leeren {display: none;} - -#knoepfe.fertig > #knopf_schritt {display: none;} -#knoepfe.fertig > #knopf_testen {display: none;} -#knoepfe.fertig > #knopf_anhalten {display: none;} -#knoepfe.fertig > #knopf_bearbeiten {} -#knoepfe.fertig > #knopf_leeren {display: none;} - -#aufgabe_status - { - margin-bottom: 8px; - } - - -.hilfe_aktoren_aktor - { - display: flex; - flex-direction: row; - flex-wrap: wrap; - } - -.hilfe_aktoren_aktor > .hilfe_aktoren_aktor_name - { - flex-basis: 100%; - flex-shrink: 0; - flex-grow: 1; - - text-transform: capitalize; - } - -.hilfe_aktoren_aktor > .hilfe_aktoren_aktor_bild - { - flex-basis: 10%; - flex-shrink: 1; - flex-grow: 0; - } - -.hilfe_aktoren_aktor > .hilfe_aktoren_aktor_text - { - flex-basis: 90%; - flex-shrink: 1; - flex-grow: 1; - } - diff --git a/quelldatein/manifestation/web/vtm.html b/quelldatein/manifestation/web/vtm.html index 896a145..2a59281 100644 --- a/quelldatein/manifestation/web/vtm.html +++ b/quelldatein/manifestation/web/vtm.html @@ -3,7 +3,7 @@ - + @@ -48,7 +48,7 @@

!translate:hilfe.figur.satz1

!translate:hilfe.figur.satz2

-
+
!translate:aufbau.aktoren.woerter.plural

!translate:hilfe.aktoren.einleitung

    diff --git a/quelldatein/manifestation/web/vtm.scss b/quelldatein/manifestation/web/vtm.scss new file mode 100644 index 0000000..0d309da --- /dev/null +++ b/quelldatein/manifestation/web/vtm.scss @@ -0,0 +1,211 @@ +/* + * Verrückte Turing-Maschinen — A turing complete game + * Copyright (C) 2016 Christian Fraß + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +html + { + margin: 0; + /* + height: 100%; + */ + + background-color: hsl(120, 0%, 0%); + color: hsl(120, 0%, 100%); + + font-family: monospace; + line-height: 200%; + } + +body + { + margin: 0; + padding: 8px; + height: 100%; + + background-color: hsl(120, 0%, 6.125%); + color: hsl(120, 0%, 93.75%); + } + +a + { + color: hsl(120, 50%, 50%); + text-decoration: none; + cursor: pointer; + } + +a:hover + { + color: hsl(120, 50%, 75%); + } + +li + { + list-style-type: "» "; + } + +body > header + { + font-size: 200%; + margin: 8px; + } + +#radio_hilfe, +#radio_spiel + { + display: none; + } + +#radio_hilfe:checked + { + & ~ #hilfe {} + & ~ #spiel {display: none;} + } + +#radio_spiel:checked + { + & ~ #hilfe {display: none;} + & ~ #spiel {} + } + +#spiel + { + display: flex; + flex-direction: row; + flex-wrap: nowrap; + } + +.bereich + { + margin: 8px; + padding: 8px; + + background-color: hsl(120, 0%, 12.5%); + color: hsl(120, 0%, 87.5%); + } + +#bereich_links + { + flex-basis: 19%; + flex-grow: 1; + flex-shrink: 1; + } + +#bereich_mitte + { + flex-basis: 62%; + flex-grow: 1; + flex-shrink: 0; + + min-width: 800px; + + text-align: center; + } + +#bereich_rechts + { + flex-basis: 19%; + flex-grow: 1; + flex-shrink: 1; + } + +#hilfe section > header + { + font-size: 150%; + } + +#knoepfe + { + & > * + { + margin: 2px; + } + + &.initial + { + & > #knopf_schritt {} + & > #knopf_testen {} + & > #knopf_anhalten {display: none;} + & > #knopf_bearbeiten {display: none;} + & > #knopf_leeren {} + } + + &.ungewiss_laufend + { + & > #knopf_schritt {display: none;} + & > #knopf_testen {display: none;} + & > #knopf_anhalten {} + & > #knopf_bearbeiten {display: none;} + & > #knopf_leeren {display: none;} + } + + &.ungewiss_stehend + { + & > #knopf_schritt {} + & > #knopf_testen {} + & > #knopf_anhalten {display: none;} + & > #knopf_bearbeiten {} + & > #knopf_leeren {display: none;} + } + + &.fertig + { + & > #knopf_schritt {display: none;} + & > #knopf_testen {display: none;} + & > #knopf_anhalten {display: none;} + & > #knopf_bearbeiten {} + & > #knopf_leeren {display: none;} + } + } + +#aufgabe_status + { + margin-bottom: 8px; + } + +.hilfe_aktoren_aktor + { + display: flex; + flex-direction: row; + flex-wrap: wrap; + + margin-bottom: 16px; + + & > .hilfe_aktoren_aktor_name + { + flex-basis: 100%; + flex-shrink: 0; + flex-grow: 1; + + text-transform: capitalize; + font-weight: bold; + } + + & > .hilfe_aktoren_aktor_bild + { + flex-basis: 10%; + flex-shrink: 1; + flex-grow: 0; + } + + & > .hilfe_aktoren_aktor_text + { + flex-basis: 90%; + flex-shrink: 1; + flex-grow: 1; + } + } + diff --git a/werkzeuge/bauen.sh b/werkzeuge/bauen.sh index eddad46..3d449a8 100755 --- a/werkzeuge/bauen.sh +++ b/werkzeuge/bauen.sh @@ -1,4 +1,4 @@ #!/usr/bin/env sh -make +make all diff --git a/werkzeuge/zuruecksetzen.sh b/werkzeuge/zuruecksetzen.sh new file mode 100755 index 0000000..7773854 --- /dev/null +++ b/werkzeuge/zuruecksetzen.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env sh + +make clear +