Skip to main content Link Search Menu Expand Document (external link)

Homework 0: Rock, Paper, Scissors, Kotlin!

Introduction & Game Overview

In this homework, you will familiarize yourself with Kotlin & Android Studio basics through implementing the classic game Rock, Paper, Scissors!

The game you are making is a Rock, Paper, Scissors! 2-player game. Each player selects one option of the three and submits it. Then, the other player gets their turn and submits. The game either ends with one player winning or a draw.

Getting Started

Before anything, make sure to check our Kotlin Style Guide, as there will be points in each homework for style (5%). Style is very important and we want to make sure everyone is writing concise and consistent code.

Now that you got this out of the way, don’t worry, you’re not starting your code from scratch. Instead, you will be given a starter code (check setup section) in which you will go through a bunch of steps marked by the keyword TODO, in which you will be either completing missing code or writing functions.

It is very very highly recommended to go through them in the numerical order provided. This will make your coding journey more coherent and enjoyable. You will notice that TODO 12 is placed in the middle of previous TODO items, just skip it and get back to it after finishing TODO 11

One other reason why you should complete them in order is so that you can benefit from the checkpoint steps in between the TODOS, which will guide you on what to expect the app to look like as you go, and encourage you to run it and test the so-far implemented features.

Setup

  1. Download the starter .zip folder from canvas,
  2. Unzip (expand) the file (double click if using MacOS, extract if using Windows/Linux)
  3. Open Android Stuido
  4. Under Files->Open Project, select the unzipped project folder

Instructions

All the instructions you need are in MainActivity.kt, and it is the only file in which you will be writing code, although you will need to take a look at activity_main.xml. Go over MainActivity.kt and familiarize yourself with the variables, functions, and enum classes. The TODO items will then give you everything you need!

If you need any help with getting started or throughout your coding journey, please post on Ed and come to office hours. It has shown to make students get things done easier and faster!

Extra Credit

In TODO: (10), you are asked to write a toast message to be displayed when the user attempts to confirm their move without actually making a move.

Your extra credit task is to be as quirky, funny, and/or creative as you can. During the lecture following the HW due date, there will be anonymous voting on the toast messages among students. The owner whose toast message wins the vote gets a 2% extra credit.

Submission

Export the project into a .zip file and submit to gradescope by DEADLINE: Friday 3rd of February, 11:59 pm

Grading Breakdown

Compiling & Running (20pts)

  • Style (5pts)
    • 5 → all good
    • 2.5 → minor mistakes (up to 3 style errors)
    • 0 → >3 style errors
  • App compiles correctly (5pts)
  • App runs smoothly without visual/logical bugs (10pts)

TODO Items (80pts)

  • (1) - (3pts)
  • (2) - (3pts)
  • (3) - (4pts)
  • (4) - (16pts)
  • (5) - (6pts)
  • (6) - (2pts)
  • (7) - (5pts)
  • (8) - (8pts)
  • (9) - (4pts)
  • (10) - (2pts + Extra Credit: 2pts)
  • (11) - (25pts)
  • (12) - (2pts)