This file contains 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
import unittest | |
class FizzBuzzTest(unittest.TestCase): | |
def setUp(self): | |
self.fizzbuzz = FizzBuzz() | |
def test_number_indivisible_by_3_or_5_should_return_number(self): | |
result = self.fizzbuzz.take(1) | |
self.assertEqual(result, 1) |
This file contains 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
import unittest | |
##################################################################### | |
# UNIT TEST | |
##################################################################### | |
class FizzBuzzTest(unittest.TestCase): | |
def test_number_3_should_return_number_fizz(self): | |
fizzbuzz_factory = FizzBuzzFactory() | |
fizzbuzz = fizzbuzz_factory.create() |
This file contains 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
######### Kata: Roman Number 1-30 ######### | |
import unittest | |
class RomanNumberTest(unittest.TestCase): | |
def setUp(self): | |
self.roman_number = RomanNumber() | |
def test_number_1_should_return_I(self): |
This file contains 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
{ | |
"editor.formatOnSave": false, | |
"[javascript]": { | |
"editor.defaultFormatter": "esbenp.prettier-vscode", | |
"editor.formatOnSave": true | |
}, | |
"[json]": { | |
"editor.defaultFormatter": "esbenp.prettier-vscode" | |
}, | |
"prettier.singleQuote": true, |
This file contains 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
import turtle | |
turtle.pensize(3) | |
def draw_heart_curve(): | |
for i in range(200): | |
turtle.right(1) | |
turtle.forward(1) | |
turtle.color("pink", "pink") |
This file contains 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
{ | |
"trailingComma": "es5", | |
"tabWidth": 2, | |
"semi": false, | |
"singleQuote": true, | |
"arrowParens": "avoid" | |
} |
This file contains 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 and let | |
const name = 'gatuk' | |
console.log('const name >', name) | |
let mutableName = '' | |
mutableName = 'gatuk' | |
console.log('let mutable name > ', mutableName) | |
if (mutableName === 'gatuk') { | |
const name = 'someone' |
This file contains 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
def interact(action): | |
command = action.split()[0] | |
if command == "walking": | |
direction = action.split()[1] | |
goTo(direction) | |
elif command == "pickup": | |
item = action.split()[1] | |
save(item) |
This file contains 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
def quitGame(): | |
print("🔴 Quit the game and go back to main page.") | |
def goTo(direction): | |
print(f"👣 Walking {direction}...") | |
def save(item): | |
print(f"💾 You got {item} 1 ea") |
This file contains 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
def interact(action): | |
match action.split(): | |
case ["walking", direction]: | |
goTo(direction) | |
case ["pickup", item]: | |
save(item) | |
case ["quit"]: | |
quitGame() | |
case _: | |
print("😵 Don't know this command") |
OlderNewer