Skip to content

Instantly share code, notes, and snippets.

I’m aware that this conversation is almost two years old, but you may (or, more likely, may not ;) be interested to know that almost two months ago I posted to my blog my solution to the “Lucky Name Numbers” problem posed by WJEC for the GCSE Computer Science unit 3 (“Developing Computing Solutions”) controlled assessment, although I focussed more on writing about- than on programming- my solution as I’ve a lot more experience of the latter than of the former – I’ve solved problems posed by the Advent Programming Contest, and Contest Coding, and …

#include "bigBooleanArray.h"
#include <stdio.h>
#include <stdlib.h>
static long g_maximum_index;
static long g_number_of_bytes;
static char *g_byte = NULL;
bool f_BigBooleanArray_Initialised( void )
{
#include "printDateAndTime.h"
#include <time.h>
#include <stdio.h>
void p_PrintDateAndTime( void )
{
time_t t_0;
struct tm *t_1;
char s[ 26 ];
time( &t_0 );
#include <SDL2/SDL.h>
#include "seal_quadColours_triangles.h"
#include "seal_texture.h"
int main( const int argc, const char * const argv[] )
{
const int W = 320, H = 240;
SDL_Init( SDL_INIT_VIDEO );
/* Request a stencil buffer of at least 1bit per pixel. */
@sealfin
sealfin / RussianPeasantMultiplication.java
Created April 6, 2014 16:25
Supposedly, Russian peasants perform multiplication in the following fashion: they write the two numbers which are to be multiplied at the top of two columns; then, they multiply the number in the right column by two, and divide the number in the left column by two – throwing away any fractional part – continuing until the number in the left col…
public class RussianPeasantMultiplication
{
public static int multiply( int l, int r )
{
int result = 0, lsb = l & 1;
if( lsb == 1 )
result += r;
while( l != 0 )
{
r <<= 1;
{$R+}
unit formatCommandCharacterList;
interface
const
k_HEADER = 1; {T}
k_CENTERED_PARAGRAPH = 2; {C}
k_LINK = 3; {L}
k_HORIZONTAL_RULE = 4; {E}
This program will enumerate the format command characters in the file 'metal_help.mhlp', viz. characters preceded by three '@' characters.
'T'
'C'
'L'
'N'
't'
'B'
'n'
'I'
#include <SDL2/SDL.h>
#include "seal_quadColours_triangles.h"
#include "seal_texture.h"
int main( const int argc, const char * const argv[] )
{
const int W = 320, H = 240;
SDL_Init( SDL_INIT_VIDEO );
SDL_Window *window = SDL_CreateWindow( "SDL2 & OpenGL", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, W, H, SDL_WINDOW_OPENGL );