import java.util.ArrayList; | |
import java.util.HashMap; | |
import java.util.HashSet; | |
import java.util.List; | |
import java.util.Map; | |
import java.util.Set; | |
/** | |
* Main entry point |
import java.util.concurrent.TimeUnit; | |
class InsertionSort { | |
public static void | |
main(String[] args) { | |
int[] unsortedArray = { 45, 12, 85, 32, 89, 39, 69, 44, 42, 1, 6, 8 }; | |
int[] sortedArray = sort(unsortedArray); | |
displayArray(sortedArray, -1); | |
} |
#include "raylib.h" | |
int main() { | |
enum { TILE_SIZE=16, ROWS=30, COLS=20 }; | |
int score = 0; | |
InitWindow(ROWS*TILE_SIZE, COLS*TILE_SIZE, "Snake"); | |
SetTargetFPS(8); | |
struct { int row; int col; int h_velocity; int v_velocity; int length; | |
int body[ROWS][COLS]; } |
#ifndef PLUSPLUSSDL2_HPP_ | |
#define PLUSPLUSSDL2_HPP_ | |
#include <SDL2/SDL.h> | |
namespace sdl { | |
const Uint32 window_shown = SDL_WINDOW_SHOWN; | |
const int windowpos_undefined = SDL_WINDOWPOS_UNDEFINED; |
There it was... Just sitting there, in all of its beauty. Nothing was wrong with it... Of course, until we contaminated it. It was a zero byte sized, empty file. It was perfect. We mistakenly thought it needed some improvement. So we filled it up with some source code.
It was actually the outside world that really needed the fixing. The idea was to bring in just enough of that (external) complexity into our program. Just enough so that we could straighten it out, a little. When we pull in too much of that chaos then the internal complexity (of our program) rises. If we reach such point then we will often resort to reliance on external tooling to solve our new found problems.
It's like we were trying to help someone out of a ditch and we ended up in there ourselves.
The problem here, in case you haven't noticed, is that we are deploying new t
- Graphics
- Assets
/* Only works with LF, not CRLF or CR | |
* Characters are presumed to be 7-bits. | |
* Tabs only count as one character. | |
*/ | |
#include <stdio.h> | |
#include <ctype.h> /* isspace() */ | |
#define COLUMNS 10 |