Skip to content

Instantly share code, notes, and snippets.

View logankilpatrick's full-sized avatar
🤹
Juggling many things - please be patient

Logan Kilpatrick logankilpatrick

🤹
Juggling many things - please be patient
View GitHub Profile
# Number Guessing Game in Julia
# Source: https://github.com/logankilpatrick/10-Julia-Projects-for-Beginners
function play_number_guess_human()
total_numbers = 25 #
# Generate a random number within a certain range
target_number = rand(1:total_numbers)
guess = 0
# Computer Number Guessing Game in Julia
# Source: https://github.com/logankilpatrick/10-Julia-Projects-for-Beginners
using Random
function play_number_guess_computer()
print("Please enter a number between 1 and 50 for the computer to try and guess: ")
# Take in the user input and convert it to a number
# Rock 🗿, Paper 📃, Scissors ✂️ Game in Julia
function play_rock_paper_scissors()
moves = ["🗿", "📃", "✂️"]
computer_move = moves[rand(1:3)]
# Base.prompt is similar to readline which we used before
human_move = Base.prompt("Please enter 🗿, 📃, or ✂️")
# Appends a ": " to the end of the line by default
# Generate Passwords in Julia
# Source: https://github.com/logankilpatrick/10-Julia-Projects-for-Beginners
using ProgressBars
using Random
# WARNING: Do not use this code to generate actual passwords!
function generate_passwords()
num_passwords = parse(Int64, Base.prompt("How many passwords do you want to generate?"))
password_length = parse(Int64, Base.prompt("How long should each password be?"))