Skip to content

Commit

Permalink
add option for language de and en in url parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
fsewing committed May 27, 2024
1 parent 9144f3f commit 3c58b8d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SandwichNet/img/tastometer.ai
SandwichNet/.DS_Store
Binary file modified SandwichNet/.DS_Store
Binary file not shown.
3 changes: 1 addition & 2 deletions SandwichNet/simpleNeuralNet.js
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ class SimpleNeuralNet
let v = createVector();
v.set(this.outputnodesPosition[o])
v.sub(this.hiddenSigmoidPosition[h]);
v.mult(0.4);
v.mult(0.3);
let weightPosition = createVector();
weightPosition = v.add(this.hiddenSigmoidPosition[h]);
this.weightsHiddenOutputPosition[h][o].set(weightPosition);
Expand Down Expand Up @@ -734,7 +734,6 @@ class SimpleNeuralNet
function drawSandwichIngredient(pos,i)
{
let sandwichNet = this;
//let ingredient = ["Käse","Eierschalen","Matsch","Hühnchen","Erdnusbutter","Marmelade","Dünger","Grobe Mettwurst","Tonscherben","Majo","Salat",""]
push();
textAlign(RIGHT);
noStroke();
Expand Down
14 changes: 12 additions & 2 deletions SandwichNet/sketch.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ var learningRateStep = 0.1;

let level = 2;
let bg = 0;
let lang = 0;
let oldInputNodes;
let oldHiddenNodes;
let oldOutputNodes;
Expand All @@ -50,10 +51,19 @@ function preload() {
if(queryString)
{
const urlParams = new URLSearchParams(queryString);
level = urlParams.get('level')
level = urlParams.get('level');
print("jump to Level " + level);
bg = urlParams.get('bg')
bg = urlParams.get('bg');
print("set bg to " + bg);
lang = urlParams.get('lang');
if(lang == "de")
{
ingredientsList = ["Käse","Eierschalen","Matsch","Hühnchen","Erdnusbutter","Marmelade","Dünger","Grobe Mettwurst","Tonscherben","Majo","Salat",""]
}
if(lang == "en")
{
ingredientsList = ["Cheese", "Eggshells", "Mud", "Chicken", "PeanutButter", "Jam", "Fertilizer", "Sausage", "Clay", "Mayonnaise", "Salad",""]
}
}
else
{
Expand Down

0 comments on commit 3c58b8d

Please sign in to comment.