Created
July 29, 2020 23:21
-
-
Save cngondo/25d2712105583f15726dddbca8276949 to your computer and use it in GitHub Desktop.
A farmer has asked you to develop a program for a robot that fills empty trays of eggs. How would you do that? A tray has 30 eggs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Define a tray as a collection with length of 30 | |
Define the eggs | |
Iterate over the tray | |
Check if there's any empty space | |
If spaces exist | |
Fill up the empty tray spaces with an egg | |
If full | |
Inform farmer that tray is full | |
Create another tray | |
Call iteration to begin filling the new tray | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment