This file contains 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 "SDL_Text.h" | |
void SDL_RenderChar( SDL_Renderer *R, char C, float scale, float x, float y ){ | |
switch(C){ | |
case '!': | |
SDL_RenderFillRectF(R, &(SDL_FRect){(2*scale)+x, (2*scale)+y, 4*scale, 3*scale} ); | |
SDL_RenderFillRectF(R, &(SDL_FRect){(3*scale)+x, (1*scale)+y, 2*scale, 1*scale} ); | |
SDL_RenderFillRectF(R, &(SDL_FRect){(3*scale)+x, (5*scale)+y, 2*scale, 2*scale} ); | |
SDL_RenderFillRectF(R, &(SDL_FRect){(3*scale)+x, (8*scale)+y, 2*scale, 2*scale} ); | |
break; |
This file contains 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 <time.h> | |
#include <math.h> | |
#include <string.h> | |
#include <stdarg.h> | |
#include "multidimensional.h" | |
/* "MAXIMUM GREATER THAN" */ |
This file contains 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 <stdbool.h> | |
#include <time.h> | |
#include <math.h> | |
#include <string.h> | |
#include "multidimensional.h" | |
int compare_ints (const void * a, const void * b){ |
This file contains 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
// reverse engineering of: | |
// https://twitter.com/kitasenjudesign/status/1732795192934338954 | |
int W = 32; | |
float e; | |
int [][] values; | |
int [][] copy; | |
int cx, cy, dir; | |
boolean spiraling = true; | |
int[] dx = { 1, 0, -1, 0 }; |
This file contains 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 <SDL.h> | |
#define min(a,b) (((a)<(b))?(a):(b)) | |
#define max(a,b) (((a)>(b))?(a):(b)) | |
typedef int bool; | |
typedef struct{ |
This file contains 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
/* | |
Testing Binary tree searches against straight floating point multiplication | |
specifically for the purpose of placing coordinates into 'zones' (grid cells) | |
*/ | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <time.h> | |
#include <math.h> | |
#include <string.h> |
This file contains 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
typedef struct vec2d_struct{ | |
double x, y; | |
} vec2d; | |
double v2d_rough_heading8(vec2d v){ | |
if( v.x > 0 ){ | |
if( v.y > 0 ){ | |
if( v.x < v.y ) return 1.1780972450961724;// 3/8 PI | |
else return 0.3926990816987241;// 1/8 PI; | |
} |
This file contains 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
#define UP 1 | |
#define RIGHT 2 | |
#define DOWN 4 | |
#define LEFT 8 | |
#define DEAD 16 | |
#define MASKED 32 | |
#define white 0xffffffff | |
#define black 0xff000000 | |
#define transparent 0x00000000 |
This file contains 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
float theta; | |
boolean over; | |
void setup() { | |
size(400, 400); | |
theta = HALF_PI; | |
over = true; | |
} | |
void draw() { | |
background(0); |
This file contains 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
/* | |
Simple Binary Clock in Processing. | |
Relogio Binario simples em Processing. | |
*/ | |
float tx, ty, dx, dy; | |
void setup() { | |
size(400, 350); | |
tx = width / 9f; | |
ty = height / 3f; |
NewerOlder