Unsure what to bring on your dive trip? 🤿 Get our Essential Scuba Packing List
Blog Find a Dive Shop Replace your Card
HTMS Sattakut

The goal is to have Karel lay a checkerboard pattern of beepers across the entire world, regardless of size (but usually assuming no walls inside and an even or odd number of rows/columns).

def main(): put_beeper() # Start the pattern while left_is_clear(): fill_row() transition_to_next_row() def fill_row(): while front_is_clear(): move() if front_is_clear(): move() put_beeper() Use code with caution. Copied to clipboard 645 checkerboard karel answer verified

Karel starts at (1, 1) facing East. You need to fill the world with beepers in a checkerboard pattern. The catch? Your code must work for a 1x1 world, an 8x8 world, and even a 5x2 world. The goal is to have Karel lay a

If Karel just finished a row at an even-numbered street, the next row must be offset to maintain the pattern. You need to fill the world with beepers

/* * This function handles painting the entire grid by moving row by row. */ paintBoard() {

Dive Here
All nearby dive shops
Learn to Dive Begin online with one of our beginner courses, or expand your skillset with recommended courses for this dive site. Learn Now
Book your activities at this site with local PADI dive shops
Reviews
Other Dive Sites Nearby
x

Save that favourite

With a PADI Travel account, you can favourite dive operators to come back to later on any device or computer

Log in or sign up