/Python-Challenges-Solutions

These are collective solutions for Python Bootcamp's challenges

Primary LanguagePython

Python-Challenges-Solutions

These are collective solutions for Python Bootcamp's challenges

Tables of contents

Turtle module challenges

This comprises of solutions solved for challenges in the course:

  • Challenge 1: Draw a square
  • Challenge 2: Draw a dashed line
  • Challenge 3: Draw a different shapes
  • Challenge 4: Draw a random walk
  • Challenge 5: Make a spirograph. Demo-5
  • Challenge 6: The Hirst Art Painting. Demo-6

Demo-5:

spinograph

Demo-6:

giphy

Turtle racing challenge

This challenge is to build a racing competition for 6 turtles along with x,y coordinates. At first, the program will ask for user pet and the racing starts right after. At the end, the user pet will be compared with the winner. Whether the pet is correct or incorrect, the result is still printed out to the console.

Demo video

Turtle racing game demo

Snack Game

This challenge is to build a snake game where user can extend the snake length by eating the turtle and avoid colliding with the walls or own tail. The score increases whenever the snake is fed and game is over when unexpected collision happens.

Demo video

Snack Game Demo Video

Pong Game

This challenge is to build a 2-player cooperative Pong game. Game rules:

  1. The game asks for name inputs from every player. (for total of 2 players in this case).
  2. The game starts with a paddle in each side. The ball bounces everytime it collides with top, bottom wall and 2 paddles. First player uses (Up key or Down key) and second player uses (w key or s key) from the same keyboard to control the paddle movement.
  3. Player earns a score everytime the ball goes pass the paddle of the opponent.
  4. The speed of the ball accelerates when the ball restarts throwing from the center.
  5. The game ends when player's score reaches 5 and the game result displays on the screen

Demo video

Pong Game Demo Video

Turtle Crossing Game

This challenge is to build a turtle crossing game. Game rules:

  1. The player, in the form of turtle, has to cross the area full of cars passing by and avoids getting hit by the car.
  2. The player returns to the origin and their game level increments by 1 after reaching the vertical top of the screen. The more level player experiences, the harder the game (i.e more car's speed and frequency) will be
  3. Game is over when the car collision is detected

Demo video

Turtle Crossing Game Demo Video

U.S State Guessing Game

This challenge is to build a U.S State game. The program is built by implementing Turtle and Pandas library.

  1. The player tries to type into the prompt window as many American States as possible.
  2. The program will check if the input state exists from the csv file. If data exists, the score increases and the state name will be written to the map with its data coordinates found from the file.
  3. Game ends when player gets all correct states or when they types "exit". The remained_states.csv will be created when program ends to show number of unguessed states left from the game.

Demo video

US State Guessing Game Demo Video