It seems that you're using an outdated browser. Some things may not work as they should (or don't work at all).
We suggest you upgrade newer and better browser like: Chrome, Firefox, Internet Explorer or Opera

×
avatar
disi: Only 248 cycles as is above! That is not bad... <snip>
avatar
rtcvb32: Glancing at the screenshot, i wonder why you didn't add the results of your interrupts, as that would effectively pass it with only 2 instructions...

But if it works, it works :P
good idea!
avatar
disi: good idea!
correction, 3 instructions.. Still, i've done way too much assembly language for my own good. Programming in general trains you to think in certain ways that are shorter and simpler once you work the logic out :P
adding the results brings it down to 203 cycles.
I must be missing something fundamental about this problem. It keeps saying my solution is wrong but I can't figure out why.

What I think I should be doing is sending a 1 when In.1 goes from 0 to 1, a 2 for In.2 etc. I've stepped through my code. All the inputs start at 0 and on step 6 In.4 goes to 1. I keep on stepping, it takes a while for the result to get through but on step 12 I send the number 4 to Out. This is the first thing I have sent to out, and it is marked as wrong!
In.4 is the first input to change, so if it doesn't want 4 as it's first output, what does it want?


edit - Finally worked it out with a bit of trial an error. It wants a zero written to out if none of the inputs has gone to 1. It doesn't actually say that in the specification.
Post edited August 28, 2015 by PeterWade
I solved this one in 358 cycles, 6 nodes, 43 instructions and thought that was pretty good. I basically have each input node detect when an interrupt occurs and output the interrupt number to the next node, or output zero. The next node outputs its own interrupt number or what it reads in from the node(s) to the left or right. They funnel from 1->2->3<-4 then down from 3 to the output. I thought it was clever, but evidently not clever enough if people are getting down near 203 clock cycles. :)

I'll have to take another stab at optimizing it. (I was careful to quickly skip over any code dumps in the thread so as to not taint, and probably wont try it again for a few days or more).