3 ms·
That's trivial; a shift register that latches the 15 initial values, and then just rotates them around, reading off the last one as the output.
by kazinator 3y ago
That's trivial; a shift register that latches the 15 initial values, and then just rotates them around, reading off the last one as the output.
- sweettea 3y agoAh, but for 8 of the values, you need to print the number, which changes each iteration.
- bjoli 3y agoThis realization almost got me suspended in a high school. Our goal was to make an extensible fizzbuzz(barbazzfrongetc)er and I got fascinated by the problem of making wheels. I wrote a program the generated circular lists in mit scheme that could be used as wheels (ie circular lists with either #f or fizz, buzz, bar, fizzbuzz etc). It was structured as a competition (fastest fizzbuzz up to int16 where the fizzes and buzzes would be given by the teacher at competition time), and the winner would get a chocolate bar or something inane. I couldn't eat it because I can't eat milk. I was the only one who spent some serious time on the task, and in the end my implementation was the fastest by several orders of magnitude, despite being the only using something else than C, C++ or java. The programming teacher refused to believe I wrote it myself, but due to a stroke of luck I have saved every revision of the code as a part of a primitive folder based SCM-scheme. I ended up getting a louse grade due to me not caring too much about school, but the teacher and I were on good terms and he became somewhat of a programming mentor to me