Thanks for the detailed response! I guess if I ever get in the position of having a lot of players on iPad, it will be time to just do a proper port 🙂
jaredkrinke
Creator of
Recent community posts
For anyone who's curious, I attempted the following work-around:
- Detect if the game is running on iPad
- If so, prompt the user to click a link to load the frame's URL in a new tab (ensuring localStorage writes are no longer cross-domain)
#2 works, but, to my surprise, I couldn't find a reliable way to determine if the user is on an iPad. Recent Safari updates make iPads (and iPhones) claim to be desktop Macs, so you have to resort to fragile fingerprinting techniques. (Unsurprisingly, there also is no way to detect if "Prevent Cross-Site Tracking" is enabled.)
If anyone has other ideas, let me know!
@start: subleq @tmp, @IN subleq @remainder, @tmp subleq @tmp, @tmp subleq @tmp, @IN subleq @divisor, @tmp @loop: subleq @n_quotient, @one subleq @remainder, @divisor, @leq subleq @tmp, @tmp, @loop @leq: subleq @tmp, @tmp subleq @tmp, @remainder, @eq subleq @n_quotient, @n_one subleq @tmp, @tmp subleq @tmp, @divisor subleq @remainder, @tmp subleq @divisor, @divisor, @done @eq: subleq @remainder, @remainder, @done @done: subleq @OUT, @n_quotient subleq @tmp, @tmp subleq @tmp, @remainder subleq @OUT, @tmp subleq @remainder, @remainder subleq @divisor, @divisor subleq @n_quotient, @n_quotient subleq @tmp, @tmp, @start ; Variables @tmp: .data 0 @remainder: .data 0 @divisor: .data 0 @n_quotient: .data 0 ; Constants @one: .data 1 @n_one: .data -1
In Safari on iPad, there is now a default setting called "Prevernt cross-site tracking". Unfortunately, this breaks localStorage for HTML5 games on itch.io because the games are hosted in a frame on a different domain (and this is considered cross-site tracking).
Is this known? Are there any plans to mitigate this? E.g. allow opting into either: a frame running on the same domain, or launch the game in a new tab.
I’m planning to add a “sandbox” mode where you can manually specify input and view output.
I’m not familiar with Steam Workshop, but I am planning to investigate it for allowing players to create new puzzles (although I’m not sure how feasible that would be for the Itch/web version).
Also, thanks for the WASD idea for Avoision 🙂
149 cycles, 62 bytes
@loop: subleq @tmp, @IN subleq @tmp2, @tmp2 subleq @tmp2, @tmp, @dequeue @queue: subleq @stack, @tmp2 subleq @count, @n_one subleq @queue, @n_one subleq @tmp, @tmp, @loop @dequeue: subleq @OUT, @stack subleq @tmp, @IN subleq @OUT, @tmp subleq @dequeue+1, @n_one subleq @tmp, @tmp subleq @count, @one, @done subleq @tmp, @tmp, @dequeue @done: subleq @OUT, @IN, @loop ; Constants @one: .data 1 @n_one: .data -1 ; Variables @tmp: .data 0 @tmp2: .data 0 @count: .data 0 ; Base of stack (stack will grow upwards) @stack: .data 0
That makes sense, thanks! I have plans to add a "reset" button that would restore the original code, but that work isn't done yet. If you don't mind potential spoilers, you can just search for the puzzle name in this file to see the original comments: https://github.com/jaredkrinke/sic1/blob/master/sic1/shared/puzzles.ts
As far as downloading, right now itch.io is the only option. If you use Steam on Windows, SIC-1 is releasing there (also for free) on Friday (with cloud saves). I don't have any other release plans. For the record, GitHub only has the source code and there are compilation steps required, so that unfortunately won't work for playing, in general.
Do you mean your saved programs/progress or your leaderboard scores?
For your code and whatnot, it’s stored in HTML Local Storage in the browser (on your computer). Deleting it is different by browser, but for Chrome open dev tools with F12, go the Application tab, and delete the entries that start with “sic1_”. Clearing browser history also deletes it, but that also deletes all your browser history, which you probably don’t want.
For deleting leaderboard data, I haven’t published the instructions yet, but the instructions will be in the next update (coming next weekend). If that’s what you’re looking for, let me know which browser you’re using and I can try and give you instructions that will work on the current version (there’s no UI for this in the current version).
Everyone with the same number of tasks completed sees the same rank.
On the web leaderboard the relative order between people with 30 tasks completed is arbitrary. Maybe I should make it alphabetical or something just so people don’t waste time trying to improve their position 🙂
Edit: maybe the web leaderboard should just be a “hall of fame” for everyone who completed all the tasks.
Just published an update that addresses this. "@IN" is now supported in either (or both) of the first two address slots:
- "subleq @foo, @IN, @bar" is the most common case and works the same as before
- "subleq @IN, @foo, @bar" will read an input, subtract @foo from it, and then branch if the result is less than or equal to zero (and note that the input is not saved anywhere, obviously, so it basically disappears)
- "subleq @IN, @IN, @bar" will only read the input once, and it will always branch to @bar because the result of subtracting a number from itself is always zero), and again, the input value is not saved anywhere
One additional note: prior to February 2020, it was possible to submit hard-coded output like this and make it onto the histograms. This is no longer possible, but I have to go back and clean up the histograms.
I'm also planning to see if I can, as you suggested, reset the machine for each set of tests (just need to ensure this doesn't break legitimate solutions).
Intriguing! I never thought of using the memory to draw pictures. That actually makes me wonder if a new type of puzzle could be added: images/animation. Maybe I'll have to look into making an expansion...
Also, that optimization is great, but I'm afraid someone beat you to it :)
https://itch.io/t/2265164/small-byte-optimization-tip
Regardless, I hearby name you SIC Systems Employee of the Month! ;)
I haven't looked at the code in a while, but it's likely that that is exactly what I'm doing on the server side. It would make sense to do the same thing on the client side (I don't recall if there was a reason for the discrepancy), although that could potentially break some existing solutions. Regardless, thanks for flagging this for me!
Thanks! There is some logic to filter out these kinds of submissions on the server, to avoid showing them to other players (the submitter will still see their scores, however, as in your screenshot).
Having said that, the current filtering mechanism is not perfect, so some determined player could certainly get their bogus scores to appear on those histograms (side question: if someone goes through that much trouble, should I be flattered?). I could add a heuristic that tests programs on random inputs to make sure they're similar to the fixed inputs.
You're right that there's a bug. Thanks for bringing it to my attention!
My original intent was to have writes to @IN be ignored, but it looks like I never actually implemented that behavior. I'm inclined to fix the bug (someday...), but I want to see if anyone's existing solutions depend on the current behavior.
Additional commentary:
- The value is read into "@tmp" so that I can check to see if it's zero (i.e. the end of a list)
- The second line after "@stack_push" ("subleq @stack_push, @n_one") increments the destination address of the operation, so next time the item will be written to the next larger address
- "@end" is when the end of the list is encountered and it copies the stack address (which happens to be at "@stack_pop+0", i.e. just "@stack_pop") to the write address of the instruction at "@stack_pop_read" (i.e. "@stack_pop_read+1")
- That address is then decremented each time through the loop ("subleq @stack_pop_read+1, @one")
- The zero terminator is written with the first line of "@reset" ("subleq @OUT, @zero")
Very similar to the "stack memory" puzzle, just with handling lists' zero terminators:
@start: subleq @tmp, @IN subleq @tmp2, @tmp, @end subleq @arg, @tmp @stack_push: subleq @stack, @arg subleq @stack_push, @n_one subleq @count, @n_one subleq @arg, @arg subleq @tmp2, @tmp2 subleq @tmp, @tmp, @start @end: subleq @tmp, @tmp subleq @tmp, @stack_push subleq @stack_pop_read+1, @stack_pop_read+1 subleq @stack_pop_read+1, @tmp @stack_pop: subleq @count, @one, @reset subleq @stack_pop_read+1, @one @stack_pop_read: subleq @OUT, @stack subleq @tmp, @tmp, @stack_pop @reset: subleq @OUT, @zero subleq @count, @count subleq @count, @n_one subleq @tmp2, @tmp2 subleq @tmp, @tmp, @start ; Constants @zero: .data 0 @one: .data 1 @n_one: .data -1 ; Variables @tmp: .data 0 @tmp2: .data 0 @count: .data 1 @arg: .data 0 @result: .data 0 @stack: .data 0