Skip to content

Instantly share code, notes, and snippets.

View toshvelaga's full-sized avatar
🔥
Working on Typeblock.co

Tosh Velaga toshvelaga

🔥
Working on Typeblock.co
View GitHub Profile
@toshvelaga
toshvelaga / Mario.c
Created July 25, 2018 22:52
CS50 Mario
/* CS50 Mario. This will work on any online compiler. You may need to make a few changes to get credit from Harvard.
Feel free to hmu if you have any questions at s.velaga@uky.edu */
#include <stdio.h>
int main()
{
int a, b, c;
for (a=1;a<=8;a++)
@toshvelaga
toshvelaga / mario_more.c
Created July 25, 2018 22:56
CS50 Mario More
/* CS50 solution. Feel free to check with any online compiler. To get credit from Harvard you may have to make a few changes.
hmu at s.velaga@uky.edu if you have any questions. */
#include <stdio.h>
int main( )
{
int h;
@toshvelaga
toshvelaga / greedy.c
Created July 25, 2018 22:58
CS50 Greedy
/* CS50 solution. Feel free to check with any online compiler. To get credit from Harvard you may have to make a few changes.
hmu at s.velaga@uky.edu if you have any questions. */
#include <stdio.h>
int main()
{
int c;
int numQ=0, numD=0, numN=0, numP=0, numcoins=0;
@toshvelaga
toshvelaga / credit.c
Created July 25, 2018 23:17
CS50 Credit
/* CS50 solution. Feel free to check with any online compiler. To get credit from Harvard you may have to make a few changes.
hmu at s.velaga@uky.edu if you have any questions. Also I haven't learned about proper code style and formatting -
if you wanna hmu to tell me this looks like shit and how to make it look better pls do */
#include <stdio.h>
#include <inttypes.h>
int main ()
{
@toshvelaga
toshvelaga / ceaser.c
Created July 25, 2018 23:39
CS50 Ceaser
/* CS50 solution. Feel free to check with any online compiler. To get credit from Harvard you may have to make a few changes.
hmu at s.velaga@uky.edu if you have any questions. Also I haven't learned about proper code style and formatting -
if you wanna hmu to tell me this looks like shit and how to make it look better pls do */
#include <stdio.h> //includes fget and stdin //
#include <ctype.h>
#include <stdlib.h>
#include <string.h> //used for strlen //
int main()
@toshvelaga
toshvelaga / vigenere.c
Created July 25, 2018 23:41
CS50 Vigenere
/* CS50 solution. Feel free to check with any online compiler. To get credit from Harvard you may have to make a few changes.
hmu at s.velaga@uky.edu if you have any questions. Also I haven't learned about proper code style and formatting -
if you wanna hmu to tell me this looks like shit and how to make it look better pls do */
#include <stdio.h> //includes fget and stdin //
#include <ctype.h> // used for isupper, islower, toupper, tolower
#include <stdlib.h>
#include <string.h> //used for strlen
int main()
@toshvelaga
toshvelaga / resizemore.c
Created July 25, 2018 23:44
CS50 resize more
/* This is for Harvard's CS50. Try the code out - it should get the job done. If you have any questiond or wanna tell me
that my style looks like shit feel free to hmu at s.velaga@uky.edu */
#include <stdio.h>
#include <stdlib.h>
#include "bmp.h"
int main(int argc, char* argv[])
{
@toshvelaga
toshvelaga / mario.py
Created July 27, 2018 04:52
CS50 mario in python
from cs50 import cs50
y=cs50.get_int("Enter a number between 0 and 23: ")
while y > 23 or y < 0:
y=cs50.get_int("Bruhh, try again! Gotta be between 0 and 23: ")
if y <= 23 and y >= 0:
for x in range (0,y):
print(" " *(y-x), end="")
@toshvelaga
toshvelaga / greedy.py
Created July 29, 2018 20:41
CS50 Greedy in python
from cs50 import cs50
while True:
change = cs50.get_float("How much change do you need: ")
if change < 100 and change > 0:
break
numQ, numD, numN, numP = [0,0,0,0]
while change >= 25:
@toshvelaga
toshvelaga / ceaser.py
Created July 30, 2018 02:11
CS50 Ceaser python
from cs50 import cs50
alphabet = "abcdefghijklmnopqrstuvwxyz"
alphabetcap = alphabet.upper()
cyphertext = ""
word = input("Please enter in a word to be encrypted: ")
key = int(input("Please enter a numnber to use as the encryption key: "))