19 replaced http://codegolf.stackexchange.com/ with https://codegolf.stackexchange.com/
source | link

By the way, also check out my text-to-speechtext-to-speech answer.

By the way, also check out my text-to-speech answer.

By the way, also check out my text-to-speech answer.

18 added 26 characters in body
source | link

For obfuscation (and ease of programming) we add the '#' character to the numbers. In the program below, patterns is the array of pixel patterns, and lines is the obfuscated array of pattern codes for each line, terminated by an 'x'. For further obfuscation we define "on" pixels in patterns to be any character that isn't a space; this lets us put more misleading text in pattern:

  • Remove all loops and use recursion.
  • Change all functions (except main) to the form int function (int, int) and use the same parameter names for each. The reasons will become clear later.
  • Change main to the form int main (int, int, int) and name the last two parameters the same as your function parameter names.
  • Replace all references to string constants with the strings themselves; and use each string only once if possible.
  • The include can be removed; it's unnecessary for int putchar (int).

STEP 3: Ok. The next step is a big one. All of the functions are now a single statement of the same form. We can now combine them all into a single function, identifying each one by a number -- essentially turning the entire program into a single recursive function with one statement. Note that the first parameter to main will be 1 when the program is run with no arguments, so that should be our initial state.

For obfuscation we add the '#' character to the numbers. In the program below, patterns is the array of pixel patterns, and lines is the obfuscated array of pattern codes for each line, terminated by an 'x'. For further obfuscation we define "on" pixels in patterns to be any character that isn't a space; this lets us put more misleading text in pattern:

  • Remove all loops and use recursion.
  • Change all functions (except main) to the form int function (int, int) and use the same parameter names for each. The reasons will become clear later.
  • Change main to the form int main (int, int, int) and name the last two parameters the same as your function parameter names.
  • Replace all references to string constants with the strings themselves; and use each string only once if possible.
  • The include can be removed; it's unnecessary.

STEP 3: Ok. The next step is a big one. All of the functions are now a single statement of the same form. We can now combine them all into a single function, identifying each one by a number -- essentially turning the entire program into a single recursive function with one statement. Note that the first parameter to main will be 1 when the program is run with no arguments, so that should be our initial state.

For obfuscation (and ease of programming) we add the '#' character to the numbers. In the program below, patterns is the array of pixel patterns, and lines is the obfuscated array of pattern codes for each line, terminated by an 'x'. For further obfuscation we define "on" pixels in patterns to be any character that isn't a space; this lets us put more misleading text in pattern:

  • Remove all loops and use recursion.
  • Change all functions (except main) to the form int function (int, int) and use the same parameter names for each. The reasons will become clear later.
  • Change main to the form int main (int, int, int) and name the last two parameters the same as your function parameter names.
  • Replace all references to string constants with the strings themselves; and use each string only once if possible.
  • The include can be removed; it's unnecessary for int putchar (int).

STEP 3: Ok. The next step is a big one. All of the functions are now a single statement of the same form. We can now combine them all into a single function, identifying each one by a number -- essentially turning the entire program into a single recursive function. Note that the first parameter to main will be 1 when the program is run with no arguments, so that should be our initial state.

17 deleted 1 characters in body
source | link

For obfuscation we add the '#' character to the numbers. In the program below, patterns is the array of pixel patterns, and lines is the obfuscated array of pattern codes for each line;line, terminated by an 'x'. For further obfuscation we define "on" pixels in patterns to be any character that isn't a space; this lets us put more misleading text in pattern:

STEP 1: The next step involves a few tasks:

  • Remove all loops and use recursion.
  • Change all functions (except main) to the form int function (int, int) and use the same parameter names for each. The reasons will become clear later.
  • Change main to the form int main (int, int, int) and name the last two parameters the same as your function parameter names.
  • Replace all references to string constants with the strings themselves; and use each string only once if possible.
  • The include can be removed,removed; it's unnecessary.

STEP 2: Next, make use of the ?: and , operators to transform each function into a single return statement. I'm illustrating this separately from the above because this is where things start getting confusing to look at. Remember that putchar() returns an int, and ?: takes precedence over ,:

STEP 3: Ok. The next step is a big one. All of the functions are now a single statement of the same form. We can now combine them all into a single function, identifying each one by a number -- essentially turning the entire program into a single recursive function with one statement. Note that the first parameter to main will be 1 when the program is run with no arguments, so that should be our initial state.

STEP 4: Finally, remove the switch block by using a series of ?: operators. We can also remove the int declarations, since C will use them by default, as well as the return itself (which will generate a warning at worst). After this, our program is a single, recursive function with one statement. Pretty cool, right?

Edit: I replaced putchar() with a main and c==4c==4 below; because I just thought of it at the last minute:

If you want to add a little flair, you can use more interesting numbers for c and even base the checks off of other numbers (e.g. for the c==2 case, z is ignored and available, so instead of calling main(2,z,_) you could call main(-97,_,_) and replace c==2 with c<-z). Be creative,creative; the possibilities are endless.

FINISH: The final step, then, is to arrange the text in some creative pattern, and voila! You can adjust the code a little to help with formatting (e.g. I added some extra data at the end of the patternspatterns string in the posted program to help get the line length right). The ladies are sure to be all up ons.

For obfuscation we add the '#' character to the numbers. In the program below, patterns is the array of pixel patterns, and lines is the obfuscated array of pattern codes for each line; terminated by an 'x'. For further obfuscation we define "on" pixels in patterns to be any character that isn't a space; this lets us put more misleading text in pattern:

STEP: The next step involves a few tasks:

  • Remove all loops and use recursion.
  • Change all functions (except main) to the form int function (int, int) and use the same parameter names for each. The reasons will become clear later.
  • Change main to the form int main (int, int, int) and name the last two parameters the same as your function parameter names.
  • Replace all references to string constants with the strings themselves; and use each string only once if possible.
  • The include can be removed, it's unnecessary.

STEP: Next, make use of the ?: and , operators to transform each function into a single return statement. I'm illustrating this separately from the above because this is where things start getting confusing to look at. Remember that putchar() returns an int, and ?: takes precedence over ,:

STEP: Ok. The next step is a big one. All of the functions are now a single statement of the same form. We can now combine them all into a single function, identifying each one by a number -- essentially turning the entire program into a single recursive function with one statement. Note that the first parameter to main will be 1 when the program is run with no arguments, so that should be our initial state.

STEP: Finally, remove the switch block by using series of ?: operators. We can also remove the int declarations, since C will use them by default, as well as the return itself (which will generate a warning at worst). After this, our program is a single, recursive function with one statement. Pretty cool, right?

Edit: I replaced putchar() with a main and c==4 below; because I just thought of it at the last minute:

If you want to add a little flair, you can use more interesting numbers for c and even base the checks off of other numbers (e.g. for the c==2 case, z is ignored and available, so instead of calling main(2,z,_) you could call main(-97,_,_) and replace c==2 with c<-z). Be creative, the possibilities are endless.

FINISH: The final step, then, is to arrange the text in some creative pattern, and voila! You can adjust the code a little to help with formatting (e.g. I added some extra data at the end of the patterns string in the posted program to help get the line length right). The ladies are sure to be all up ons.

For obfuscation we add the '#' character to the numbers. In the program below, patterns is the array of pixel patterns, and lines is the obfuscated array of pattern codes for each line, terminated by an 'x'. For further obfuscation we define "on" pixels in patterns to be any character that isn't a space; this lets us put more misleading text in pattern:

STEP 1: The next step involves a few tasks:

  • Remove all loops and use recursion.
  • Change all functions (except main) to the form int function (int, int) and use the same parameter names for each. The reasons will become clear later.
  • Change main to the form int main (int, int, int) and name the last two parameters the same as your function parameter names.
  • Replace all references to string constants with the strings themselves; and use each string only once if possible.
  • The include can be removed; it's unnecessary.

STEP 2: Next, make use of the ?: and , operators to transform each function into a single return statement. I'm illustrating this separately from the above because this is where things start getting confusing to look at. Remember that putchar() returns an int, and ?: takes precedence over ,:

STEP 3: Ok. The next step is a big one. All of the functions are now a single statement of the same form. We can now combine them all into a single function, identifying each one by a number -- essentially turning the entire program into a single recursive function with one statement. Note that the first parameter to main will be 1 when the program is run with no arguments, so that should be our initial state.

STEP 4: Finally, remove the switch block by using a series of ?: operators. We can also remove the int declarations, since C will use them by default, as well as the return itself (which will generate a warning at worst). After this, our program is a single, recursive function with one statement. Pretty cool, right?

Edit: I replaced putchar() with a main and c==4 below; because I just thought of it at the last minute:

If you want to add a little flair, you can use more interesting numbers for c and even base the checks off of other numbers (e.g. for the c==2 case, z is ignored and available, so instead of calling main(2,z,_) you could call main(-97,_,_) and replace c==2 with c<-z). Be creative; the possibilities are endless.

FINISH: The final step, then, is to arrange the text in some creative pattern, and voila! You can adjust the code a little to help with formatting (e.g. I added some extra data at the end of the patterns string in the posted program to help get the line length right). The ladies are sure to be all up ons.

16 deleted 23 characters in body
source | link
15 edited body
source | link
14 added 132 characters in body
source | link
13 added 2 characters in body
source | link
12 added 682 characters in body
source | link
11 added 330 characters in body
source | link
10 Removed "return"; reformatted block and 42 (42 looks better now, too)
source | link
9 Improvements to guide.
source | link
8 Some obfuscation tweaks
source | link
7 deleted 99 characters in body
source | link
6 Syntax coloring
source | link
5 added 47 characters in body
source | link
4 Moved putchar to main(4,z,_)
source | link
3 edited body
source | link
2 added 61 characters in body
source | link
1
source | link