Skip to content

Instantly share code, notes, and snippets.

View wise-introvert's full-sized avatar

Fardeen Panjwani wise-introvert

View GitHub Profile
/**
* @desc Day 5: Supply Stacks
* Expedition can depart once final supplies have been unloaded from ships
* Supplies are stored in stacks of marked crates and need to be rearranged
* Ship has cargo crane to move crates between stacks in planned steps
* Elves have a drawing of the starting stacks and rearrangement procedure
* Elves want to know which crate will be on top of each stack after rearrangement
* In example, top crates are C in stack 1, M in stack 2, and Z in stack 3
* Elves need to know which crate ends up on top of each stack
*
@wise-introvert
wise-introvert / worldcities.json
Last active January 23, 2023 20:39
A large json dataset to help stress test functions
This file has been truncated, but you can view the full file.
[
{
"admin_name" : "Tōkyō",
"capital" : "primary",
"city" : "Tokyo",
"city_ascii" : "Tokyo",
"country" : "Japan",
"id" : "1392685764",
"iso2" : "JP",
"iso3" : "JPN",
@wise-introvert
wise-introvert / README.md
Created December 30, 2021 00:54 — forked from grantland/README.md
NextBus API
1: Import the Standard Input Output library
3,4,5,6: Define four macros:
a. MAX_JUDGES
b. MAX_STRING
c. MAX_CONTESTANTS
d. WINNER_CUTOFF
8. Declare a struct called "Score" with the following datatypes:
a. "judgeScore": an array of doubles with a maximum capacity of 3
13. Declare a struct called "Contestant" with the following datatypes:
a. "name": an array of characters with a maximum capacity of 25
----------------------------------------------BUGS----------------------------------------------
======== BUG 1 ========
Original Line: 13, 16
Issue: Case-sensitive comparision of characters
What was done: Used the "tolower" function from the ctype library to convert both the characters being compared to lowercase
Original Code:
1. Import the standard input and output library
2. Import the String helper library
3. Define a macro called SZ and set it to 31
4. declare a character array of size "SZ" (31) called "str1" and set it to "Charlotte's"
5. declare a character array of size "SZ" (31) called "str2" and set it to "Spider's web"
6. declare a character array of size "SZ" (31) called "str3" and initialize it with one item: 0
7. Concatenate the value of str1 and the address of the value at index 9 in the str2 array using the strcat method provided by the string helper library
8. Compare the value of str1 with "Charlotte's web" using the strcmp method.
9. If the result from step 8 is false, execute the contents in the if block (since the condition is prepend with the not (!) operator ): copy the string "is the" to the value of str3
10. If the result from step 8 is true, execute the contents in the else block (since the condition is prepend with the not (!) operator ): copy the string "is not the" to the value of str3
#include <stdio.h>
struct employee {
int empId;
float salary;
};
int main(void) {
int i;
float total_salary = 0.0;
START
SET "state" = "green"
SET "isAdvanceActive" = "true"
SET "timer" = 40 and begin auto-decrement
## Get current time
GET "timer" value
## Check if 4-light/5-states system is active
/*
* AUTHOR <your name>
* EMAIL <your seneca email id>
* SENECA ID <your seneca id>
* DESCRIPTION <description>
*/
#include<stdio.h>
#include<math.h>
@wise-introvert
wise-introvert / w2p2.c
Last active September 24, 2021 23:22
Week 2 Part 2
/*
* AUTHOR <your name>
* EMAIL <your seneca email id>
* SENECA ID <your seneca id>
* DESCRIPTION Print message to the screen
*/
#include<stdio.h>
#include<math.h>