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 <stdint.h> | |
int columns[8] = {-1,-1,-1,-1,-1,-1,-1,-1}; | |
int num_solutions = 0; | |
void print_queens() { | |
for(int y = 0; y < 8; y++) { | |
for(int x = 0; x < 8; x++) { | |
putchar(columns[x] == y ? 'Q' : '.'); |
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 <ctype.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
typedef enum { | |
SUCCESS, // parsed | |
FAILURE, // didn't parse | |
ERROR // bad syntax | |
} status; |
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
func isLeap(y int) bool { | |
if y%4 == 0 { | |
if y%100 == 0 { | |
return y%400 == 0 | |
} | |
return true | |
} | |
return false | |
} |
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
// no includes | |
typedef typeof(sizeof(0)) size_t; | |
#define NULL 0 | |
int printf ( const char * format, ... ); | |
void* memcpy(void *dest, const void * src, size_t n); | |
void exit(int); | |
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 html> | |
<html> | |
<head></head> | |
<body> | |
<canvas id="canvas-id" style="image-rendering:pixelated;"></canvas> | |
<script type="text/javascript"> | |
// triangles are |
OlderNewer