Skip to content
This repository has been archived by the owner on Feb 15, 2020. It is now read-only.

Software Challenges

schristian edited this page Apr 4, 2013 · 4 revisions

Here are some challenges to get you acquainted with our code base:

Python:

  1. 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.
  1. 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?
  1. 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.
  1. 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:

  1. 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).
  1. 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.
  1. 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).