|
Pages: [1]
|
 |
|
Author
|
Topic: Challange: Count number of boxes of each type (Read 2737 times)
|
|
Daniel Nilsson
|
I have made a machine to solve this problem but I challenge everyone to try to solve it too before I post my solution.
Input: A stream of random boxes. Output: 16 counters, one for each type of box.
The machine should be able to count more than 16 boxes of each type (mine goes to 255). There are no timing constraints, you can feed new boxes to the machine as slow as you want (I do 4 cycles per box, but I think it could handle one box every other cycle).
Good luck!
|
|
|
|
|
Logged
|
|
|
|
|
krajzega
|
I don't know about handling a crate every other cycle - I can't make the dozers deliver less than two-cycle gaps between crates. My counters can handle full speed though, with no gaps between inputs. The problems lies with the pipes and dozers. The solution is at fusydis. It might be a bit buggy, I didn't really check the thing after all the copy-pasting. Just left it running for a while, and it seemed to give plausible results. Now it's time to see yours  . The counters are on the hazard tiles, with more significant digits on the right. The layout of the counters themselves is as follows: 37BF 26AE 159D 048C
|
|
|
|
« Last Edit: October 15, 2006, 06:53:30 AM by krajzega »
|
Logged
|
|
|
|
|
sluutthefeared
|
I was doing the carry a bit differently so my counters weren't quite compact enough to fit in all 16 blocks. So I took the basic counters from yours krajzega and used a different way to feed them numbers so it would be full speed. zimasatThe counters have a crate in their section to signify what's being counted, and like yours the hazard symbols are the counts with most significant digit to the right.
|
|
|
|
« Last Edit: October 14, 2006, 09:20:45 PM by sluutthefeared »
|
Logged
|
|
|
|
|
krajzega
|
 |
a
« Reply #3 on: October 14, 2006, 10:10:27 AM » |
|
Very nice, I wouldn't think of the pipe/adder/copier trick for sorting the blocks. I'll remember that just in case I would need it somewhere else  . I must admit that I concentrated on creating a compact full-speed counter, and didn't put that much thought in the design of the whole machine - just enough to make it work. I'm wondering how the counters in the original poster's solution work, and if they are any similar to mine.
|
|
|
|
|
Logged
|
|
|
|
|
Daniel Nilsson
|
Wow, those are nice machines! I specially like sluutthefeared's full speed sorting. Both of the solutions posted so far have much nicer sorting than my solution. I started by making the counter and added the sorting in an ad-hoc fashion later. My machine that started this challenge can be seen at doxumib. Note that the digits in the counters are in natural order (least significant to the right). The counter are also easy to extend to more digits and are very compact, 6 tiles high (but can be be packed with one tile overlap) and 3 tile wide per digit.
|
|
|
|
|
Logged
|
|
|
|
|
|
Pages: [1]
|
|
|
 |