<

Challenge 5

User Image Log-in
with Discord

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.

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
or

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.

Here is your extruded wire:
Because the image is only 1 pixel wide, clicking the link may appear to do nothing. Instead, right-click the link and choose 'Save Link As' to download it.