Petition Details and Chat

Petition ID 5842: Inconvenient Infinite Loop Detector
Submitted Wed, 28 Aug 24 20:50:02 +0000

What:

I'm programming a minigame in my place, and I'm trying to conserve memory. In order to do this, I've got several different mathematics widget programs, such as a 2 digit compiler program (takes two single digit inputs and turns it into a two digit output) and an insert program (checks a digit, then uses that digit to work out which digits need to be changed). Both of the aforementioned widgets require multiplication, so I made a x10 widget program to do that: set an input thought, run the program, the output thought is now set to ten times that value.

My problem lies with the infinite loop detector. If I want to use a program, I can't use it more than three times. This is most obvious with the x10 widget, but it also gets more convoluted the more I develop the program. I use the 2 digit compiler twice to check two values: if I do that check once in the page program and once in the room program, that is a total of four uses, which will trip the infinite loop detector.

The Infinite Loop Detector is working as designed, so it's not a bug: I can also get around it by making duplicate programs, which is a viable solution, it's just a hassle and bloats the number of programs used, and can very quickly get out of control if I'm duplicating commonly used widgets (my x10 widget, for example, is run once per two digit compiler, which is run twice per memory read, which is run twice on some pages. It's also run three times for each x1000 widget, which is run once for the insert program, for a minimum number of seven runs on specific pages).


How:

Use four run program (A) contraptions across your active programs (page and room).


Where:

Programming, any place for the general problem.

Programming, Explosive Jungle Region (G,22) if you want to see the spaghetti:
https://www.improbableisland.com/runmodule.php?module=places&placeid=1390&roomid=37786&prevroom=&op=contrivances&sub=list&c=323-200150
The programs in question are:
- Multiply x10 (Program ID 18901) - takes thought_inputvalue and uses incrementing to give thought_outputvalue
- 2DigitCompile (Program ID 18902) - takes thought_unitsinput and thought_tensinput and and uses 'Run Program: Multiply x10' once to give thought_outputvalue
- Multiply x1000 (Program ID 18903) - takes thought_inputvalue and uses 'Run Program: Multiply x10' three times to give thought_outputvalue
- Insert Choice (Program ID 18904) - takes thought_inputvalue and adds it to the first three digits or second three digits of memory_GLOBAL:Nascat, using 'Run Program: Multiply x1000' to affect digits 4, 5 and 6.
- Read: G:N D1-6 (Program ID 18898) - runs 6 subset programs (Read: G:N D1, e.t.c), each of which run a lookup table to set thoughts equal to the relevant digits of memory_GLOBAL:Nascat.
- Full Read (Program ID 18908) - uses 'Run Program Read: G:N D1-6' to get a value for each of the digits of memory_GLOBAL:Nascat, then uses 'Run Program: 2DigitCompile twice on digits 2 & 3 and on digits 5 & 6 to create two digit numbers, output as thought_p1choice and thought_p2choice.

When:

First encountered this problem 7/28/24 as I started reusing the x10 widget in my programming at that time.


Petitioner's note:

This isn't a gamebreaking problem. It's mostly mathematical operations that get repeated this much: multiplication and compiling (combining tens digit and units digit) are what I'm repeating personally.
I also had a similar issue with reading specific memory digits to thoughts, which I solved by swapping from iterative (is digit = thought? if yes end, if no increment thought by one and run program again) to a lookup table (is digit 0? if yes set thought to 0 and end, if no[ is digit 1? if yes set thought to 1 and end, if no...]). I repeated this lookup table for every relevant memory digit.

Back to the List of Petitions

You have to be logged in to chat.