Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
Hesh Ballantine
Feb 13, 2012
This game is such a joy - I am in the middle of an intro systems class, and we are deep in x64 assembly right now. TIS-100 is like... a vacation. Of course, my wife can't understand why I would want to play a game that looks so much like my homework. :) I think the thing I like best (probably not an uncommon sentiment) is when your surprisingly short and elegant solution actually works, and you see yourself come in ahead of the curve on statistics.

I'm curious about people's preferred optimization directions? I tend to prefer (or perform better at, anyway) as small an instruction set as possible, although obviously the trade-off there is cycles.

I wonder if Zachtronics has considered educational licenses for TIS-100? I could see giving this to a class full of middle schoolers.

Adbot
ADBOT LOVES YOU

Eliza
Feb 20, 2011

Hesh Ballantine posted:

I wonder if Zachtronics has considered educational licenses for TIS-100? I could see giving this to a class full of middle schoolers.

He does actually offer educators' licensing for Spacechem, so I'd assume the thought crossed his mind at least.


I prefer to optimise for execution speed. No point in waiting around for the solution to finish if you don't have to. Short of parallelisation or some caching mechanism this often coincides with shorter code anyway, though maybe not the shortest.

Zemyla
Aug 6, 2008

I'll take her off your hands. Pleasure doing business with you!
I only just now found this thread, and god drat you, GuavaMoment.

drguildo
Apr 27, 2013

LISTEN TO THE CROWD ROAR IN ADMIRATION!
Somebody please, for the love of god, help me with Sequence Peak Detector so I can feel like I'm not a complete failure as a programmer.

My strategy so far has been to have the first input node routing numbers left and right and then reading from left and right when 0 is encountered. The other nodes (I've only been working on the minimum finder) have been using subtraction to compare numbers and storing the appropriate one in bak. I've been using another node to store values in and also experimented with the storage or routing nodes feeding the same value into the comparison node twice.

The problem is that no matter what I've tried, I can never get the number of instructions I need to fit into the comparison node. :confused:

Dr. Stab
Sep 12, 2010
👨🏻‍⚕️🩺🔪🙀😱🙀
Without seeing your approach, I can't really give you specific advice without telling you the answer.

Though, here are some things that some players don't realize: Labels can be on the same lines as instructions. You don't need to write JMP START at the end of every node. It'll just loop around on its own.

drguildo
Apr 27, 2013

LISTEN TO THE CROWD ROAR IN ADMIRATION!

Dr. Stab posted:

Without seeing your approach, I can't really give you specific advice without telling you the answer.

Though, here are some things that some players don't realize: Labels can be on the same lines as instructions. You don't need to write JMP START at the end of every node. It'll just loop around on its own.
I'm aware of both those things, unfortunately. I'm gonna have another stab at it so I'll post my failure when I'm done.

grate deceiver
Jul 10, 2009

Just a funny av. Not a redtext or an own ok.
Can anyone shed some light on what the second row puzzles are all about? I'm not sure I understand what does 'sequences are zero-terminated' mean.

Praseodymi
Aug 26, 2010

grate deceiver posted:

Can anyone shed some light on what the second row puzzles are all about? I'm not sure I understand what does 'sequences are zero-terminated' mean.

The sequences end in a zero.

grate deceiver
Jul 10, 2009

Just a funny av. Not a redtext or an own ok.

Praseodymi posted:

The sequences end in a zero.

That's not what I meant, but I just took a peek at the inputs and outputs table, and uh, yeah, it's obvious now what I need to do. Brainfert I guess :shrug:

Eliza
Feb 20, 2011

drguildo posted:

The problem is that no matter what I've tried, I can never get the number of instructions I need to fit into the comparison node. :confused:
You dont need to go the comparison in a single node. I have two separate nodes for that, one for the higher and one for the lower number peaks, which run in parallel and are then combined in the end.

ErIog
Jul 11, 2001

:nsacloud:
Does anyone know if they plan on doing a third round of content for this? The concept is real cool, but I want more puzzles to solve.

drguildo
Apr 27, 2013

LISTEN TO THE CROWD ROAR IN ADMIRATION!

Eliza posted:

You dont need to go the comparison in a single node. I have two separate nodes for that, one for the higher and one for the lower number peaks, which run in parallel and are then combined in the end.
Sorry, I didn't explain it very well. I am doing the min and max in separate nodes, the routing being handled by another node..

drguildo
Apr 27, 2013

LISTEN TO THE CROWD ROAR IN ADMIRATION!

ErIog posted:

Does anyone know if they plan on doing a third round of content for this? The concept is real cool, but I want more puzzles to solve.
I haven't heard of any plans and, although I might just be being cynical, I think the fact that they added a way for people to publish their own puzzles indicates they don't plan on adding any more.

Dr. Stab
Sep 12, 2010
👨🏻‍⚕️🩺🔪🙀😱🙀
That feature predated the second set of levels, which are all user made.

ymgve
Jan 2, 2004


:dukedog:
Offensive Clock
I assume Zach is finished with the game - it is a pretty small game and seems more of a side project he did while working on Infinifactory.

I wonder if this pen-and-paper thing hints about his next game - something related to biochemistry?

grate deceiver
Jul 10, 2009

Just a funny av. Not a redtext or an own ok.
Ok, maybe I'm just too dumb for this game, but what do I need to do in Interrupt Handler? Do I need to write the input number whenever it changes from 0 to 1? Then why on the 5th set of inputs the expected output is 0 and not 3?

overeager overeater
Oct 16, 2011

"The cosmonauts were transfixed with wonderment as the sun set - over the Earth - there lucklessly, untethered Comrade Todd on fire."



You only write the input's number on the round it goes from 0 to 1. In set 5, none of the inputs change: IN.3 is 1 in set 4 and 5. Therefore, the expected output is 0.

grate deceiver
Jul 10, 2009

Just a funny av. Not a redtext or an own ok.
Oh, I see. I was looking at the horizontal sequences, instead of the vertical ones for each input node :downs:

grate deceiver
Jul 10, 2009

Just a funny av. Not a redtext or an own ok.
Any hints on how to shave off a few more cycles for that Signal Amplifier cheevo? I got it down to 105 and don't really see what else to improve.

Dr. Stab
Sep 12, 2010
👨🏻‍⚕️🩺🔪🙀😱🙀
Try doing the whole operation in one node instead of two.

an actual frog
Mar 1, 2007


HEH, HEH, HEH!

grate deceiver posted:

Any hints on how to shave off a few more cycles for that Signal Amplifier cheevo? I got it down to 105 and don't really see what else to improve.

The accumulator can be added to itself

grate deceiver
Jul 10, 2009

Just a funny av. Not a redtext or an own ok.

Mechanism Eight posted:

The accumulator can be added to itself

Haha, welp, how did I not try this sooner :v:

drguildo
Apr 27, 2013

LISTEN TO THE CROWD ROAR IN ADMIRATION!
So here's an example of a typical attempt of mine at the lowest value portion of Sequence Peak Detector.



There simply aren't enough instructions for my method and I'm obviously not smart enough to shave off any instructions or split the work across multiple nodes.

The main logic node doesn't work the following way:

  • BAK is used to store the current lowest value
  • The first value of the sequence is stored in BAK as by default it's the lowest value
  • The next value is checked. If it's zero BAK is sent to OUT.I and the process is started over
  • Otherwise the value is written to the storage node on the left and compared to BAK (after a SWP) using SUB
  • If the result is greater than 0 then the value is less than the current lowest and so it's stored in BAK
  • Otherwise it's greater (or equal) to the current lowest and so that value is retained.
  • There's a missing JMP instruction just before the L label because I don't have room.

Any hints on how to solve this or about the game in general would be much appreciated.

drguildo fucked around with this message at 16:36 on Dec 22, 2015

Dr. Stab
Sep 12, 2010
👨🏻‍⚕️🩺🔪🙀😱🙀
You don't need to store both values during a comparison. Like, if you do a-b=c, and you have c and one of a or b, then you can reconstruct the missing component.

Also, you have one node doing both parsing the input and also handling comparisons. You can split that up if you need to. JRO can take external input, meaning that you can take control signals from another node without storing anything.

Zteuer
Nov 8, 2009
The MOV command does not have to go through the accumulator (MOV UP DOWN is fine).

Mild spoiler 1 regarding memory:
Instead of using SAV/SWP, structure your code so that it can use your middle leftmost node.

Mild spoiler 2 regarding the sequence:
The first number in a sequence is the currently smallest number

Phssthpok
Nov 7, 2004

fingers like strings of walnuts
Here's a simple sequence peak detector. Very spoilery, but based on a simple principle: duplicate inputs, then use the first copy for deciding whether it's the best value seen yet, and the second copy for either backing up or deciding whether the sequence is finished. Then when it's finished, output whatever is backed up.



This is an interesting level because the two branches can't be simple mirrors of each other without requiring a third copy of the input. A 0 will go down the "found" path on the "min" side, but the "not_found" path on the "max" side, so you can't rely on being able to discard a value if you also need it to jump to done.

Phssthpok fucked around with this message at 13:26 on Dec 23, 2015

drguildo
Apr 27, 2013

LISTEN TO THE CROWD ROAR IN ADMIRATION!

Dr. Stab posted:

You don't need to store both values during a comparison. Like, if you do a-b=c, and you have c and one of a or b, then you can reconstruct the missing component.
But doesn't that imply that you do have to store two values?

Dr. Stab
Sep 12, 2010
👨🏻‍⚕️🩺🔪🙀😱🙀

drguildo posted:

But doesn't that imply that you do have to store two values?

Sorry, I thought you were doing swaps in order to store all 3 values, but it seems that you're using the second node just so that you can compare acc and bak.

Swaps eat up a lot of space. Here's an edited version of your existing middle node that eliminates swaps by just using the two nodes as your two registers.

code:
MOV UP ACC
S: MOV ACC LEFT
   MOV UP ACC
   JEZ Z
   SUB LEFT
   JGZ L
   ADD LEFT
   JMP S
L: MOV LEFT ACC
   JMP S
Z: MOV LEFT DOWN
   MOV LEFT NIL

Orthogonalus
Feb 26, 2008
Right angles ONLY

Phssthpok posted:

Here's a simple sequence peak detector. Very spoilery, but based on a simple principle: duplicate inputs, then use the first copy for deciding whether it's the best value seen yet, and the second copy for either backing up or deciding whether the sequence is finished. Then when it's finished, output whatever is backed up.



This is an interesting level because the two branches can't be simple mirrors of each other without requiring a third copy of the input. A 0 will go down the "found" path on the "min" side, but the "not_found" path on the "max" side, so you can't rely on being able to discard a value if you also need it to jump to done.

This is one of the levels I did really badly on, so I copied your solution to see how much better it was, and it was about 150 cycles better than mine and now I'm at the top of my leaderboard. Whoops.

Dr. Stab
Sep 12, 2010
👨🏻‍⚕️🩺🔪🙀😱🙀

Orthogonalus posted:

This is one of the levels I did really badly on, so I copied your solution to see how much better it was, and it was about 150 cycles better than mine and now I'm at the top of my leaderboard. Whoops.

Same except I also used it to get a minimal nodes solution.

nielsm
Jun 1, 2009



Got myself this yesterday. Managed to push through all the puzzles (on page 1), except for the sorting one, so far. I know how I want to solve it and I know it should be possible that way, it's just working it all out, with node placements, protocols, etc.

Yoshimo
Oct 5, 2003

Fleet of foot, and all that!
Are there any games like this but...less hard? :effort:

zedprime
Jun 9, 2007

yospos

Yoshimo posted:

Are there any games like this but...less hard? :effort:
Human Resource Machine has you doing similar mathematics based assembly coding, with a more visual interface and a slightly calmer ramp. The visual interface is more or less hard depending how your brain works, but the calmer ramp is more illusory and the difficulty walls still exist.

Samopsa
Nov 9, 2009

Krijgt geen speciaal kerstdiner!
Besides Human Resource Machine... go make programs in BASIC or something, I guess?

ErIog
Jul 11, 2001

:nsacloud:

Yoshimo posted:

Are there any games like this but...less hard? :effort:

Infinifactory might be somewhat better for you since the logical concepts are very very similar to TIS-100 while having theming that's more similar to other games.

Though, without knowing why you find this game so hard it's difficult to know what to recommend since any of those recommendations might end up being hard in the same way as this game.

drguildo
Apr 27, 2013

LISTEN TO THE CROWD ROAR IN ADMIRATION!
Anybody interested in TIS-100 might be interested in BOX-256.

homercles
Feb 14, 2010

I've spent way too much time on Sequence Sorter, hosed if I know why this was the 2nd last puzzle when it's the hardest one by a mile. Can't figure out how to do it without hitting the instruction limit per node. Algo wise it looks like insertion sort is the simplest approach but I can't figure out how to do it without hitting a node's instruction limit at the comparison site. Trying to pass off responsibility at the comparison site means lots of message passing and JRO jump tables and every node I try to pass responsibility to gets filled up with message passing poo poo.

God drat it. ([e] spoilers, will post code after work)

homercles fucked around with this message at 20:42 on May 17, 2016

ErIog
Jul 11, 2001

:nsacloud:
Post your code.

homercles
Feb 14, 2010

Code here: http://pastebin.com/8xirQkBQ



At this point it has become too complex and I can't achieve what I want with the constraints I've imposed, so I'll throw it all away. There is a 'MOV 11 RIGHT' instruction in the 2nd line of node #6 that should actually be 'MOV 9 RIGHT'.

It's the rightmost set of nodes that's currently giving me trouble. The mid-rightmost node #8 (I'll call it R) is fed stuff from the middle node #7 under the stack node (I'll call it M), with this contract:
  • M sends R two numbers, the first guaranteed to be nonzero and come from the IN datasource. All subsequent numbers will be coming from the bottom stack memory node.
  • M receives a jump offset from R to cover two conditions:
    • If the last number to be sent to R was 0 (there are no more nodes in the bottom stack node), or was greater than the first number that came from input IN (insertion sort condition met), we flush all the top stack to the bottom stack (JRO 1, labelled F)
    • Otherwise the number is nonzero and smaller than the first IN number, so request another number from the bottom stack node (JRO 9, labelled 9R)
  • Node M's labels F and Z are jumped to via the JRO DOWN instruction (that's not important to R)

I can't achieve this without filling up one of the rightmost nodes. I think a better approach would be to feed the rightmost set of nodes from the bottom node #12, so data feeds from #12 to #8 to #4, to reduce back and forth messages between them clogging up the 15 instruction limit. This requires a rewrite since #7 and #11 are pretty hectic as is.

Adbot
ADBOT LOVES YOU

Jabor
Jul 16, 2010

#1 Loser at SpaceChem
I think there's one big trick you're missing: when subtracting two numbers to compare them, you only need to keep one of the original numbers around. You can reconstruct the other one via addition.

This should let you eke out a little more space.

  • Locked thread