Skip to content

Instantly share code, notes, and snippets.


Roger Kondrat misterhtmlcss

View GitHub Profile
misterhtmlcss / number_game.js
Last active Oct 15, 2015
1st JS Game - Number guessing
View number_game.js
var target, guess_input, guess_input_text;
var finished = false;
var guesses = 0;
function guessing_game() {
var random_number = Math.random() * 100;
var random_number_integer = Math.floor(random_number);
target = random_number_integer + 1;
while (!finished) {
guess_input_text = prompt("Guess what number I'm thinking of? ");
View list-to-thinkful-gists.txt
// I was thinking about making this a nice HTML page... another day perhaps
Working with Strings:
Working with Numbers:
# Part 2
Write your own function that illustrates a feature that you learned in this unit. The function must take at least one argument. The function should be your own creation, not copied from any other source. Do not copy a function from your textbook or the Internet.
Include all of the following in your Learning Journal:
The code for the function that you invented.
The inputs and outputs to three calls of your invented function.
A description of what feature(s) your function illustrates.
misterhtmlcss /
Created Jul 7, 2020
Discussion from Unit 3 - UoPeople
# x = -10
# x = 0
# x = 2
if x != 0:
print("This number ", x, " is not 0.")
print(x, " is 0")
# I think the not operator is interesting.
# **************************
# CS1101 - Discussion Unit 5
# **************************
# **************************
# Instructions
# 1. Check whether its argument has any lowercase letters
# 2. Describe what it actually does when called with a string argument and if it does not correctly check for lowercase letters.
# 4. Give an example argument that produces incorrect results. (SEE BOTTOM for 3 calls to all functions!)
# 5. Describe why the result is incorrect. (SEE inline comments)
# Describe how catching exceptions can help with file errors. Write three Python examples that actually generate file errors on your computer and catch the errors with try: except: blocks. Include the code and output for each example in your post.
# There are two ways to catch an error; handle it gracefully, which is done in the last except statement, but in the first one with ZeroDivisionError we apply the initial part of second implementation that is more dynamic and some would say 'useful' to the user and development team. When an exception is specifically targeted this allows for a software developer to more easily develop an 'antidote' to the issue. In this case division by 0. Possibly this could lead to a solution that upon exception returns 0.
# Describe how catching exceptions can help with file errors.
# Catching errors can mean two things; the graceful handling of your program failing. Rather than a crash! Can anyway anyway 2k bug? This means your code is more durable to errors.
def test_excepti
misterhtmlcss / link-highjacker.js
Created Sep 8, 2020
How to solve a problem when you develop code.
View link-highjacker.js
View index.html
<!DOCTYPE html>
<html lang="en">
The following 2 meta tags *must* come first in the <head>
to consistently ensure proper document rendering.
Any other head element should come *after* these tags.
<meta charset="UTF-8">
misterhtmlcss /
Last active Sep 11, 2020
Lecture on Selectors and Transitions

Lecture on Selectors and Transitions

  • Selectors
  • Transitions