This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Gavin Stark Psuedo Code | |
# 1. We remember that a is 1 | |
# 2. We remember that b is 100 | |
# 3. We remember that z is 0 | |
# 4. We tell the user we are going to | |
# guess a number between "a" and "b" | |
# 5. User chooses number | |
# 6. We remember our guess is (a+b) / 2 | |
# 7. Tell the user that we are guessing the number "guess" | |
# 8. User chooses yes, no |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Select all columns for all employees | |
company_database> SELECT * FROM employees | |
+------+--------------+----------+------------+-------------------+------------- | |
| id | full_name | salary | position | phone_extension | part_time | |
|------+--------------+----------+------------+-------------------+------------- | |
| 1 | Jamie Smalls | 38293 | <null> | x334 | False | |
| 2 | Jake William | 3992 | Driver | x429 | True | |
| 3 | Casem Casey | 49292 | Accountant | x596 | False | |
+------+--------------+----------+------------+-------------------+------------- | |
SELECT 3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const maps = (arrayOfInts) => { | |
return arrayOfInts.map( multiplied => multiplied * 2 ) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const check = (array,xValue) => { | |
return array.includes(xValue) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function gooseFilter (birds) { | |
var geese = ["African", "Roman Tufted", "Toulouse", "Pilgrim", "Steinbacher"]; | |
//birds array argument is filtered to check if the birds array includes a string that is in geese | |
//...if it isn't geese, return the string. | |
let filteredBirds = birds.filter(newBirds => { | |
return !geese.includes(newBirds) | |
}) | |
console.log( filteredBirds) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Kata; | |
Kata = (function() { | |
function Kata() {} | |
Kata.getVolumeOfCuboid = function(length, width, height){return length * width * height}; | |
return Kata; | |
})(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Interpolated strings must be enclosed in double quotes. The Ruby interpreter will not search for interpolated values in a string if single quotes are used: | |
ex. p 'hello #{3}' | |
Notice the decimal used in the assignment of the rate variable. Decimals in programming are called Floats. | |
Notice the usage of the _ in the assignment of the principal variable. Ruby allows an _ to be used in numbers for better readability. Although an _ can be placed anywhere in a number, the best practice is to place them where a comma would normally be placed. (e.g. 1_000_000). | |
IF EXAMPLE STATEMENT | |
def can_buy_apple_with?(money) | |
if money > 5 |