Skip to content

Instantly share code, notes, and snippets.

View moqdm's full-sized avatar
๐Ÿ›๏ธ

M Moghaddam moqdm

๐Ÿ›๏ธ
View GitHub Profile
@moqdm
moqdm / population.c
Last active August 21, 2021 15:10
it's my Lab 1: Population Growth solution... *Please just take a look if you couldn't solve it ... Thank you ๐Ÿ™‚ #cs50
#include <cs50.h>
#include <stdio.h>
int main(void)
{
// TODO: Prompt for start size
int s;
do
{
s = get_int("Start size: ");
@moqdm
moqdm / hello.c
Last active September 6, 2021 13:24
it's my PSet 1: Hello solution... *Please just take a look if you couldn't solve it ... Thank you ๐Ÿ™‚ #cs50
#include <stdio.h>
#include <cs50.h>
int main(void)
{
//to ask name for acquaintance.
string name = get_string("What's your name?\n");
printf("hello, %s.\n", name);
printf("I'm Moqi. Nice to meet you.\n");
@moqdm
moqdm / marioL.c
Last active September 6, 2021 13:25
it's my PSet 1: Mario (Less) solution... *Please just take a look if you couldn't solve it ... Thank you ๐Ÿ™‚ #cs50
#include <stdio.h>
#include <cs50.h>
int main(void)
{
//Notification
printf("Welcome, Please enter a number from one to eight to build.\n");
int h;
do
@moqdm
moqdm / marioM.c
Last active September 6, 2021 13:25
it's my PSet 1: Mario (More) solution... *Please just take a look if you couldn't solve it ... Thank you ๐Ÿ™‚ #cs50
#include <stdio.h>
#include <cs50.h>
//References...
void p_s(int x);
void p_hash(int x);
int main(void)
{
//Notification.
@moqdm
moqdm / cash.c
Last active September 6, 2021 13:25
it's my PSet 1: Cash solution... *Please just take a look if you couldn't solve it ... Thank you ๐Ÿ™‚ #cs50
#include <cs50.h>
#include <stdio.h>
#include <math.h>
int main(void)
{
int c = 0;
//Get owe...
printf("Write down the amount you owe to calculate the number of coins like ($.ยข)...\n");
@moqdm
moqdm / scrabble.c
Last active August 21, 2021 15:10
it's my Lab 2: Scrabble solution... *Please just take a look if you couldn't solve it ... Thank you ๐Ÿ™‚ #cs50
#include <cs50.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
// Points assigned to each letter of the alphabet
int POINTS[] = {1, 3, 3, 2, 1, 4, 2, 4, 1, 8, 5, 1, 3, 1, 1, 3, 10, 1, 1, 1, 1, 4, 4, 8, 4, 10};
int compute_score(string word);
@moqdm
moqdm / readability.c
Last active September 6, 2021 13:26
it's my PSet 2: Readability solution... *Please just take a look if you couldn't solve it ... Thank you ๐Ÿ™‚ #cs50
#include <cs50.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <math.h>
int main(void)
{
//Get Text...
string text = get_string("Text: ");
@moqdm
moqdm / caesar.c
Last active September 6, 2021 13:27
it's my PSet 2: Caesar solution... *Please just take a look if you couldn't solve it ... Thank you ๐Ÿ™‚ #cs50
#include <cs50.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <math.h>
#include <stdlib.h>
//Variable.
int s = 0;
int main(int argc, string argv[])
{
@moqdm
moqdm / answers.txt
Last active August 21, 2021 15:10
it's my Lab 3: Sort solution... *Please just take a look if you couldn't solve it ... Thank you ๐Ÿ™‚ #cs50
sort1 uses: Bubble Sort
How do you know?: I checked the time for the least amount of data in the sorted state based on omega.
sort2 uses: Merge Sort
How do you know?: I checked the time for the least amount of data in the sorted state based on omega.
sort3 uses: Selection Sort
@moqdm
moqdm / plurality.c
Last active September 6, 2021 13:28
it's my PSet 3: Plurality solution... *Please just take a look if you couldn't solve it ... Thank you ๐Ÿ™‚ #cs50
#include <cs50.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <math.h>
#include <stdlib.h>
// Max number of candidates
#define MAX 9