sommer.js

nach Georg Trakl, Sommer
var kuckuck = { location: "Wald", volume: 20 };
var korn = { location: "Feld", angle: 90 };
var mohn = { location: "Feld", angle: 90, color: "#ff0000" };
var grille = { location: "Feld", volume: 10 };
var kleid = { owner: "Du", location: "Wendeltreppe", volume: 0 };
var hand = { color: "#c0c0c0" };
var gewitter = {},
  zimmer = {},
  kerze = {},
  kastanie = {};
var nacht = ["Wind", "Stern"];

// 1

if (new Date().getHours() >= 19) {
  if (kuckuck.location === "Wald") {
    kuckuck.volume = 0;
  }
  korn.angle -= 60;
  mohn.angle -= 60;
}

// 2

gewitter.color = "#000000";
gewitter.location = "Hügel";
gewitter.active = true;

if (grille.location === "Feld") {
  grille.volume = 0;
}

// 3

while (false) {
  kastanie.active = true;
}

if (kleid.owner === "Du" && kleid.location === "Wendeltreppe") {
  kleid.volume = 1;
  kleid.active = true;
}

// 4

zimmer.brightness = 0;
kerze.location = zimmer;
kerze.volume = 0;
kerze.brightness = 5;
kerze.active = true;

if (hand.color === "#c0c0c0") {
  kerze.active = false;
}

// 5

nacht = nacht.filter(function(element) {
  return element !== "Wind" && element !== "Stern";
});
Aus der Sammlung Symphonie der Großstadt.