Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Code Thread

Name: Anonymous 2018-02-23 0:05

This place has gone from programming themed garbage to just garbage. Post code. Any clean code. Here's a C function to remove whitespace.

void remove_whitespace(char *s) {
char *i = s;
do
if(!isspace(*i = *s))
++i;
while(*s++);
}

Name: not >>28 2018-03-21 8:22

>>29
look ma, no ifs!
#include <stdlib.h>
#include <stdio.h>

short anus_device;

void printnum(int c){
switch(anus_device){
case 0:
printf("%d",c);
case 1:
return;
}
}

void nop(int c){
}

void fizz_f(int c){
printf("Fizz");
anus_device = 1;
}

void buzz_f(int c){
printf("Buzz");
}

void (*fizz[3])(int c) = {fizz_f, nop, nop};
void (*buzz[5])(int c) = {buzz_f, printnum, printnum, printnum, printnum};

int main(int argc, char **argv){
int i, n;
switch(argc){
case 2:
if(argc < 2) return -1;
n = atoi(argv[1]);
for(i = 0; i < n; i++){
anus_device = 0;
(*fizz[i%3])(i);
(*buzz[i%5])(i);
puts("");
}
default:
return argc - 2;
}
}


Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List