From 931b6f61d3c2c6908565f22cfe8998ab4342dace Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Fra=C3=9F?= Date: Thu, 29 Mar 2018 22:00:42 +0200 Subject: [PATCH] update --- source/data/_data.ts | 2 +- source/helpers/call.ts | 2 +- source/helpers/errormonade.ts | 2 +- source/helpers/hashmap.ts | 2 +- source/helpers/math.ts | 2 +- source/helpers/misc.ts | 66 ++++++++++--------- source/helpers/string.ts | 2 +- source/helpers/svg.ts | 2 +- source/helpers/trait.ts | 2 +- source/helpers/translate.ts | 2 +- source/helpers/types.ts | 2 +- source/helpers/vector.ts | 2 +- source/helpers/xml.ts | 2 +- source/main.html | 17 +++++ source/main.scss | 28 ++++---- source/main.ts | 10 +-- source/manifestation/manifestation.ts | 2 +- source/manifestation/position.ts | 2 +- source/manifestation/store/game.ts | 10 +-- .../manifestation/svg/actuators/_actuator.ts | 4 +- .../manifestation/svg/actuators/acceptor.ts | 2 +- .../manifestation/svg/actuators/conveyer.ts | 2 +- .../manifestation/svg/actuators/generator.ts | 2 +- source/manifestation/svg/actuators/reader.ts | 2 +- .../manifestation/svg/actuators/rejector.ts | 2 +- source/manifestation/svg/actuators/writer.ts | 2 +- source/manifestation/svg/game.ts | 2 +- source/manifestation/svg/token.ts | 2 +- source/manifestation/web/game.scss | 2 +- source/manifestation/web/game.ts | 18 ++--- source/model/actuators/_actuator.ts | 8 +-- source/model/actuators/acceptor.ts | 6 +- source/model/actuators/conveyer.ts | 8 +-- source/model/actuators/generator.ts | 8 +-- source/model/actuators/reader.ts | 8 +-- source/model/actuators/rejector.ts | 6 +- source/model/actuators/writer.ts | 8 +-- source/model/direction.ts | 2 +- source/model/game.ts | 26 ++++---- source/model/mode.ts | 2 +- source/model/spot.ts | 2 +- source/model/state.ts | 2 +- source/model/symbol.ts | 4 +- source/model/tasks/acceptortask.ts | 2 +- source/model/tasks/acceptortest.ts | 2 +- source/model/tasks/task.ts | 2 +- source/model/tasks/test.ts | 2 +- source/model/tasks/transducertask.ts | 2 +- source/model/tasks/transducertest.ts | 4 +- source/model/token.ts | 2 +- source/model/world.ts | 16 ++--- 51 files changed, 172 insertions(+), 149 deletions(-) diff --git a/source/data/_data.ts b/source/data/_data.ts index eb26275..97b9b0f 100644 --- a/source/data/_data.ts +++ b/source/data/_data.ts @@ -1,6 +1,6 @@ /* * Verrückte Turing-Maschinen — A turing complete game - * Copyright (C) 2016-2018 Christian Fraß + * Copyright (C) 2016-2018 kcf * * 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 diff --git a/source/helpers/call.ts b/source/helpers/call.ts index 192f93e..1dde2b5 100644 --- a/source/helpers/call.ts +++ b/source/helpers/call.ts @@ -1,6 +1,6 @@ /* * Verrückte Turing-Maschinen — A turing complete game - * Copyright (C) 2016-2018 Christian Fraß + * Copyright (C) 2016-2018 kcf * * 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 diff --git a/source/helpers/errormonade.ts b/source/helpers/errormonade.ts index 101103c..3834b62 100644 --- a/source/helpers/errormonade.ts +++ b/source/helpers/errormonade.ts @@ -1,6 +1,6 @@ /* * Verrückte Turing-Maschinen — A turing complete game - * Copyright (C) 2016-2018 Christian Fraß + * Copyright (C) 2016-2018 kcf * * 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 diff --git a/source/helpers/hashmap.ts b/source/helpers/hashmap.ts index 9d44ca5..08effbd 100644 --- a/source/helpers/hashmap.ts +++ b/source/helpers/hashmap.ts @@ -1,6 +1,6 @@ /* * Verrückte Turing-Maschinen — A turing complete game - * Copyright (C) 2016-2018 Christian Fraß + * Copyright (C) 2016-2018 kcf * * 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 diff --git a/source/helpers/math.ts b/source/helpers/math.ts index b8f7010..d3a2f4a 100644 --- a/source/helpers/math.ts +++ b/source/helpers/math.ts @@ -1,6 +1,6 @@ /* * Verrückte Turing-Maschinen — A turing complete game - * Copyright (C) 2016-2018 Christian Fraß + * Copyright (C) 2016-2018 kcf * * 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 diff --git a/source/helpers/misc.ts b/source/helpers/misc.ts index 221098f..d3b4ed1 100644 --- a/source/helpers/misc.ts +++ b/source/helpers/misc.ts @@ -1,6 +1,6 @@ /* * Verrückte Turing-Maschinen — A turing complete game - * Copyright (C) 2016-2018 Christian Fraß + * Copyright (C) 2016-2018 kcf * * 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 @@ -16,39 +16,43 @@ * along with this program. If not, see . */ -module mod_vtm +module lib_list { - export module mod_helfer + /** + * @author kcf + */ + export function sequence + ( + length : int + ) + : Array { - - /** - * @author kcf - */ - export function sequence(laenge : int) : Array - { - return ((laenge <= 0) ? [] : sequence(laenge-1).concat([laenge-1])); - } - - - /** - * @author kcf - */ - export function list_copy(liste : Array, element_kopieren : (element : type_element)=>type_element = (x => x)) : Array - { - let liste_ : Array = []; - liste.forEach - ( - element => - { - let element_ : type_element = element_kopieren(element); - liste_.push(element); - } - ) - ; - return liste_; - } - + return ((length <= 0) ? [] : sequence(length-1).concat([length-1])); + } + + + /** + * @author kcf + */ + export function copy + ( + list : Array, + copy_element : (element : type_element)=>type_element = (x => x) + ) + : Array + { + let list_ : Array = []; + list.forEach + ( + element => + { + let element_ : type_element = copy_element(element); + list_.push(element); + } + ) + ; + return list_; } } diff --git a/source/helpers/string.ts b/source/helpers/string.ts index 0ef9393..0af72f0 100644 --- a/source/helpers/string.ts +++ b/source/helpers/string.ts @@ -1,6 +1,6 @@ /* * Verrückte Turing-Maschinen — A turing complete game - * Copyright (C) 2016-2018 Christian Fraß + * Copyright (C) 2016-2018 kcf * * 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 diff --git a/source/helpers/svg.ts b/source/helpers/svg.ts index 9e9c1b3..d955b64 100644 --- a/source/helpers/svg.ts +++ b/source/helpers/svg.ts @@ -1,6 +1,6 @@ /* * Verrückte Turing-Maschinen — A turing complete game - * Copyright (C) 2016-2018 Christian Fraß + * Copyright (C) 2016-2018 kcf * * 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 diff --git a/source/helpers/trait.ts b/source/helpers/trait.ts index b858991..6b52b0e 100644 --- a/source/helpers/trait.ts +++ b/source/helpers/trait.ts @@ -1,6 +1,6 @@ /* * Verrückte Turing-Maschinen — A turing complete game - * Copyright (C) 2016-2018 Christian Fraß + * Copyright (C) 2016-2018 kcf * * 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 diff --git a/source/helpers/translate.ts b/source/helpers/translate.ts index 758a5e2..1e6600e 100644 --- a/source/helpers/translate.ts +++ b/source/helpers/translate.ts @@ -1,6 +1,6 @@ /* * Verrückte Turing-Maschinen — A turing complete game - * Copyright (C) 2016-2018 Christian Fraß + * Copyright (C) 2016-2018 kcf * * 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 diff --git a/source/helpers/types.ts b/source/helpers/types.ts index cda08e2..e5ee017 100644 --- a/source/helpers/types.ts +++ b/source/helpers/types.ts @@ -1,6 +1,6 @@ /* * Verrückte Turing-Maschinen — A turing complete game - * Copyright (C) 2016-2018 Christian Fraß + * Copyright (C) 2016-2018 kcf * * 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 diff --git a/source/helpers/vector.ts b/source/helpers/vector.ts index eae2ccc..e13fe4c 100644 --- a/source/helpers/vector.ts +++ b/source/helpers/vector.ts @@ -1,6 +1,6 @@ /* * Verrückte Turing-Maschinen — A turing complete game - * Copyright (C) 2016-2018 Christian Fraß + * Copyright (C) 2016-2018 kcf * * 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 diff --git a/source/helpers/xml.ts b/source/helpers/xml.ts index 4973d55..488c9d4 100644 --- a/source/helpers/xml.ts +++ b/source/helpers/xml.ts @@ -1,6 +1,6 @@ /* * Verrückte Turing-Maschinen — A turing complete game - * Copyright (C) 2016-2018 Christian Fraß + * Copyright (C) 2016-2018 kcf * * 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 diff --git a/source/main.html b/source/main.html index cf76f4a..906a968 100644 --- a/source/main.html +++ b/source/main.html @@ -1,3 +1,20 @@ + diff --git a/source/main.scss b/source/main.scss index 64a9468..046cd89 100644 --- a/source/main.scss +++ b/source/main.scss @@ -1,6 +1,6 @@ /* * Verrückte Turing-Maschinen — A turing complete game - * Copyright (C) 2016-2018 Christian Fraß + * Copyright (C) 2016-2018 kcf * * 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 @@ -15,6 +15,8 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + +$hue: 135; html { @@ -23,8 +25,8 @@ html height: 100%; */ - background-color: hsl(120, 0%, 0%); - color: hsl(120, 0%, 100%); + background-color: hsl($hue, 0%, 0%); + color: hsl($hue, 0%, 100%); font-family: monospace; line-height: 200%; @@ -36,8 +38,8 @@ body padding: 8px; height: 100%; - background-color: hsl(120, 0%, 6.125%); - color: hsl(120, 0%, 93.75%); + background-color: hsl($hue, 0%, 6.125%); + color: hsl($hue, 0%, 93.75%); } a @@ -47,12 +49,12 @@ a &:not(:hover) { - color: hsl(120, 50%, 50%); + color: hsl($hue, 50%, 50%); } &:hover { - color: hsl(120, 50%, 75%); + color: hsl($hue, 50%, 75%); } } @@ -79,14 +81,14 @@ input,select,textarea,button &:not(:hover) { - background-color: hsl(120, 0%, 25%); - color: hsl(120, 0%, 100%); + background-color: hsl($hue, 0%, 25%); + color: hsl($hue, 0%, 100%); } &:hover { - background-color: hsl(120, 50%, 25%); - color: hsl(120, 0%, 100%); + background-color: hsl($hue, 50%, 25%); + color: hsl($hue, 0%, 100%); transition: 0.25s ease; } @@ -128,8 +130,8 @@ body > header margin: 8px; padding: 8px; - background-color: hsl(120, 0%, 12.5%); - color: hsl(120, 0%, 87.5%); + background-color: hsl($hue, 0%, 12.5%); + color: hsl($hue, 0%, 87.5%); } #section_left diff --git a/source/main.ts b/source/main.ts index 6e6511d..6f1ea2f 100644 --- a/source/main.ts +++ b/source/main.ts @@ -1,6 +1,6 @@ /* * Verrückte Turing-Maschinen — A turing complete game - * Copyright (C) 2016-2018 Christian Fraß + * Copyright (C) 2016-2018 kcf * * 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 @@ -83,10 +83,10 @@ module mod_vtm { // Übersetzungen { - let languages : Array = navigator.languages.map(language => language); - let language_nativ : string = "de"; - if (! languages[""+"includes"](language_nativ)) - languages.push(language_nativ); + let languages : Array = navigator.languages; + let language_native : string = "de"; + if (! languages[""+"includes"](language_native)) + languages.push(language_native); lib_translate.setup(languages); lib_translate.deploy(document); } diff --git a/source/manifestation/manifestation.ts b/source/manifestation/manifestation.ts index f0762c0..7379a95 100644 --- a/source/manifestation/manifestation.ts +++ b/source/manifestation/manifestation.ts @@ -1,6 +1,6 @@ /* * Verrückte Turing-Maschinen — A turing complete game - * Copyright (C) 2016-2018 Christian Fraß + * Copyright (C) 2016-2018 kcf * * 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 diff --git a/source/manifestation/position.ts b/source/manifestation/position.ts index 459b549..68e4c81 100644 --- a/source/manifestation/position.ts +++ b/source/manifestation/position.ts @@ -1,6 +1,6 @@ /* * Verrückte Turing-Maschinen — A turing complete game - * Copyright (C) 2016-2018 Christian Fraß + * Copyright (C) 2016-2018 kcf * * 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 diff --git a/source/manifestation/store/game.ts b/source/manifestation/store/game.ts index 51bc53c..8d1dcc1 100644 --- a/source/manifestation/store/game.ts +++ b/source/manifestation/store/game.ts @@ -1,6 +1,6 @@ /* * Verrückte Turing-Maschinen — A turing complete game - * Copyright (C) 2016-2018 Christian Fraß + * Copyright (C) 2016-2018 kcf * * 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 @@ -82,7 +82,7 @@ module mod_vtm */ function bind(game : type_game) : void { - mod_vtm.mod_model.mod_game.lauschen + mod_vtm.mod_model.mod_game.listen ( game.model, "change_task", @@ -108,7 +108,7 @@ module mod_vtm } ) ; - mod_vtm.mod_model.mod_game.lauschen + mod_vtm.mod_model.mod_game.listen ( game.model, "change_world", @@ -125,7 +125,7 @@ module mod_vtm } ) ; - mod_vtm.mod_model.mod_game.lauschen + mod_vtm.mod_model.mod_game.listen ( game.model, "change_token", @@ -135,7 +135,7 @@ module mod_vtm } ) ; - mod_vtm.mod_model.mod_game.lauschen + mod_vtm.mod_model.mod_game.listen ( game.model, "change_mode", diff --git a/source/manifestation/svg/actuators/_actuator.ts b/source/manifestation/svg/actuators/_actuator.ts index e90b210..0c46247 100644 --- a/source/manifestation/svg/actuators/_actuator.ts +++ b/source/manifestation/svg/actuators/_actuator.ts @@ -1,6 +1,6 @@ /* * Verrückte Turing-Maschinen — A turing complete game - * Copyright (C) 2016-2018 Christian Fraß + * Copyright (C) 2016-2018 kcf * * 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 @@ -100,7 +100,7 @@ module mod_vtm return ( lib_svg.path ( - mod_vtm.mod_helfer.sequence(6).map(i => lib_vector.polar(((i+0.5)/6) * (2*Math.PI), 0.5)), + lib_list.sequence(6).map(i => lib_vector.polar(((i+0.5)/6) * (2*Math.PI), 0.5)), true, { "class": "rahmen" diff --git a/source/manifestation/svg/actuators/acceptor.ts b/source/manifestation/svg/actuators/acceptor.ts index 6627e74..d86e086 100644 --- a/source/manifestation/svg/actuators/acceptor.ts +++ b/source/manifestation/svg/actuators/acceptor.ts @@ -1,6 +1,6 @@ /* * Verrückte Turing-Maschinen — A turing complete game - * Copyright (C) 2016-2018 Christian Fraß + * Copyright (C) 2016-2018 kcf * * 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 diff --git a/source/manifestation/svg/actuators/conveyer.ts b/source/manifestation/svg/actuators/conveyer.ts index 3e49af3..e4ebc78 100644 --- a/source/manifestation/svg/actuators/conveyer.ts +++ b/source/manifestation/svg/actuators/conveyer.ts @@ -1,6 +1,6 @@ /* * Verrückte Turing-Maschinen — A turing complete game - * Copyright (C) 2016-2018 Christian Fraß + * Copyright (C) 2016-2018 kcf * * 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 diff --git a/source/manifestation/svg/actuators/generator.ts b/source/manifestation/svg/actuators/generator.ts index e749632..4014b3f 100644 --- a/source/manifestation/svg/actuators/generator.ts +++ b/source/manifestation/svg/actuators/generator.ts @@ -1,6 +1,6 @@ /* * Verrückte Turing-Maschinen — A turing complete game - * Copyright (C) 2016-2018 Christian Fraß + * Copyright (C) 2016-2018 kcf * * 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 diff --git a/source/manifestation/svg/actuators/reader.ts b/source/manifestation/svg/actuators/reader.ts index ba4f32e..1e75c91 100644 --- a/source/manifestation/svg/actuators/reader.ts +++ b/source/manifestation/svg/actuators/reader.ts @@ -1,6 +1,6 @@ /* * Verrückte Turing-Maschinen — A turing complete game - * Copyright (C) 2016-2018 Christian Fraß + * Copyright (C) 2016-2018 kcf * * 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 diff --git a/source/manifestation/svg/actuators/rejector.ts b/source/manifestation/svg/actuators/rejector.ts index 5f72eb5..9280a2a 100644 --- a/source/manifestation/svg/actuators/rejector.ts +++ b/source/manifestation/svg/actuators/rejector.ts @@ -1,6 +1,6 @@ /* * Verrückte Turing-Maschinen — A turing complete game - * Copyright (C) 2016-2018 Christian Fraß + * Copyright (C) 2016-2018 kcf * * 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 diff --git a/source/manifestation/svg/actuators/writer.ts b/source/manifestation/svg/actuators/writer.ts index ab7a5ef..6f79a2d 100644 --- a/source/manifestation/svg/actuators/writer.ts +++ b/source/manifestation/svg/actuators/writer.ts @@ -1,6 +1,6 @@ /* * Verrückte Turing-Maschinen — A turing complete game - * Copyright (C) 2016-2018 Christian Fraß + * Copyright (C) 2016-2018 kcf * * 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 diff --git a/source/manifestation/svg/game.ts b/source/manifestation/svg/game.ts index 0ac42f1..039a366 100644 --- a/source/manifestation/svg/game.ts +++ b/source/manifestation/svg/game.ts @@ -1,6 +1,6 @@ /* * Verrückte Turing-Maschinen — A turing complete game - * Copyright (C) 2016-2018 Christian Fraß + * Copyright (C) 2016-2018 kcf * * 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 diff --git a/source/manifestation/svg/token.ts b/source/manifestation/svg/token.ts index 6959881..8ce391f 100644 --- a/source/manifestation/svg/token.ts +++ b/source/manifestation/svg/token.ts @@ -1,6 +1,6 @@ /* * Verrückte Turing-Maschinen — A turing complete game - * Copyright (C) 2016-2018 Christian Fraß + * Copyright (C) 2016-2018 kcf * * 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 diff --git a/source/manifestation/web/game.scss b/source/manifestation/web/game.scss index 19a76f3..37c5785 100644 --- a/source/manifestation/web/game.scss +++ b/source/manifestation/web/game.scss @@ -1,6 +1,6 @@ /* * Verrückte Turing-Maschinen — A turing complete game - * Copyright (C) 2016-2018 Christian Fraß + * Copyright (C) 2016-2018 kcf * * 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 diff --git a/source/manifestation/web/game.ts b/source/manifestation/web/game.ts index b937efe..70e143d 100644 --- a/source/manifestation/web/game.ts +++ b/source/manifestation/web/game.ts @@ -1,6 +1,6 @@ /* * Verrückte Turing-Maschinen — A turing complete game - * Copyright (C) 2016-2018 Christian Fraß + * Copyright (C) 2016-2018 kcf * * 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 @@ -321,7 +321,7 @@ module mod_vtm return spot; } ; - mod_vtm.mod_model.mod_game.lauschen + mod_vtm.mod_model.mod_game.listen ( game.model, "change_task", @@ -331,7 +331,7 @@ module mod_vtm } ) ; - mod_vtm.mod_model.mod_game.lauschen + mod_vtm.mod_model.mod_game.listen ( game.model, "change_world", @@ -341,7 +341,7 @@ module mod_vtm } ) ; - mod_vtm.mod_model.mod_game.lauschen + mod_vtm.mod_model.mod_game.listen ( game.model, "change_token", @@ -351,7 +351,7 @@ module mod_vtm } ) ; - mod_vtm.mod_model.mod_game.lauschen + mod_vtm.mod_model.mod_game.listen ( game.model, "change_mode", @@ -372,7 +372,7 @@ module mod_vtm let spot_ : lib_errormonade.type_errormonade = spot_determine(event.target); if (lib_errormonade.filled(spot_)) { - mod_vtm.mod_model.mod_game.world_tile_wechseln(game.model, lib_errormonade.read(spot_), false); + mod_vtm.mod_model.mod_game.world_tile_change(game.model, lib_errormonade.read(spot_), false); } else { @@ -391,7 +391,7 @@ module mod_vtm let spot_ : lib_errormonade.type_errormonade = spot_determine(event.target); if (lib_errormonade.filled(spot_)) { - mod_vtm.mod_model.mod_game.world_tile_wechseln(game.model, lib_errormonade.read(spot_), true); + mod_vtm.mod_model.mod_game.world_tile_change(game.model, lib_errormonade.read(spot_), true); } else { @@ -410,8 +410,8 @@ module mod_vtm let spot_ : lib_errormonade.type_errormonade = spot_determine(event.target); if (lib_errormonade.filled(spot_)) { - let inkrement : int = ((event["deltaY"] < 0) ? -1 : +1); - mod_vtm.mod_model.mod_game.world_tile_rotate(game.model, lib_errormonade.read(spot_), inkrement); + let increment : int = ((event["deltaY"] < 0) ? -1 : +1); + mod_vtm.mod_model.mod_game.world_tile_rotate(game.model, lib_errormonade.read(spot_), increment); } else { diff --git a/source/model/actuators/_actuator.ts b/source/model/actuators/_actuator.ts index aa531b0..245c653 100644 --- a/source/model/actuators/_actuator.ts +++ b/source/model/actuators/_actuator.ts @@ -1,6 +1,6 @@ /* * Verrückte Turing-Maschinen — A turing complete game - * Copyright (C) 2016-2018 Christian Fraß + * Copyright (C) 2016-2018 kcf * * 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 @@ -37,7 +37,7 @@ module mod_vtm export type signature_actuator = { example : ()=>type_actuator; - rotate : (actuator : type_actuator, inkrement : int)=>void; + rotate : (actuator : type_actuator, increment : int)=>void; use : (actuator : type_actuator, token : mod_token.type_token)=>void; export : (actuator : type_actuator)=>any; import : (raw : any)=>type_actuator; @@ -74,9 +74,9 @@ module mod_vtm /** * @author kcf */ - export function rotate(actuator : type_actuator, inkrement ?: int) : void + export function rotate(actuator : type_actuator, increment ?: int) : void { - return lib_trait.deploy(trait_actuator, actuator.kind)["rotate"](actuator, inkrement); + return lib_trait.deploy(trait_actuator, actuator.kind)["rotate"](actuator, increment); } diff --git a/source/model/actuators/acceptor.ts b/source/model/actuators/acceptor.ts index 95e0890..0d783da 100644 --- a/source/model/actuators/acceptor.ts +++ b/source/model/actuators/acceptor.ts @@ -1,6 +1,6 @@ /* * Verrückte Turing-Maschinen — A turing complete game - * Copyright (C) 2016-2018 Christian Fraß + * Copyright (C) 2016-2018 kcf * * 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 @@ -86,7 +86,7 @@ module mod_vtm function rotate ( acceptor : type_acceptor, - inkrement ?: int + increment ?: int ) : void { @@ -147,7 +147,7 @@ module mod_vtm kind, { "example": () => lib_call.wrap(kind, example()), - "rotate": (actuator, inkrement) => rotate(lib_call.unwrap(actuator), inkrement), + "rotate": (actuator, increment) => rotate(lib_call.unwrap(actuator), increment), "use": (actuator, token) => use(lib_call.unwrap(actuator), token), "export": (actuator) => ({"kind": kind, "data": export_(actuator.data)}), "import": (raw) => lib_call.wrap(kind, import_(raw["data"])), diff --git a/source/model/actuators/conveyer.ts b/source/model/actuators/conveyer.ts index 1426298..97034e2 100644 --- a/source/model/actuators/conveyer.ts +++ b/source/model/actuators/conveyer.ts @@ -1,6 +1,6 @@ /* * Verrückte Turing-Maschinen — A turing complete game - * Copyright (C) 2016-2018 Christian Fraß + * Copyright (C) 2016-2018 kcf * * 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 @@ -103,11 +103,11 @@ module mod_vtm function rotate ( conveyer : type_conveyer, - inkrement : int = +1 + increment : int = +1 ) : void { - conveyer.direction = mod_direction.add(conveyer.direction, inkrement); + conveyer.direction = mod_direction.add(conveyer.direction, increment); } @@ -167,7 +167,7 @@ module mod_vtm kind, { "example": () => lib_call.wrap(kind, example()), - "rotate": (actuator, inkrement) => rotate(lib_call.unwrap(actuator), inkrement), + "rotate": (actuator, increment) => rotate(lib_call.unwrap(actuator), increment), "use": (actuator, token) => use(lib_call.unwrap(actuator), token), "export": (actuator) => ({"kind": kind, "data": export_(actuator.data)}), "import": (raw) => lib_call.wrap(kind, import_(raw["data"])), diff --git a/source/model/actuators/generator.ts b/source/model/actuators/generator.ts index 0536f40..f810aff 100644 --- a/source/model/actuators/generator.ts +++ b/source/model/actuators/generator.ts @@ -1,6 +1,6 @@ /* * Verrückte Turing-Maschinen — A turing complete game - * Copyright (C) 2016-2018 Christian Fraß + * Copyright (C) 2016-2018 kcf * * 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 @@ -103,11 +103,11 @@ module mod_vtm function rotate ( generator : type_generator, - inkrement : int = +1 + increment : int = +1 ) : void { - generator.direction = mod_direction.add(generator.direction, inkrement); + generator.direction = mod_direction.add(generator.direction, increment); } @@ -167,7 +167,7 @@ module mod_vtm kind, { "example": () => lib_call.wrap(kind, example()), - "rotate": (actuator, inkrement) => rotate(lib_call.unwrap(actuator), inkrement), + "rotate": (actuator, increment) => rotate(lib_call.unwrap(actuator), increment), "use": (actuator, token) => use(lib_call.unwrap(actuator), token), "export": (actuator) => ({"kind": kind, "data": export_(actuator.data)}), "import": (raw) => lib_call.wrap(kind, import_(raw["data"])), diff --git a/source/model/actuators/reader.ts b/source/model/actuators/reader.ts index 7fb0c55..d11faec 100644 --- a/source/model/actuators/reader.ts +++ b/source/model/actuators/reader.ts @@ -1,6 +1,6 @@ /* * Verrückte Turing-Maschinen — A turing complete game - * Copyright (C) 2016-2018 Christian Fraß + * Copyright (C) 2016-2018 kcf * * 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 @@ -137,11 +137,11 @@ module mod_vtm function rotate ( reader : type_reader, - inkrement : int = +1 + increment : int = +1 ) : void { - reader.direction = mod_direction.add(reader.direction, inkrement); + reader.direction = mod_direction.add(reader.direction, increment); } @@ -230,7 +230,7 @@ module mod_vtm kind, { "example": () => lib_call.wrap(kind, example()), - "rotate": (actuator, inkrement) => rotate(lib_call.unwrap(actuator), inkrement), + "rotate": (actuator, increment) => rotate(lib_call.unwrap(actuator), increment), "use": (actuator, token) => use(lib_call.unwrap(actuator), token), "export": (actuator) => ({"kind": kind, "data": export_(actuator.data)}), "import": (raw) => lib_call.wrap(kind, import_(raw["data"])), diff --git a/source/model/actuators/rejector.ts b/source/model/actuators/rejector.ts index 67ad8e0..7ac59bc 100644 --- a/source/model/actuators/rejector.ts +++ b/source/model/actuators/rejector.ts @@ -1,6 +1,6 @@ /* * Verrückte Turing-Maschinen — A turing complete game - * Copyright (C) 2016-2018 Christian Fraß + * Copyright (C) 2016-2018 kcf * * 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 @@ -86,7 +86,7 @@ module mod_vtm function rotate ( rejector : type_rejector, - inkrement ?: int + increment ?: int ) : void { @@ -147,7 +147,7 @@ module mod_vtm kind, { "example": () => lib_call.wrap(kind, example()), - "rotate": (actuator, inkrement) => rotate(lib_call.unwrap(actuator), inkrement), + "rotate": (actuator, increment) => rotate(lib_call.unwrap(actuator), increment), "use": (actuator, token) => use(lib_call.unwrap(actuator), token), "export": (actuator) => ({"kind": kind, "data": export_(actuator.data)}), "import": (raw) => lib_call.wrap(kind, import_(raw["data"])), diff --git a/source/model/actuators/writer.ts b/source/model/actuators/writer.ts index 0285275..1de8583 100644 --- a/source/model/actuators/writer.ts +++ b/source/model/actuators/writer.ts @@ -1,6 +1,6 @@ /* * Verrückte Turing-Maschinen — A turing complete game - * Copyright (C) 2016-2018 Christian Fraß + * Copyright (C) 2016-2018 kcf * * 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 @@ -120,11 +120,11 @@ module mod_vtm function rotate ( writer : type_writer, - inkrement : int = +1 + increment : int = +1 ) : void { - writer.direction = mod_direction.add(writer.direction, inkrement); + writer.direction = mod_direction.add(writer.direction, increment); } @@ -187,7 +187,7 @@ module mod_vtm kind, { "example": () => lib_call.wrap(kind, example()), - "rotate": (actuator, inkrement) => rotate(lib_call.unwrap(actuator), inkrement), + "rotate": (actuator, increment) => rotate(lib_call.unwrap(actuator), increment), "use": (actuator, token) => use(lib_call.unwrap(actuator), token), "export": (actuator) => ({"kind": kind, "data": export_(actuator.data)}), "import": (raw) => lib_call.wrap(kind, import_(raw["data"])), diff --git a/source/model/direction.ts b/source/model/direction.ts index 09b479d..05d9cbe 100644 --- a/source/model/direction.ts +++ b/source/model/direction.ts @@ -1,6 +1,6 @@ /* * Verrückte Turing-Maschinen — A turing complete game - * Copyright (C) 2016-2018 Christian Fraß + * Copyright (C) 2016-2018 kcf * * 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 diff --git a/source/model/game.ts b/source/model/game.ts index 52fed4f..5700a6c 100644 --- a/source/model/game.ts +++ b/source/model/game.ts @@ -1,6 +1,6 @@ /* * Verrückte Turing-Maschinen — A turing complete game - * Copyright (C) 2016-2018 Christian Fraß + * Copyright (C) 2016-2018 kcf * * 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 @@ -76,7 +76,7 @@ module mod_vtm /** * @author kcf */ - export function lauschen + export function listen ( game : type_game, event : string, @@ -266,11 +266,11 @@ module mod_vtm /** * @author kcf */ - export function world_tile_wechseln + export function world_tile_change ( game : type_game, spot : mod_spot.type_spot, - umgekehrt : boolean = false + inverted : boolean = false ) : void { @@ -280,17 +280,17 @@ module mod_vtm } else { - mod_world.tile_wechseln(game.world, spot, umgekehrt); + mod_world.tile_change(game.world, spot, inverted); notify ( game, "change_world", { - "kind": "tile_wechseln", + "kind": "tile_change", "data": { "spot": spot, - "umgekehrt": umgekehrt, + "inverted": inverted, "tile": mod_world.tile_get(game.world, spot), } } @@ -307,7 +307,7 @@ module mod_vtm ( game : type_game, spot : mod_spot.type_spot, - inkrement : int = +1 + increment : int = +1 ) : void { @@ -317,7 +317,7 @@ module mod_vtm } else { - mod_world.tile_rotate(game.world, spot, inkrement); + mod_world.tile_rotate(game.world, spot, increment); notify(game, "change_world", {}); } } @@ -346,7 +346,7 @@ module mod_vtm if (! lib_errormonade.filled(game.token)) { let test : mod_test.type_test = mod_task.tests(game.task)[lib_errormonade.read(game.testindex)]; - let tape : Array = mod_vtm.mod_helfer.list_copy(mod_test.input(test)); + let tape : Array = lib_list.copy(mod_test.input(test)); let spot : mod_spot.type_spot = mod_world.generator_finden(game.world); game.token = ( lib_errormonade.create_just @@ -378,12 +378,12 @@ module mod_vtm else if ((state === mod_state.accepted) || (state === mod_state.rejected)) { let accepted : boolean = (state === mod_state.accepted); - let ausgabe : Array = mod_token.tape_read(token); + let output : Array = mod_token.tape_read(token); game.token = (lib_errormonade.create_nothing()); let testindex : int = lib_errormonade.read(game.testindex); let tests : Array = mod_task.tests(game.task); let test : mod_test.type_test = tests[testindex]; - if (! mod_test.pruefen(test, accepted, ausgabe)) + if (! mod_test.pruefen(test, accepted, output)) { game.mode = mod_mode.wrong; notify(game, "change_mode", {}); @@ -398,7 +398,7 @@ module mod_vtm } else { - // auf Modus "correct" wechseln + // auf Modus "correct" change game.testindex = (lib_errormonade.create_nothing()); game.mode = mod_mode.correct; notify(game, "change_mode", {}); diff --git a/source/model/mode.ts b/source/model/mode.ts index b4bfb69..72d5720 100644 --- a/source/model/mode.ts +++ b/source/model/mode.ts @@ -1,6 +1,6 @@ /* * Verrückte Turing-Maschinen — A turing complete game - * Copyright (C) 2016-2018 Christian Fraß + * Copyright (C) 2016-2018 kcf * * 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 diff --git a/source/model/spot.ts b/source/model/spot.ts index 5f4f9f1..671eef0 100644 --- a/source/model/spot.ts +++ b/source/model/spot.ts @@ -1,6 +1,6 @@ /* * Verrückte Turing-Maschinen — A turing complete game - * Copyright (C) 2016-2018 Christian Fraß + * Copyright (C) 2016-2018 kcf * * 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 diff --git a/source/model/state.ts b/source/model/state.ts index fa96a87..34c6a90 100644 --- a/source/model/state.ts +++ b/source/model/state.ts @@ -1,6 +1,6 @@ /* * Verrückte Turing-Maschinen — A turing complete game - * Copyright (C) 2016-2018 Christian Fraß + * Copyright (C) 2016-2018 kcf * * 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 diff --git a/source/model/symbol.ts b/source/model/symbol.ts index 2327832..2a897d4 100644 --- a/source/model/symbol.ts +++ b/source/model/symbol.ts @@ -1,6 +1,6 @@ /* * Verrückte Turing-Maschinen — A turing complete game - * Copyright (C) 2016-2018 Christian Fraß + * Copyright (C) 2016-2018 kcf * * 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 @@ -34,7 +34,7 @@ module mod_vtm /** * @author kcf */ - export function vergleichen(symbol1 : type_symbol, symbol2 : type_symbol) : boolean + export function collate(symbol1 : type_symbol, symbol2 : type_symbol) : boolean { return (symbol1 === symbol2); } diff --git a/source/model/tasks/acceptortask.ts b/source/model/tasks/acceptortask.ts index 3b8fb15..55deb06 100644 --- a/source/model/tasks/acceptortask.ts +++ b/source/model/tasks/acceptortask.ts @@ -1,6 +1,6 @@ /* * Verrückte Turing-Maschinen — A turing complete game - * Copyright (C) 2016-2018 Christian Fraß + * Copyright (C) 2016-2018 kcf * * 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 diff --git a/source/model/tasks/acceptortest.ts b/source/model/tasks/acceptortest.ts index 44f846f..245f3b5 100644 --- a/source/model/tasks/acceptortest.ts +++ b/source/model/tasks/acceptortest.ts @@ -1,6 +1,6 @@ /* * Verrückte Turing-Maschinen — A turing complete game - * Copyright (C) 2016-2018 Christian Fraß + * Copyright (C) 2016-2018 kcf * * 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 diff --git a/source/model/tasks/task.ts b/source/model/tasks/task.ts index af409e9..88b6d2e 100644 --- a/source/model/tasks/task.ts +++ b/source/model/tasks/task.ts @@ -1,6 +1,6 @@ /* * Verrückte Turing-Maschinen — A turing complete game - * Copyright (C) 2016-2018 Christian Fraß + * Copyright (C) 2016-2018 kcf * * 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 diff --git a/source/model/tasks/test.ts b/source/model/tasks/test.ts index b0640f1..516923c 100644 --- a/source/model/tasks/test.ts +++ b/source/model/tasks/test.ts @@ -1,6 +1,6 @@ /* * Verrückte Turing-Maschinen — A turing complete game - * Copyright (C) 2016-2018 Christian Fraß + * Copyright (C) 2016-2018 kcf * * 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 diff --git a/source/model/tasks/transducertask.ts b/source/model/tasks/transducertask.ts index a89e40e..142f9ae 100644 --- a/source/model/tasks/transducertask.ts +++ b/source/model/tasks/transducertask.ts @@ -1,6 +1,6 @@ /* * Verrückte Turing-Maschinen — A turing complete game - * Copyright (C) 2016-2018 Christian Fraß + * Copyright (C) 2016-2018 kcf * * 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 diff --git a/source/model/tasks/transducertest.ts b/source/model/tasks/transducertest.ts index 108ee98..8cd4d47 100644 --- a/source/model/tasks/transducertest.ts +++ b/source/model/tasks/transducertest.ts @@ -1,6 +1,6 @@ /* * Verrückte Turing-Maschinen — A turing complete game - * Copyright (C) 2016-2018 Christian Fraß + * Copyright (C) 2016-2018 kcf * * 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 @@ -86,7 +86,7 @@ module mod_vtm let gleich : boolean = true; for (let index : int = 0; index < transducertest.output.length; index += 1) { - if (! mod_vtm.mod_model.mod_symbol.vergleichen(transducertest.output[index], output[index])) + if (! mod_vtm.mod_model.mod_symbol.collate(transducertest.output[index], output[index])) { gleich = false; break; diff --git a/source/model/token.ts b/source/model/token.ts index ae3f835..cf89efd 100644 --- a/source/model/token.ts +++ b/source/model/token.ts @@ -1,6 +1,6 @@ /* * Verrückte Turing-Maschinen — A turing complete game - * Copyright (C) 2016-2018 Christian Fraß + * Copyright (C) 2016-2018 kcf * * 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 diff --git a/source/model/world.ts b/source/model/world.ts index a00b308..0551c25 100644 --- a/source/model/world.ts +++ b/source/model/world.ts @@ -1,6 +1,6 @@ /* * Verrückte Turing-Maschinen — A turing complete game - * Copyright (C) 2016-2018 Christian Fraß + * Copyright (C) 2016-2018 kcf * * 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 @@ -102,11 +102,11 @@ module mod_vtm /** * @author kcf */ - export function tile_wechseln + export function tile_change ( world : type_world, spot : mod_spot.type_spot, - umgekehrt : boolean = false + inverted : boolean = false ) : void { @@ -124,7 +124,7 @@ module mod_vtm ) .concat ( - mod_vtm.mod_helfer.sequence(extended ? 4 : 2).map + lib_list.sequence(extended ? 4 : 2).map ( symbol => ( { @@ -147,7 +147,7 @@ module mod_vtm ) .concat ( - mod_vtm.mod_helfer.sequence(extended ? 2 : 1).map + lib_list.sequence(extended ? 2 : 1).map ( index => { @@ -226,7 +226,7 @@ module mod_vtm } if (lib_errormonade.filled(index_alt)) { - let index_neu : int = lib_math.mod(lib_errormonade.read(index_alt) + (umgekehrt ? -1 : +1), liste.length); + let index_neu : int = lib_math.mod(lib_errormonade.read(index_alt) + (inverted ? -1 : +1), liste.length); let actuator_neu : mod_actuator.type_actuator = liste[index_neu].erspotr(); tile_set(world, spot, actuator_neu); } @@ -246,14 +246,14 @@ module mod_vtm ( world : type_world, spot : mod_spot.type_spot, - inkrement : int = +1 + increment : int = +1 ) : void { let actuator_ : lib_errormonade.type_errormonade = lib_hashmap.get(world.tiles, spot); if (lib_errormonade.filled(actuator_)) { - mod_actuator.rotate(lib_errormonade.read(actuator_), inkrement); + mod_actuator.rotate(lib_errormonade.read(actuator_), increment); } else {