(github.com)
Game could start with a single CPU and 2-3 processes and then all this comes on top step by step and you can automate it away through tech tree.
sudo systemctl reboot --firmware
shutdown /r /t 0 /fw
These reboot directly into BIOS.
For Windows CMD+R menu, run it by pressing CTRL+SHIFT+Enter (elevates to admin). You may have to do it twice for some unknown reasons after reinstalling the OS.
What I didn't like, is the tutorial is separate from the game. It would be awesome imo, if there's a tutorial stage where the game is explained hands-on (maybe pausing the game with explainers, until I start to get how to play) Otherwise I have to memorise the instructions before trying the game.
Regardless, amazing little game.
The marketing and management of IT always had this fixation with replacing people. It always has been the wrong answer and the real value always came from making people better.
I love TIS-100, but at some point I realized I was studying the user manual for a fictional computer, trying to learn it's fictional assembly language, to optimize some multicore data flows.... and decided I should probably get paid for doing that in real life instead.
If I wanted logic flow embedded in a game then I’d want it in an environment that’s far removed from traditional programming. Such as building contraptions in Minecraft.
But even games that seem like just a job can be fun. Euro Truck simulator is fun because you are entirely self directed. Each job produces tangible results and you feel yourself progressing in a clear way that you often do not feel in a real job.
(I enjoy more arcade style)
The games track things like cycles taken to complete the task, size/area of the machine, and cost. Those scores are shown on separate leaderboards and optimizing for one can come at the cost of another (e.g. faster machines may be bigger and/or more expensive).
Nice work! I have a kid trying to learn about OSes right now and I think this can be helpful for him
Sounds like that black mirror multi-part episode "White Christmas".
I found that even on the easy level, the number of processes keeps growing slowly, and there isn't enough CPU time to keep all processes satisfied. I feel like the game is inherently setting you up for failure. Here is the script if anyone wants to play with it:
// ==UserScript==
// @name Auto-play "You're the OS!" game
// @include https://plbrault.github.io/youre-the-os/
// ==/UserScript==
(async function() {
const IO_EVENTS = {x: 160, y: 25};
const CPUS = 4;
const CPU1 = {x: 50+46, y: 50+42};
const SQUARE = {w: 64+5, h: 64+5};
const PROCESS = {x: 50+46, y: 155+42};
const PROCESS_ROWS = 6;
const PROCESS_COLS = 7;
let cnv = document.querySelector("body > canvas");
while (cnv.width != 1280 || cnv.height != 720)
await new Promise(res => setTimeout(res, 100));
while (true) {
const pixels = new Uint32Array(cnv.getContext("2d").getImageData(0, 0, cnv.width, cnv.height).data.buffer);
function getPixel(x, y) { return pixels[y * cnv.width + x]; }
if (getPixel(IO_EVENTS.x, IO_EVENTS.y) == 0xFF808000);
await pressKey("Space");
let cpuStatuses = [];
for (let i = 0; i < CPUS; i++) {
const p = getPixel(CPU1.x + SQUARE.w * i, CPU1.y);
cpuStatuses.push(
p == 0xFF000000 ? 1 :
p == 0xFF9A9B9B ? 2 :
p == 0xFF00FF00 ? 3 :
p == 0xFFE6D8B0 ? 4 :
0);
}
let processStatuses = [];
for (let r = 0; r < PROCESS_ROWS; r++) {
for (let c = 0; c < PROCESS_COLS; c++) {
const p = getPixel(PROCESS.x + SQUARE.w * c, PROCESS.y + SQUARE.h * r);
let s =
p == 0xFF000000 ? 1 :
p == 0xFF9A9B9B ? 2 :
p == 0xFF00FF00 ? 3 :
p == 0xFF00FFFF ? 4 :
p == 0xFF00A5FF ? 5 :
p == 0xFF0000FF ? 6 :
p == 0xFF00008B ? 7 :
p == 0xFF000050 ? 8 :
0;
if (s >= 3)
processStatuses.push({r, c, status: s});
}
}
processStatuses.sort((a, b) => a.status - b.status);
for (let i = 0; i < cpuStatuses.length; i++) {
if (cpuStatuses[i] < 1)
continue;
if (cpuStatuses[i] >= 2)
await pressKey("Digit" + "1234567890".charAt(i));
const p = processStatuses.pop();
if (p !== undefined)
await clickMouse(PROCESS.x + SQUARE.w * p.c, PROCESS.y + SQUARE.h * p.r);
}
await new Promise(res => setTimeout(res, 300));
}
async function clickMouse(x, y) {
const rect = cnv.getBoundingClientRect();
const opts = {
bubbles: true,
clientX: rect.left + x * rect.width / 1280,
clientY: rect.top + y * rect.height / 720,
};
cnv.dispatchEvent(new MouseEvent("mousemove", {...opts, buttons: 0}));
cnv.dispatchEvent(new MouseEvent("mousedown", {...opts, buttons: 1}));
cnv.dispatchEvent(new MouseEvent("mouseup", {...opts, buttons: 0}));
await new Promise(res => requestAnimationFrame(res));
}
async function pressKey(code) {
cnv.dispatchEvent(new KeyboardEvent("keydown", {code, bubbles: true}));
cnv.dispatchEvent(new KeyboardEvent("keyup", {code, bubbles: true}));
await new Promise(res => requestAnimationFrame(res));
}
})();Since when have games become more about just completing boring tasks and not about using your mind and dexterity to kill evildoers? Hell, the original Space Invaders was 100x more fun then this, and all we had to do was press a button to kill advancing aliens.
You have all kind of games, some that are actual programming, some that are purely reflexes and dexterity, some that are in between.
> Since when have games become more about just completing boring tasks and not about using your mind and dexterity to kill evildoers
I encourage you to browse Steam a bit if you are asking this.
Is Monopoly about skill? Chance? Or just scratching that itch of getting more tokens than the other person?
Like has someone invented a novel scheduler or sorting algorithm?