Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save pJanks/ead6a568e34b1a3c6a4adfd530cf098b to your computer and use it in GitHub Desktop.
Save pJanks/ead6a568e34b1a3c6a4adfd530cf098b to your computer and use it in GitHub Desktop.
Mod 0 Session 1 Practice Tasks

Session 1 Practice Tasks

The assignments listed here should take you approximately 40 minutes.

To start this assignment, click the button in the upper right-hand corner that says Fork. This is now your copy of the document. Click the Edit button when you're ready to start adding your answers. To save your work, click the green button in the bottom right-hand corner. You can always come back and re-edit your gist.

1. Documentation and Googling (20 min)

Documentation of a langauge, framework, or tool is the information that describes its functionality. For this part of the practice tasks, you're going to practice digging into documentation and other reference material.

NOTE: The linked documentation for each question below is a good starting place, but you should also be practicing your Googling skills and sifting through the results to find relevant and helpful sites.

  • In your own words, what does the Ruby string split method do? As you're explaining, be sure to provide an example. Your answer: Split allows you to seperate different pieces of a string into an array. It can be manipulated on delimiters, such as a space or comma. You can also specify how many pieces you want in the array and the last string in the array will contain all of the left over data once the limit is reached. If you had "1,2,3,4,5" and split (",",3) you would get ["1", "2", "3,4,5"]

  • What did you Google to help you with this task, and how did you pick your results? Ruby split string example.

  • In your own words, what does the JavaScript array slice method do? As you're explaining, be sure to provide an example. Your answer: This is used to create a portion of an existing array without changing the original. If you had an array of [1,2,3,4,5] and set a splice for (2,4) it would produce [3,4].

  • What did you Google to help you with this task, and how did you pick your results? Javascript array slice method

2. Data Types (20 min)

Imagine that you're taking your favorite board game and turning it into a computer-based game.

  • Name of board game: Monopoly

  • Use the space below to categorize game data into each of the following data types. You should have a minimum of two pieces of data for each category. Try practicing variable assignment in this exercise.

  1. String data: var gamePiece = "cannon"; var gamePiece = "boot";
  2. Integer and/or float data: var diceRoll = 6; var diceRoll = 11;
  3. Boolean data: var goToJail = true; var skipOneTurn = false;
  4. Array data: var properties = ["baltic avenue", "mediterranean avenue", "boardwalk"]; var currency = ["500", "100", "50"];
  5. Hash or Object data: var properties = { "michael": 6, "james": 8 }; var money = { "michael": 550, "james": 1400 };

3. Questions/Comments/Confusions

If you have any questions, comments, or confusions from the any of the readings that you would like an instructor to address, list them below:

  1. I am pretty confused by all of this terminology. I hope I did these excercises correctly.
@pJanks
Copy link
Author

pJanks commented Sep 10, 2019 via email

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