Skip to content

Instantly share code, notes, and snippets.

@vingkan
Last active July 24, 2017 23:26
Show Gist options
  • Save vingkan/da8f227599a0ca623279acb7a0fa340b to your computer and use it in GitHub Desktop.
Save vingkan/da8f227599a0ca623279acb7a0fa340b to your computer and use it in GitHub Desktop.
ESI CS Episode 08

ESI CS Episode 08: Attack of the Drones

Setting Up

Documentation

View the Updated Documentation on GitHub

Quiz

Surprise, it's a quiz! Don't worry, it's nothing to stress about.

This two question quiz is based on real struggles you and your classmates have been having lately in class. Your responses are a chance to show how well you understand and explain the situations.

After everyone finishes, we'll reflect on the responses.

Take the Quiz

Bash Instructions to Update Battleship/Battlehub

The command rm removes/deletes a directory. The commands below do not delete your ships, which are stored in the esi17 folder.

~/workspace $ rm -rf battleship
~/workspace $ rm -rf battlehub
~/workspace $ git clone https://github.com/illinoistechesi/battleship.git
~/workspace $ git clone https://github.com/illinoistechesi/battlehub.git

Drone Battle

Instructions to Run the Drone Battle

  • Open battlehub/DroneMain.java
  • Change battleship.ships.DummyShip.class to esi17.yourusername.YourShip.class where necessary
  • Run the following commands in your bash terminal:
~/workspace $ javac battlehub/DroneMain.java
~/workspace $ java battlehub.DroneMain
  • Read the output in the terminal and in the simulation files
  • To repeat the same random seeding as a previous battle, add the seed number after the program like this:
~/workspace $ java battlehub.DroneMain 45

Initial Map Layout

     00  01  02  03  04  05  06  07  08  09  10  11  12  13  14 
 00 [A1] ~~  ~~  ~~  ~~  ~~  ~~ [D2] ~~  ~~  ~~  ~~  ~~  ~~ [B1]
 01 [A2] ~~  ~~  ~~  ~~  ~~ [D2][D2][D2] ~~  ~~  ~~  ~~  ~~ [B2]
 02  ~~  ~~  ~~  ~~  ~~ [D2][D2][D2][D2][D2] ~~  ~~  ~~  ~~  ~~ 
 03 [A3] ~~  ~~  ~~  ~~  ~~ [D2][D2][D2] ~~  ~~  ~~  ~~  ~~ [B3]
 04 [A4] ~~  ~~  ~~  ~~  ~~  ~~ [D2] ~~  ~~  ~~  ~~  ~~  ~~ [B4]

Drone Ship Stats

View DroneShip.java on GitHub

  • Hull: 2
  • Firepower: 2
  • Speed: 3
  • Range: 3

Deploying Your Ships

Test Your Code

Test your ship by adding it in the battlehub/DroneMain.java and running these commands:

~/workspace $ javac battlehub/DroneMain.java
~/workspace $ java battlehub.DroneMain

If it compiles and runs without errors, you can submit your pull request!

Commit Your Changes

Run these commands in your terminal: (do you remember what each one does?)

~/workspace $ cd esi17
~/workspace/esi17 $ git status
~/workspace/esi17 $ git add -A
~/workspace/esi17 $ git commit -m "{Your message describing your changes}"
~/workspace/esi17 $ git push

Then you will be able to enter your GitHub login credentials.

Submit Your Pull Request

Go to your profile on GitHub and click on your fork of the esi17 repository. Then click the new pull request button and finish the pull request there.

Feedback and Reflection

After the class discussion, while waiting for the ships to be merged, fill out this reflection and feedback form:

Reflect and Provide Feedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment