This repository has been archived by the owner on Feb 15, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 31
Software Challenges
schristian edited this page Apr 4, 2013
·
4 revisions
Here are some challenges to get you acquainted with our code base:
Python:
- FizzBuzz
- Iterate through all the numbers from 1 to 100.
- If the number is divisible by 3, print Fizz.
- If the number is divisible by 5, print Buzz.
- If the number is divisible by both 3 and 5, print FizzBuzz.
- Otherwise,print the current number.
- Fibonacci
- Make a program that prints out the first 30 numbers of the Fibonacci sequence.
- Try using as few lines as possible. Can you do it in 4 lines?
- List Swap
- Make a list of the first 6 letters (A, B, C, D, E, F).
- Add G to the end of the list.
- Add Z to the beginning of the list.
- Swap the elements B and C.
- Remove E from the list.
- Dictionary Practice
- Make a dictionary of names and ages for Ann, age 35, Bob, age 40, and Ryan, age 24
- Add Richard, age 26, to the list.
- Remove Ann from the dictionary.
- Print out the age of Bob.
- Print the names and ages of all people younger than 30.
AI:
- Square
- Modify gate.py to make Tortuga move in a square pattern. This square can be of any size.
- First, try doing this constantly facing the same direction.
- Afterward, modify your code to have Tortuga turn to face the direction of travel (except when diving).
- Cube
- Create cube.py and make Tortuga move in a cube pattern (I.E. do a square, dive down, then do another square).
- Make a new Task class for Cube in course.py, and have it work in the simulator (a bit tricky!).
- Make sure Tortuga is always facing the direction of travel (except when diving).
- You may only use 4 states (including Start and End). Be creative.
- Simple Buoy
- Modify gate.py to make Tortuga hit a red buoy.
- You will have to modify the simulator config files to use the scene with a single red buoy.
- Use the vision events to track the buoy. Do not use dead reckoning (it will not work very well).