zwischenspeicherung
This commit is contained in:
parent
494d9822ba
commit
e97b65c856
|
|
@ -279,7 +279,7 @@ module mod_vtm
|
|||
if (! partie.figur.ist_schlicht())
|
||||
{
|
||||
let test : mod_test.typ_test = mod_aufgabe.tests(partie.aufgabe)[partie.testindex.lesen()];
|
||||
let band : Array<mod_symbol.typ_symbol> = mod_vtm_helfer.liste_kopieren<mod_symbol.typ_symbol>(mod_test.eingabe(test));
|
||||
let band : Array<mod_symbol.typ_symbol> = mod_vtm.mod_helfer.liste_kopieren<mod_symbol.typ_symbol>(mod_test.eingabe(test));
|
||||
let stelle : mod_stelle.typ_stelle = mod_welt.erzeuger_finden(partie.welt);
|
||||
partie.figur = (
|
||||
new klasse_schlicht<mod_figur.typ_figur>
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ module mod_vtm
|
|||
*/
|
||||
export function addieren(richtung1 : typ_richtung, richtung2 : typ_richtung) : typ_richtung
|
||||
{
|
||||
return mod_vtm_helfer.mod(richtung1 + richtung2, 6);
|
||||
return mod_vtm.mod_helfer.mod_mathematik.mod(richtung1 + richtung2, 6);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ module mod_vtm
|
|||
)
|
||||
.concat
|
||||
(
|
||||
mod_vtm_helfer.sequenz(erweitert ? 4 : 2).map
|
||||
mod_vtm.mod_helfer.sequenz(erweitert ? 4 : 2).map
|
||||
(
|
||||
symbol => (
|
||||
{
|
||||
|
|
@ -125,7 +125,7 @@ module mod_vtm
|
|||
)
|
||||
.concat
|
||||
(
|
||||
mod_vtm_helfer.sequenz(erweitert ? 2 : 1).map
|
||||
mod_vtm.mod_helfer.sequenz(erweitert ? 2 : 1).map
|
||||
(
|
||||
index =>
|
||||
{
|
||||
|
|
@ -204,7 +204,7 @@ module mod_vtm
|
|||
}
|
||||
if (index_alt.ist_schlicht())
|
||||
{
|
||||
let index_neu : int = mod_vtm_helfer.mod(index_alt.lesen() + (umgekehrt ? -1 : +1), liste.length);
|
||||
let index_neu : int = mod_vtm.mod_helfer.mod_mathematik.mod(index_alt.lesen() + (umgekehrt ? -1 : +1), liste.length);
|
||||
let aktor_neu : mod_aktor.typ_aktor = liste[index_neu].ersteller();
|
||||
feld_setzen(welt, stelle, aktor_neu);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,8 +42,8 @@ module mod_vtm
|
|||
{
|
||||
let praefix : string = (
|
||||
{
|
||||
"akzeptor": mod_vtm_helfer.uebersetzung_holen("aufbau.aufgaben.arten.akzeptor.kuerzel"),
|
||||
"transduktor": mod_vtm_helfer.uebersetzung_holen("aufbau.aufgaben.arten.transduktor.kuerzel"),
|
||||
"akzeptor": mod_vtm.mod_helfer.mod_uebersetzung.holen("aufbau.aufgaben.arten.akzeptor.kuerzel"),
|
||||
"transduktor": mod_vtm.mod_helfer.mod_uebersetzung.holen("aufbau.aufgaben.arten.transduktor.kuerzel"),
|
||||
}[aufgabe_roh["art"]]
|
||||
);
|
||||
let titel : string = ("[" + praefix + "]" + " " + aufgabe_roh["parameter"]["titel"]);
|
||||
|
|
@ -87,15 +87,15 @@ module mod_vtm
|
|||
let sprache_nativ : string = "de";
|
||||
if (! sprachen[""+"includes"](sprache_nativ))
|
||||
sprachen.push(sprache_nativ);
|
||||
mod_vtm_helfer.uebersetzung_einrichten(sprachen);
|
||||
mod_vtm_helfer.uebersetzung_anwenden(document);
|
||||
mod_vtm.mod_helfer.mod_uebersetzung.einrichten(sprachen);
|
||||
mod_vtm.mod_helfer.mod_uebersetzung.anwenden(document);
|
||||
}
|
||||
// Hilfe
|
||||
{
|
||||
// Einleitung
|
||||
{
|
||||
document.querySelector("#hilfe_einleitung").innerHTML = (
|
||||
mod_vtm_helfer.uebersetzung_holen
|
||||
mod_vtm.mod_helfer.mod_uebersetzung.holen
|
||||
(
|
||||
"hilfe.einleitung",
|
||||
{
|
||||
|
|
|
|||
|
|
@ -16,7 +16,13 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
module mod_vtm_helfer
|
||||
module mod_vtm
|
||||
{
|
||||
|
||||
export module mod_helfer
|
||||
{
|
||||
|
||||
export module mod_mathematik
|
||||
{
|
||||
|
||||
/**
|
||||
|
|
@ -37,4 +43,6 @@ module mod_vtm_helfer
|
|||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,27 +16,33 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
module mod_vtm_helfer
|
||||
module mod_vtm
|
||||
{
|
||||
|
||||
export module mod_helfer
|
||||
{
|
||||
|
||||
export module mod_uebersetzung
|
||||
{
|
||||
|
||||
/**
|
||||
* @author kcf <vidofnir@folksprak.org>
|
||||
*/
|
||||
var _uebersetzung_sprachstapel : Array<string>;
|
||||
var _sprachstapel : Array<string>;
|
||||
|
||||
|
||||
/**
|
||||
* @author kcf <vidofnir@folksprak.org>
|
||||
*/
|
||||
export var _uebersetzung_daten : {[sprache : string] : {[schluessel : string] : string}} = {};
|
||||
var _daten : {[sprache : string] : {[schluessel : string] : string}} = {};
|
||||
|
||||
|
||||
/**
|
||||
* @author kcf <vidofnir@folksprak.org>
|
||||
*/
|
||||
export function uebersetzung_einrichten(sprachen : Array<string>) : void
|
||||
export function einrichten(sprachen : Array<string>) : void
|
||||
{
|
||||
_uebersetzung_sprachstapel = [];
|
||||
_sprachstapel = [];
|
||||
sprachen.forEach
|
||||
(
|
||||
sprache =>
|
||||
|
|
@ -45,12 +51,12 @@ module mod_vtm_helfer
|
|||
if (zeichenketten_roh_.ist_schlicht())
|
||||
{
|
||||
let zeichenketten_roh : {[schluessel : string] : string} = (<{[schluessel : string] : string}>(zeichenketten_roh_.lesen()));
|
||||
_uebersetzung_daten[sprache] = {};
|
||||
_daten[sprache] = {};
|
||||
for (let schluessel in zeichenketten_roh)
|
||||
{
|
||||
_uebersetzung_daten[sprache][schluessel] = (<string>(zeichenketten_roh[schluessel]));
|
||||
_daten[sprache][schluessel] = (<string>(zeichenketten_roh[schluessel]));
|
||||
}
|
||||
_uebersetzung_sprachstapel.push(sprache);
|
||||
_sprachstapel.push(sprache);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -66,11 +72,11 @@ module mod_vtm_helfer
|
|||
/**
|
||||
* @author kcf <vidofnir@folksprak.org>
|
||||
*/
|
||||
function uebersetzung_lesen(sprache : string, schluessel : string) : schnittstelle_fehlermonade<string>
|
||||
function lesen(sprache : string, schluessel : string) : schnittstelle_fehlermonade<string>
|
||||
{
|
||||
if (sprache in _uebersetzung_daten)
|
||||
if (sprache in _daten)
|
||||
{
|
||||
let satz : {[schluessel : string] : string} = _uebersetzung_daten[sprache];
|
||||
let satz : {[schluessel : string] : string} = _daten[sprache];
|
||||
if (schluessel in satz)
|
||||
{
|
||||
return (new klasse_schlicht<string>(satz[schluessel]));
|
||||
|
|
@ -94,16 +100,16 @@ module mod_vtm_helfer
|
|||
/**
|
||||
* @author kcf <vidofnir@folksprak.org>
|
||||
*/
|
||||
export function uebersetzung_holen(schluessel : string, vars : {[name : string] : string} = {}) : string
|
||||
export function holen(schluessel : string, vars : {[name : string] : string} = {}) : string
|
||||
{
|
||||
let ergebnis : schnittstelle_fehlermonade<string> = (new klasse_nichts<string>());
|
||||
let gefunden : boolean = (
|
||||
_uebersetzung_sprachstapel
|
||||
_sprachstapel
|
||||
.some
|
||||
(
|
||||
sprache =>
|
||||
{
|
||||
let ergebnis_ : schnittstelle_fehlermonade<string> = uebersetzung_lesen(sprache, schluessel);
|
||||
let ergebnis_ : schnittstelle_fehlermonade<string> = lesen(sprache, schluessel);
|
||||
if (ergebnis_.ist_schlicht())
|
||||
{
|
||||
ergebnis = ergebnis_;
|
||||
|
|
@ -137,7 +143,7 @@ module mod_vtm_helfer
|
|||
/**
|
||||
* @author kcf <vidofnir@folksprak.org>
|
||||
*/
|
||||
export function uebersetzung_anwenden(kontext : DocumentFragment) : void
|
||||
export function anwenden(kontext : DocumentFragment) : void
|
||||
{
|
||||
let muster : RegExp = (new RegExp("^!translate:([a-z0-9\.]*)$"));
|
||||
document.querySelectorAll("*")[""+"forEach"]
|
||||
|
|
@ -151,7 +157,7 @@ module mod_vtm_helfer
|
|||
if (fund != null)
|
||||
{
|
||||
let schluessel : string = fund[1];
|
||||
let inhalt_ : string = uebersetzung_holen(schluessel);
|
||||
let inhalt_ : string = holen(schluessel);
|
||||
element.textContent = inhalt_;
|
||||
}
|
||||
else
|
||||
|
|
@ -170,3 +176,7 @@ module mod_vtm_helfer
|
|||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,10 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
module mod_vtm_helfer
|
||||
module mod_vtm
|
||||
{
|
||||
|
||||
export module mod_helfer
|
||||
{
|
||||
|
||||
/**
|
||||
|
|
@ -48,3 +51,5 @@ module mod_vtm_helfer
|
|||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -28,14 +28,14 @@ module mod_vtm
|
|||
/**
|
||||
* @author kcf <vidofnir@folksprak.org>
|
||||
*/
|
||||
export type typ_position = mod_vtm_helfer.typ_vektor;
|
||||
export type typ_position = mod_vtm.mod_helfer.mod_vektor.typ_vektor;
|
||||
|
||||
|
||||
/**
|
||||
* @author kcf <vidofnir@folksprak.org>
|
||||
*/
|
||||
var basis1 : typ_position = mod_vtm_helfer.vektor_polar((0/6) * (2*Math.PI));
|
||||
var basis2 : typ_position = mod_vtm_helfer.vektor_polar((2/6) * (2*Math.PI));
|
||||
var basis1 : typ_position = mod_vtm.mod_helfer.mod_vektor.polar((0/6) * (2*Math.PI));
|
||||
var basis2 : typ_position = mod_vtm.mod_helfer.mod_vektor.polar((2/6) * (2*Math.PI));
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -44,10 +44,10 @@ module mod_vtm
|
|||
export function von_stelle(stelle : mod_vtm.mod_aufbau.mod_stelle.typ_stelle) : typ_position
|
||||
{
|
||||
return (
|
||||
mod_vtm_helfer.vektor_addieren
|
||||
mod_vtm.mod_helfer.mod_vektor.addieren
|
||||
(
|
||||
mod_vtm_helfer.vektor_skalieren(basis1, stelle.u),
|
||||
mod_vtm_helfer.vektor_skalieren(basis2, stelle.v)
|
||||
mod_vtm.mod_helfer.mod_vektor.skalieren(basis1, stelle.u),
|
||||
mod_vtm.mod_helfer.mod_vektor.skalieren(basis2, stelle.v)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ module mod_vtm
|
|||
return (
|
||||
pfad
|
||||
(
|
||||
mod_vtm_helfer.sequenz(6).map(i => mod_vtm_helfer.vektor_polar(((i+0.5)/6) * (2*Math.PI), 0.5)),
|
||||
mod_vtm.mod_helfer.sequenz(6).map(i => mod_vtm.mod_helfer.mod_vektor.polar(((i+0.5)/6) * (2*Math.PI), 0.5)),
|
||||
true,
|
||||
{
|
||||
"class": "rahmen"
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ module mod_vtm
|
|||
*/
|
||||
export function pfad
|
||||
(
|
||||
vertices : Array<mod_vtm_helfer.typ_vektor>,
|
||||
vertices : Array<mod_vtm.mod_helfer.mod_vektor.typ_vektor>,
|
||||
schliessen : boolean = true,
|
||||
attribute : {[schlussel : string] : string} = {},
|
||||
)
|
||||
|
|
|
|||
3
werkzeuge/anpassen.sed
Normal file
3
werkzeuge/anpassen.sed
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
s:mod_vtm_helfer.sequenz:mod_vtm.mod_helfer.sequenz:g
|
||||
s:mod_vtm_helfer.liste_kopieren:mod_vtm.mod_helfer.liste_kopieren:g
|
||||
|
||||
Loading…
Reference in a new issue