Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<link href="https://fonts.googleapis.com/css2?family=Raleway" rel="stylesheet">
<link rel="stylesheet" href="../static/css/styles.css">
</head>
<body>
<div class="wrapper">
@TheMuellenator
TheMuellenator / randomisation.swift
Last active May 7, 2024 14:39
iOS repl.it - Randomisation Challenge Solution
let alphabet = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
//The number of letters in alphabet equals 26
var password = alphabet[Int.random(in: 0...25)] + alphabet[Int.random(in: 0...25)] + alphabet[Int.random(in: 0...25)] + alphabet[Int.random(in: 0...25)] + alphabet[Int.random(in: 0...25)] + alphabet[Int.random(in: 0...25)]
print(password)
@TheMuellenator
TheMuellenator / arrays.swift
Last active May 7, 2024 14:33
iOS repl.it - Arrays Challenge Solution
let numbers = [45, 73, 195, 53]
//Create a new array called computedNumbers
var computedNumbers = [
numbers[0] * numbers[1],
numbers[1] * numbers[2],
numbers[2] * numbers[3],
numbers[3] * numbers[0]
]
sp = spotipy.Spotify(
auth_manager=SpotifyOAuth(
scope="playlist-modify-private",
redirect_uri="http://example.com",
client_id=YOUR UNIQUE CLIENT ID,
client_secret= YOUR UNIQUE CLIENT SECRET,
show_dialog=True,
cache_path="token.txt"
)
)
@TheMuellenator
TheMuellenator / constants.swift
Last active April 23, 2024 16:37
iOS repl.it - Constants Challenge Solution
//Write your code here.
// Solution
let secondsInAnHour = 3600
// alternatively:
// let secondsInAnHour: Int = 3600
// Note, constants can only be set once and cannot be assigned a new value.
// The below does not work, because it is a constant and thus cannot be changed.
@TheMuellenator
TheMuellenator / functions3.swift
Last active April 16, 2024 04:49
iOS repl.it - Functions 3 Challenge Solution
func isOdd(n: Int) -> Bool {
if n % 2 != 0 {
return true
} else {
return false
}
// Alternatively:
// return n % 2 != 0
}
class FlightData:
def __init__(self, price, origin_city, origin_airport, destination_city, destination_airport, out_date, return_date):
self.price = price
self.origin_city = origin_city
self.origin_airport = origin_airport
self.destination_city = destination_city
self.destination_airport = destination_airport
self.out_date = out_date
self.return_date = return_date
@TheMuellenator
TheMuellenator / functions2.swift
Last active April 11, 2024 02:31
iOS repl.it - Functions 2 Challenge Solution
//Don't change this code:
func calculator() {
let a = Int(readLine()!)! //First input
let b = Int(readLine()!)! //Second input
add(n1: a, n2: b)
subtract(n1: a, n2: b)
multiply(n1: a, n2: b)
divide(n1: a, n2: b)
@TheMuellenator
TheMuellenator / functions1.swift
Last active March 27, 2024 17:34
iOS repl.it - Functions 1 Challenge Solution
print("Starting map")
start()
//4 steps right and 5 steps down.
right()
right()
right()
right()
@TheMuellenator
TheMuellenator / switch.swift
Last active March 26, 2024 21:17
iOS repl.it - Switch Challenge Solution
////Don't change this
var aNumber = Int(readLine()!)!
func dayOfTheWeek(day: Int) {
//Write your code inside this function.
switch day {
case 1:
print("Monday")
case 2: