Code written in any programming language can go here.
I’ll start (it was code for a satirical clicker game):
import Cookies from '/modules/js-cookie/js.cookie.js';
// Mmm... Bad code i'm never gonna fix.
// Modules:
// JS-Cookie: https://github.com/js-cookie/js-cookie
if (Cookies.get('monoply') == undefined) {
var monoply = -100;
var annoy = 0;
var annoy2 = 10;
var good = 1;
var lol = monoply / 13;
var price = Math.round(annoy2 / 2 - 1 + good);
var bavola = 0;
} else {
var monoply = parseFloat(Cookies.get('monoply'));
var annoy = parseFloat(Cookies.get('annoy'));
var annoy2 = parseFloat(Cookies.get('annoy2'));
var good = parseFloat(Cookies.get('good'));
var lol = parseFloat(Cookies.get('lol'));
var price = parseFloat(Cookies.get('price'));
var bavola = parseFloat(Cookies.get('bavola'));
}
function save() {
Cookies.set('monoply', monoply, { expires: 730, path: '', sameSite: 'Strict', secure: true });
Cookies.set('annoy', annoy, { expires: 730, path: '', sameSite: 'Strict', secure: true });
Cookies.set('annoy2', annoy2, { expires: 730, path: '', sameSite: 'Strict', secure: true });
Cookies.set('good', good, { expires: 730, path: '', sameSite: 'Strict', secure: true });
Cookies.set('lol', lol, { expires: 730, path: '', sameSite: 'Strict', secure: true });
Cookies.set('price', price, { expires: 730, path: '', sameSite: 'Strict', secure: true });
Cookies.set('ts', Math.round((new Date()).getTime() / 1000), { expires: 730, path: '', sameSite: 'Strict', secure: true });
Cookies.set('bavola', bavola, { expires: 730, path: '', sameSite: 'Strict', secure: true });
}
var popup = 0;
document.getElementById("trash").innerHTML = monoply;
document.getElementById("price").innerHTML = Math.round(price / 5);
yumtrash.onclick = click;
preservetrash.onclick = penaltyr;
cleartrash.onclick = ascend;
cleartrash.onclick = ascend;
if (Cookies.get('ts') != undefined) {
alert("You've been gone for exactly " + Math.round((new Date()).getTime() / 1000 - Cookies.get('ts')) + " seconds, we miss you!");
}
function penaltyr() {
if (price > monoply) {
alert("Not enough points!");
} else {
if (Math.floor(Math.random() * 14) == 13) {
if (Math.floor(Math.random() * 2) == 0) {
annoy = 10;
annoy2 = annoy2 * 69;
lol = Math.round(monoply / 69);
monoply = Math.round(monoply / 69);
good = Math.round(good / 69);
price = Math.round(price / 69);
} else {
annoy = 0;
annoy2 = annoy2 * 69;
lol = Math.round(monoply / 69);
monoply = Math.round(monoply * 69);
good = Math.round(good * 69);
price = Math.round(price / 69);
}
alert("Bavola his aten yior pointz");
} else {
annoy = 0;
annoy2 = 10;
popup = 0;
lol = Math.round(monoply / 13);
monoply = Math.round(monoply - Math.round(price));
}
document.getElementById("trash").innerHTML = monoply;
document.getElementById("trash").innerHTML = monoply;
document.getElementById("trash").innerHTML = monoply;
}
save();
}
function click() {
if (annoy == 10) {
annoy2 = annoy2 + annoy2;
monoply = monoply - annoy2;
good = good + good + annoy2 - 20;
annoy = 0;
popup = popup + 1;
if (popup == 10) {
alert("Tired of losing your points? Pay to reduce your penalty.");
popup = 0;
}
} else {
if (Math.floor(Math.random() * 14) == 13) {
monoply = lol;
} else {
// Button Code
monoply = monoply + good;
annoy = annoy + 1;
lol = Math.round(monoply / 13 - annoy2 - good);
if (price > Math.round(annoy2 / 2 - 1 + good)) {
price = price + 100;
} else {
price = Math.round(annoy2 / 2 - 1 + good);
}
}
save();
}
document.getElementById("trash").innerHTML = monoply;
document.getElementById("price").innerHTML = price;
}
function ascend() {
Cookies.remove('monoply', { path: '' });
Cookies.remove('ts', { path: '' });
history.go(0);
}