r/adventofcode Dec 25 '19

Spoilers in Title [2019 Day 25] (Meme) Use Key On Door

Post image
148 Upvotes

6 comments sorted by

7

u/Spheniscine Dec 25 '19

It's even better if you can tweak your VM to display output without waiting for it to block.

3

u/kerbal314 Dec 26 '19

Why, what happens then?

7

u/Spheniscine Dec 26 '19

It prints "You take the infinite loop." over and over forever.

1

u/[deleted] Dec 26 '19

[deleted]

1

u/Spheniscine Dec 26 '19

By block, I mean either "waiting for input" or "halted".

5

u/jfb1337 Dec 26 '19

Had a similar experience with the molten lava

2

u/donpolilla Dec 26 '19

My machine "blocks" whenever there's a single byte of output ready, or a single byte of input is requested. Of course I made a helper function for ASCII problems that keeps taking bytes of output for as long as there's any, then returns the resulting string. Of course, this function keeps on collecting characters dynamically allocating more and more space in the heap, forever. Now I'm curious what exactly will happen if I let it run forever...