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
/* -------------------------------------------- | |
Day 1 Challenges: | |
-------------------------------------------- */ | |
// Example | |
let message = "Hello World!"; | |
console.log(message); | |
/* -------------------------------------------- |
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
/* -------------------------------------------- | |
Day 2 Challenges | |
-------------------------------------------- */ | |
let message = `Welcome to Day 2 | |
Today we are learning about conditionals. | |
Let's practice writing some conditionals of our own!`; | |
console.log(message); |
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
/* -------------------------------------------- | |
You've just learned about functions. | |
Functions are reusable pieces of code that make your code more modular. | |
If you are writing the same bit of code over and over, you are doing more work that you have to. | |
Use functions to simplify your code and decrease the amount of work you're doing. | |
Any time you start thinking 'this is tedious', you can probably write a function for that task. |
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
/* -------------------------------------------- | |
You've just learned about functions. | |
Functions are reusable pieces of code that make your code more modular. | |
If you are writing the same bit of code over and over, you are doing more work that you have to. | |
Use functions to simplify your code and decrease the amount of work you're doing. | |
Any time you start thinking 'this is tedious', you can probably write a function for that task. |
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 READLINE = require("readline-sync"); | |
const options = ["rock", "paper", "scissors"]; | |
console.log(`Let's play Rock Paper Scissors!`); | |
while(true){ | |
let userInput = READLINE.question(`Do you want to play rock, paper, or scissors? `).toLowerCase(); | |
let randomSelection = Math.floor(Math.random()*3); | |
let computerSelection = options[randomSelection]; |
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 READLINE = require("readline-sync"); | |
const options = ["rock", "paper", "scissors"]; | |
console.log(`Let's play Rock Paper Scissors!`); | |
// Challenge | |
// Find the bugs below: | |
while(true){ | |
let userInput = READLINE.question(`Do you want to play rock, paper, or scissors? `).toLowerCase(); |
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
//make sure to add this to your package in the shell: $npm install readline-sync | |
const READLINE = require("readline-sync"); | |
//*********************** VARIABLES **************************** | |
let inputMsg ="" //an empty string to hold our user inputs | |
let gameIsOn = true | |
let currentRoom = null | |
let isFighting = false | |
let rooms = [] |
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
The Tyger | |
William Blake | |
Tyger! Tyger! burning bright | |
In the forests of the night, | |
What immortal hand or eye | |
Could frame thy fearful symmetry? | |
In what distant deeps or skies | |
Burnt the fire of thine eyes? |
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
from gpiozero import Servo, AngularServo | |
from time import sleep | |
#servo = Servo(21) | |
servo = AngularServo(21, min_angle=0, max_angle=180, min_pulse_width=0.0006, max_pulse_width=0.0024) | |
while True: | |
""" | |
num = input("Enter a number between -1 and 1") | |
num = float(num) | |
if num <= 1 and num >= -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
from gpiozero import LED, DistanceSensor | |
from time import sleep | |
# DisanceSensor(echo, trigger) | |
sensor = DistanceSensor(26, 20) | |
led = LED(14) | |
blink_rate = 0 | |
def blink(d): | |
if d < 1.0: |
OlderNewer