Sprint 2 Final Presentation

Executive Summary

Contribution/Work πŸ“

  • I gave myself a 0.88, because while I contributed I felt like I could have put more effort into it.
  • I created the quizziz for students to test my knowledge on, I created many of the descriptions/definitions for the abstractions, and I also created some of the popcorn hacks. Overall, I contributed well, but I could still improve.

Takeaways ⭐️

  • This unit was truly valuable. I came into this course with prior knowledge of Python, but the Sprint 2 teaching allowed me to learn more complex things for Python, while teaching me the basics of Javascript.
  • This unit covered many of the essential functions and operations within the coding languages, which will help me through my coding journey.
  • Aside from coding, this lesson also thought me how to collaborate with colleagues in the real world. Considering that I want to work in the field of CompSci, I now know how to communicate with, and cross-integrate my work with other people coding at the same time.

Homeworks πŸ“„

  • All homeworks can be found on the home page, in the grid.
  • I completed ll of the popcorn hacks and homework hacks, and for each on I tried to make it unique to showcase that I understand how it works, and what I’m doing.
  • The homework was a great way for me to practice my skills while learning the material, allowing for me to better my coding skills exponentially.

Grading πŸ“š

  • Our grading spreadsheet can be found here
  • We ended up splitting the entire spreadsheet into 4 parts to ensure everyone had an equal contribution to the grading.
  • For each person, we would would leave detailed feedback on notes on where they went wrong. This ensured that they knew where to improve on. For example, we would leave comments telling them that they didn’t create their own code, and simply copied and pasted it from the lesson. Overall, the grading also gave us valuably insight into how well we communicated the lessons to our peers.

Teaching Process 🏫

The teaching process (for us it was data abstractions) was really helpful for us to research and learn a new topic, and then understand it proficiently enough to teach it to other people. Our group decided to go the extra mile, and ensure the answers were hidden, so people would be more motivated to learn the code rather than copy/paste it. Additionally, our group created a Quizziz so people could test their knowledge. Our lesson can be found here

Conclusion πŸ’‘

Overall, this project was really beneficial for my coding skills. It will continue to serve me a purpose in the future, because it also taught me the skill of collaboration in a technology oriented β€œwork” environment.To demonstrate everything I have learned so far, I created the following Connect 4 game to showcase mathematical operations, iterations, strings, integers, and more.

Connect 4 Sprint 2 Final Project πŸ’»

ROWS = 6
COLUMNS = 7

def create_board():
    return [[" " for _ in range(COLUMNS)] for _ in range(ROWS)]

def print_board(board):
    for row in board:
        print("|" + "|".join(row) + "|")
    print(" " + " ".join(str(i) for i in range(COLUMNS)))

def check_winner(board, player):
    for c in range(COLUMNS - 3):
        for r in range(ROWS):
            if board[r][c] == player and board[r][c + 1] == player and board[r][c + 2] == player and board[r][c + 3] == player:
                return True
    for c in range(COLUMNS):
        for r in range(ROWS - 3):
            if board[r][c] == player and board[r + 1][c] == player and board[r + 2][c] == player and board[r + 3][c] == player:
                return True
    for c in range(COLUMNS - 3):
        for r in range(ROWS - 3):
            if board[r][c] == player and board[r + 1][c + 1] == player and board[r + 2][c + 2] == player and board[r + 3][c + 3] == player:
                return True
    for c in range(COLUMNS - 3):
        for r in range(3, ROWS):
            if board[r][c] == player and board[r - 1][c + 1] == player and board[r - 2][c + 2] == player and board[r - 3][c + 3] == player:
                return True
    return False

def is_column_full(board, col):
    return board[0][col] != " "

def get_next_available_row(board, col):
    for r in range(ROWS - 1, -1, -1):
        if board[r][col] == " ":
            return r

def main():
    board = create_board()
    game_over = False
    current_player = "X"

    while not game_over:
        print_board(board)
        col = int(input(f"Player {current_player}, choose a column (0-{COLUMNS - 1}): "))

        if col < 0 or col >= COLUMNS or is_column_full(board, col):
            print("Invalid move. Try again.")
            continue

        row = get_next_available_row(board, col)
        board[row][col] = current_player

        if check_winner(board, current_player):
            print_board(board)
            print(f"Player {current_player} wins!")
            game_over = True

        current_player = "O" if current_player == "X" else "X"

if __name__ == "__main__":
    main()

| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
 0 1 2 3 4 5 6
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| |X| | | | | |
 0 1 2 3 4 5 6
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| |X|O| | | | |
 0 1 2 3 4 5 6
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| |X| | | | | |
| |X|O| | | | |
 0 1 2 3 4 5 6



---------------------------------------------------------------------------

ValueError                                Traceback (most recent call last)

Cell In[3], line 63
     60         current_player = "O" if current_player == "X" else "X"
     62 if __name__ == "__main__":
---> 63     main()


Cell In[3], line 46, in main()
     44 while not game_over:
     45     print_board(board)
---> 46     col = int(input(f"Player {current_player}, choose a column (0-{COLUMNS - 1}): "))
     48     if col < 0 or col >= COLUMNS or is_column_full(board, col):
     49         print("Invalid move. Try again.")


ValueError: invalid literal for int() with base 10: ''