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
package main | |
import ( | |
"bufio" | |
"fmt" | |
"net" | |
"os" | |
"strings" | |
) |
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
public class Main { | |
public static void main(String[] args) { | |
Bruch b = null; | |
Bruch b2 = null; | |
try { | |
b = new Bruch(18,36); | |
b2 = new Bruch(13, 24); | |
} |
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
using System; | |
namespace Fisher_Yates_shuffle | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
// Generate a set of numbers from user input... | |
Console.Write("Enter count of numbers to shuffle: "); |
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 student_register import StudentRegister | |
from student import Student | |
def main(): | |
register = StudentRegister("Bachelor CS 2019") | |
napoleon = Student('Napoleon', 1, 20) | |
snowball = Student('Snowball', 2, 22) | |
squealer = Student('Squealer', 3, 19) |
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 sys | |
class ProgressPrinter: | |
def __init__(self, units, unit_type='', max_length=50, pre='', post='', fill='=', head='>', empty=' '): | |
if units > max_length: | |
self.steps = max_length / units | |
self.max_length = max_length | |
else: | |
self.steps = 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 hashlib | |
def hash_word(string, hash_method): | |
if hash_method == "md5": | |
return hashlib.md5(string.encode()).hexdigest() | |
if hash_method == "sha3_256": | |
return hashlib.sha3_256(string.encode()).hexdigest() | |
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
class Hangman: | |
def __init__(self): | |
self.stages = [] | |
self.stages.append(""" | |
___________.._______ | |
| .__________))______| | |
| | / / || | |
| |/ / || |
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
extern crate rand; | |
use std::io; | |
use rand::Rng; | |
use std::cmp::Ordering; | |
fn main() { | |
println!("Guess the number!"); | |
let secret_number = rand::thread_rng().gen_range(1, 101); |