Skip to content

Instantly share code, notes, and snippets.

View Shah-devs's full-sized avatar
🎯
Focusing

shahdevz Shah-devs

🎯
Focusing
View GitHub Profile
@Shah-devs
Shah-devs / main.js
Created March 31, 2023 00:02
A simple project for beginners to learn working with setters and getters in JavaScript advanced objects.
const menu = {
//meal and price properties
_meal: "",
_price: 0,
//setting meal and check if input is a string
set meal(mealToCheck) {
this._meal = typeof mealToCheck === "string" ? mealToCheck : "invalid";
},
@Shah-devs
Shah-devs / Scrabble.c
Created August 31, 2022 12:17
CS50 edx 2022/ Lab2 / scrabble solution / / I'm a beginner too, just want to help other students only to light some bulbs, DO NOT COPY PASTE CODE for "academic honesty"
#include <ctype.h>
#include <cs50.h>
#include <stdio.h>
#include <string.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);
@Shah-devs
Shah-devs / credit
Created August 30, 2022 16:15
CS50 PSet 1 credit (more comfortable) solution 2022 / I'm a beginner too, just want to help other students only to light some bulbs, DO NOT COPY PASTE CODE for "academic honesty"
#include <cs50.h>
#include <stdio.h>
#include <math.h>
int main(void)
{
// promptig user for input
long card= get_long("CARD NUMBER: ");
int i = 0;
@Shah-devs
Shah-devs / readability
Created August 30, 2022 16:12
CS50 PSet2 Readability solution 2022 / using prototypes / I'm a beginner too, just want to help other students only to light some bulbs, DO NOT COPY PASTE CODE for "academic honesty"
#include <cs50.h>
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include <math.h>
//prototypes
int count_letters(string x);
int count_words(string x);
int count_sentences(string x);
@Shah-devs
Shah-devs / mario(more)
Last active August 30, 2022 16:13
CS50 PSet1 MArio(more) solution 2022 / I'm a beginner too, just want to help other students only to light some bulbs, DO NOT COPY PASTE CODE for "academic honesty"
#include <cs50.h>
#include <stdio.h>
int main(void)
{
int height; //assign a value to an int named Height
do // using do function to prompt user for an input at least one time
{
height = get_int("Height(1-8): ");
}
@Shah-devs
Shah-devs / caesar
Created August 30, 2022 16:05
CS50 PSet2 Caesar solution 2022 / using prototypes / I'm a beginner too, just want to help other students only to light some bulbs, DO NOT COPY PASTE CODE for "academic honesty"
#include <cs50.h>
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include <stdbool.h>
#include <stdlib.h>
// prototypes
bool only_digits(string x);
char rotate(char x, int i);
@Shah-devs
Shah-devs / substitution
Last active August 30, 2022 16:03
CS50 PSet2 substitution solution 2022 / using prototypes / I'm a beginner too, just want to help other students only to light some bulbs, DO NOT COPY PASTE CODE for "academic honesty"
#include <cs50.h>
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include <stdbool.h>
#include <stdlib.h>
// prototypes
bool only_alpha(string x);
char substitute(char x, string y);