Skip to content

Instantly share code, notes, and snippets.

View CodeNextAdmin's full-sized avatar

Code Next CodeNextAdmin

View GitHub Profile
/* --------------------------------------------
Day 1 Challenges:
-------------------------------------------- */
// Example
let message = "Hello World!";
console.log(message);
/* --------------------------------------------
/* --------------------------------------------
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);
/* --------------------------------------------
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.
/* --------------------------------------------
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.
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];
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();
//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 = []
@CodeNextAdmin
CodeNextAdmin / the_tyger.txt
Created September 14, 2020 22:38
The Tyger - William Blake
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?
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:
@CodeNextAdmin
CodeNextAdmin / distance-led.py
Created October 18, 2021 22:06 — forked from CodeNextPaco/distance-led.py
GPIO Zero distance LED blink
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: