Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

jaredkrinke

106
Posts
22
Topics
27
Followers
67
Following
A member registered Nov 29, 2018 · View creator page →

Creator of

Recent community posts

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 🙂

(3 edits)

Unfortunately that doesn't work (that was actually the first approach I tried). The localStorage calls all succeed on iPad--they just don't persist across page reloads :(

On a previous version of Safari, they would all fail and you could detect it, but that's not the case anymore...

For anyone who's curious, I attempted the following work-around:

  1. Detect if the game is running on iPad
  2. 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!

(2 edits)

Let me try a different question: is there anything I can do as a developer to make localStorage work for players on iPad on itch.io?

I've got people complaining that they lost hours of progress :(

@start:
subleq @count, @IN
@loop:
subleq @count, @n_one, @continue
@done:
subleq @OUT, @zero
subleq @count, @count, @start
@continue:
subleq @OUT, @n_one
subleq @zero, @zero, @loop
@zero: .data 0
@n_one: .data -1
@count: .data 0
@loop:
subleq @tmp, @IN
subleq @tmp2, @tmp, @done
subleq @count, @one
@loop_reset:
subleq @tmp2, @tmp2
subleq @tmp, @tmp, @loop
@done:
subleq @OUT, @count
subleq @count, @count, @loop_reset
@tmp: .data 0
@tmp2: .data 0
@count: .data 0
@one: .data 1
@loop:
subleq @tmp2, @IN
subleq @tmp, @tmp2, @done
subleq @sum, @tmp
subleq @tmp2, @tmp2
subleq @tmp, @tmp, @loop
@done:
subleq @OUT, @sum
subleq @sum, @sum
subleq @tmp2, @tmp2
subleq @tmp, @tmp, @loop
@sum: .data 0
@tmp: .data 0
@tmp2: .data 0
SIC-1 Solutions community · Created a new topic Division
@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

On iPad, if you play an HTML 5 game and then the tab reloads, you end up in the game's trailer for some reason. If you go back and click "Restore game", then it opens the trailer instead of the game.

Is this known? Is this the correct place to report a bug like this?

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.

FYI: The sandbox mode is in now, so it's possible to supply your own input (to test larger input programs).

Alternative color schemes are now available!

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 🙂

I had not considered adding an optional “light mode”. Good idea, thanks!

See also: https://steamcommunity.com/app/2124440/discussions/0/3714937078844251096/

SIC-1 Solutions community · Created a new topic Interleave

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

I would use “.txt”, given it is plain text and there aren’t any other programs that use SIC-1 Assembly Language 🙂

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.

Also, if you don’t mind sharing, why do you want to remove your saved data? If you think you hit a bug or something, let me know!

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).

(1 edit)

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.

Good suggestion! I’m not sure how much work is involved (and how much interest there would be).

I’ll take a look after the initial release (which I’ve made a lot of progress toward, but still doesn’t have a precise date).

Wow, glad you like SIC-1 that much! I guess you're basically the target audience if you like esoteric programming languages and games :)

For what it's worth, most of my inspiration came from TIS-100 by Zachtronics. You might want to check that one out. It's the first Steam game I 100%'d :)

Well done!

For the comment about writing bytes by hand, is that different from just negating a character value (i.e. ".data -'0'")?

Fixed a bug that would crash them game if a new player reloaded the page. If the game didn't work for you, please try again!

I almost went down this path in my initial attempt to beat the final puzzle (to make sure it was indeed possible to beat). For the record, I think writing your own compiler is fair game for something like this. Nice work!

I just published a relatively large update that includes improved graphics, many fixes, and some under-the-hood changes. Post a comment if you run into any issues, thanks!

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

Just released an updated client that resets the simulation (and stats) when advancing to the next test set. This is similar to what is done server side, and should prevent this trick (except for the handful of "tutorial" assignments that don't validate solutions using random data).

I never replied here, but there's a solution up now for reference.

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).

(1 edit)

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! ;)

Great suggestion! Also, this optimization may make code less readable, thus ensuring continued employment ;)

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

(1 edit)

The "reverse sequence" puzzle is very similar to the "stack memory" puzzle, with the difference that you need to check for the zero that denotes the end of the sequence (and later also output a zero).

Does that help?

Edit: check the solutions forum if you're still stuck.

FYI: I'm using Edge on Windows, in case this issue is somehow related to Windows line endings.