Part One:
Pixel Perfect Panic
You performed so well in the galley that the crew in the generator room has requested your help today. Their Power Harvester machine, which gathers energy from nearby stars to fuel the ship, is functioning fine. However, they are having trouble reading the outputs that indicate how many gigajoules(GJ) of energy have been collected.
Here's how the Power Harvester works:
After sending a photon collection
beam toward a star, the energy from that star is gathered and stored in one of the power
tanks in the generator room. Although the Power Harvester is somewhat outdated, it has
been reliable over the years with minimal updates. Instead of a digital
display, this antique machine extrudes
a long, thin wire of singular
pixels. This wire is then fed into the more modern
P.I.L.
(Patterned Image Layout) System, which reconstructs it into a square image. The
resulting image displays the number of GJ harvested.
Despite its age, the Power Harvester is known for its good old-fashioned reliability and continues to run smoothly. However, the P.I.L. System is failing and can no longer reconstruct the wire into a viewable square image. You need to reprogram it to restore this function.
- You can be certain that the length of wire extruded from the Power Harvester machine is a perfect square, which means that it can be arranged into an image with equal width and height.
- To create the image, start at point (0,0) and lay wire to the right until you reach the end of the row, indicated by the width of the desired square image. Then, move down a row and lay the wire to the left, zigzagging from top to bottom and left to right until the entire wire is used.
For example:
The wire with pixels
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
would zigzag into the following formation
0 | 1 | 2 | 3 |
7 | 6 | 5 | 4 |
8 | 9 | 10 | 11 |
15 | 14 | 13 | 12 |

Once correctly laid out in a square configuration, a larger wire with more pixels might produce an image like

making the amount of energy obtained by the Power Harvester 79GJ.