Skip to content

Instantly share code, notes, and snippets.

@Tomi-3-0
Tomi-3-0 / camelcase.c
Created August 27, 2023 21:52
Solution to Hackerrank's camel case 4 in C
// # Enter your code here. Read input from STDIN. Print output to STDOUT
// # Each line of the input file will begin with an operation (S or C) followed by a semi-colon followed by M, C, or V
// # The operation will either be S (split) or C (combine)
// # M indicates method, C indicates class, and V indicates variable
// # In the case of a split operation, the words will be a camel case
// # In the case of a combine operation, the words will be a space-delimited list of words starting with lowercase letters that you need to combine into the appropriate camel case String
@Tomi-3-0
Tomi-3-0 / minesweeper.py
Created February 11, 2023 09:40
A simple implementation of a command-line mine sweeper game in python from Kylie Ying (Github: https://www.github.com/kying18 )
import random
import re
# create a class called board to represent the minesweeper game
class Board:
def __init__(self, dim_size, num_bombs):
# keep track
self.dim_size = dim_size
self.num_bombs = num_bombs
# helper functions
@Tomi-3-0
Tomi-3-0 / mario.py
Last active January 31, 2023 22:18
Mario hash blocks using python (cs50 assignment)
def main():
height = get_height()
print_hashes(height)
def print_hashes(height):
# loop through the rows
for i in range(height):
# number of hashes per row
hashes = i + 1;
@Tomi-3-0
Tomi-3-0 / dictionary.c
Created January 26, 2023 05:19
My implementation of `dictionary.c` from CS50's speller week 5 problem
// Implements a dictionary's functionality
#include <ctype.h>
#include <stdbool.h>
#include <strings.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "dictionary.h"
@Tomi-3-0
Tomi-3-0 / substitution.c
Last active January 9, 2023 11:26 — forked from Latishfaction/substitution.c
CS50 (cs50x) pset2 Substitution Solution 2020
#include <stdio.h>
#include <cs50.h> // to get plain text
#include <string.h> // for strlen()
#include <ctype.h> // for string operation upper, lower
void Do_substitute(); // for further substitute
void alpha_arr_val(char pos, string key);
// to get the alphabet array value of each plain text element (ex:plaintext = h|alphabet array = 8 {a=0, b=1 .....z=26})
int main(int argc, string argv[])