This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <SFML/Graphics.hpp> | |
#include <chrono> | |
using namespace std::chrono_literals; | |
int main() { | |
sf::RenderWindow window(sf::VideoMode(1280, 720), "Stutter"); | |
sf::Event event; | |
const float dt = 0.008f; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// There are 5 ships for you and your enemy and their sizes are 1, 2, 3, 4, 5. Map is 10x10 | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <conio.h> | |
#include <time.h> | |
#define GRID_SIZE 10 | |
typedef struct POINT{ int i, j; } POINT; // Coordinate holder |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Snake and Mouse game, you're the mouse. Eat cheese to get points and watch out for the snake! | |
// Written by naezith, you can use/change the code however you want. | |
#include <stdio.h> | |
#include <conio.h> | |
#include <windows.h> | |
#include <math.h> | |
#include <time.h> | |
#define MAP_WIDTH 20 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <conio.h> | |
#define SIZE_X 6 | |
#define SIZE_Y 6 | |
// Visibility and Walls around | |
typedef struct CELL { char mid, N, E, S, W; } CELL; | |
CELL maze[SIZE_X][SIZE_X]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE Course_Catalog [ | |
<!ELEMENT Course_Catalog (Department+)> | |
<!ELEMENT Department (Title,Course*,Professor*,Lecturer*)> | |
<!ELEMENT Professor (First_Name,Middle_Initial?,Last_Name)> | |
<!ELEMENT Lecturer (First_Name,Middle_Initial?,Last_Name)> | |
<!ELEMENT Course (Title,Description?)> | |
<!ELEMENT Description (#PCDATA | Courseref)*> | |
<!ELEMENT Courseref EMPTY> | |
<!ELEMENT Title (#PCDATA)> | |
<!ELEMENT First_Name (#PCDATA)> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <stdio.h> | |
#include <string.h> | |
typedef struct ht_entry_s { char* a; char* b; } ht_entry_t; | |
typedef struct ht_s { ht_entry_t* table; int size; } ht_t; | |
ht_t* ht_create(int size); | |
void ht_set(ht_t* ht, char* a, char* b); // Sets key a, value b | |
char* ht_get(ht_t* ht, char* a); // Gets the value b with the key a | |
char* strapp(char* old_str, char* add_str); // Safely appends the second string to first one |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <limits.h> | |
#include <math.h> | |
int main(){ | |
char words[100][100]; | |
int word_count = 0, line_length; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
typedef struct Process { | |
unsigned int id; | |
int cpu_time; | |
int last_start_time; | |
int preemption_count; | |
} Process; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// You need to uncomment and comment some blocks in order to benchmark, it is not full automatic. | |
#include <sys/time.h> | |
#include <stdlib.h> | |
#include <stdio.h> | |
// Inputs | |
#define ARRAY_SIZE 1000 | |
#define LOGS_ON 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
inf="input_list.txt" # this file has lines like [201504695,ASLI,ASLAN,[email protected],CS101,89,2] | |
outf="list.txt" | |
sep=',' #define seperator | |
#filter the list | |
list=$(cat $inf ` | |
`| egrep "2015.*(CS101|CS102),([6-9][0-9]|100).*" ` # filter with CS101 OR CS102, 2015 and 60 <= mark | |
`| sed 's/-//1' ` # remove - from the number | |
`| awk -F $sep 'int($7)==2' ` # second time they take the lesson | |
`| awk -F $sep 'int($6)<90' ` # mark < 90 |