Skip to content

Instantly share code, notes, and snippets.

View mikedao's full-sized avatar
🤷

Michael Dao mikedao

🤷
View GitHub Profile

The Utopian tree goes through 2 cycles of growth every year. The first growth cycle occurs during the spring, when it doubles in height. The second growth cycle occurs during the summer, when its height increases by 1 meter.

Now, a new Utopian tree sapling is planted at the onset of the spring. Its height is 1 meter. Can you find the height of the tree after N growth cycles?

Input Format

You are given an integer N. Find the digits in this number that exactly divide N and display their count. For N = 24, there are 2 digits - 2 & 4. Both these digits exactly divide 24. So our answer is 2.

Note

If the same number is repeated twice at different positions, it should be counted twice, e.g., For N=122, 2 divides 122 exactly and occurs at ones' and tens' position. So it should be counted twice. So for this case, our answer is 3. Division by is undefined.

Blackjack

We are going to implement our own very version of blackjack.

Blackjack is a card game played at casinos.

The object of the game is to collect a number of cards that get as close to 21 as possible, while not going over.

A summary of the rules can be read here.

Linked Lists

What is a Linked List?

A linked list is a data structure used for storing collections of data. A linked list has the following properties.

  • Successive elements are connected by pointers.
  • Last element points to nil
  • Can grow or shrink in size during execution of a program.
  • Can be made just as long as required (until system memory is exhausted)
  • Given the array ["pizza", "cheese", "steak"] Use .each to print out each word capitalized.

  • Given the array [1,2,3,4,5], use .each to create an array of each number doubled.

  • Given the array ["apple", "pie", "ice cream"], use .each to determine which string is the longest.

  • Given the array [1,2,3,4,5], use .each to give us an array consisting of only even numbers.

git clone https://github.com/turingschool-examples/oregon_sale.git

cd oregon_sale

rvm install 1.9.3

rvm use 1.9.3

brew update

Wizarding Bank Challenge

Gringott's Wizarding Bank

Gringott's has become too big to fail, so the Ministry of Magic has decided to break up this wizarding bank.

But they need, quite literally, a programming wizard to create the software to run these banks.

Specification

Create a Car Class conceptually
Class - Lay out the form for a category or type of an object.
Instance - A single realization or actualization of a class.
Google the characters in Hamlet, and you would get a list of Characters and Plays.
You get a list of significant characters, and not all characters.
@mikedao
mikedao / environment.js
Created May 5, 2015 02:09
environment.js
contentSecurityPolicy: {
'default-src': "'none'",
'script-src': "'self' 'unsafe-inline' 'unsafe-eval'",
'font-src': "'self'",
'connect-src': "'self'",
'img-src': "'self'",
'style-src': "'self' 'unsafe-inline'",
'frame-src': "'none'"
}