Achieve the simplest task with the most complicated and weird code possible

From blinking an LED to buzzing a buzzer, just things with (+) and (-), no I2C and that sort of things. Can you create the most extreme code?

I ask because.... Yesterday, I was very tired, haven't slept for more than a day and I still stood up and finish some code that I've been trying to do right for a while. Next day, I woke up and saw it running on my arduino (still connected to my computer) and it was working how it should. So, I took a look at my code AND,,, I do not know that I did, I can barely remember, and it's all weird and full of unnecessary but critical lines. Looks like is going to take a while for me to understand what I did.

The purpose of the Programming forum is to do things in the SIMPLEST manner possible.

Hi, You are only supposed to take one tablet ,twice daily, without alcohol.

Tom.... :)

They are right when they call C a write only language. It is impossible to read it unless it is fully commented!

Weedpharma

They are right when they call C a write only language.

You think C is bad. You try reading some one elses Forth, or even your own.

The use of meaningful names for variables, functions and classes help a lot to make self documenting code.

// comments needs to be kept in sync, good names are automatically "in sync".

compare

r = p / t; // RPM = count / time

roundsPerMinute = pulses / duration;

Sorry folks, the One True write-only language is APL

Hi,
Anybody got a pseudo code compiler?

Using any text editor, DOS Editor would be good.

START (yes structured programming)

  • When this fiddly cheap chinese switch is ON.
  • Turn this cheap ebay knock off motor driver ON.
  • Run driver at about 1/2 speed.
  • No No… changed my mind about 1/4 speed if its a weekday.
  • A little over 1/2 speed if its the weekend.
  • But if the date is an odd number, Stop.
  • Oh by the way, strobe three LEDS, red, green and blue LEDs.
  • But only on the 4th of the month.
  • Here is the interweb, buy the bits, program the UNO (Ebay).
  • Get it built.
  • Degbug
  • Any problems, use http://forum.arduino.cc/
  • I’m the only one that knows what the sketch does, so avoid any questions about the application.
  • Ignore AWOL, Grump, Paul etc etc when they quote X-Y Problem.
  • Post the wrong code.
  • DO NOT under any circumstances use code tags…
  • Double post, even Triple post to increase efficiency of finding solutions.
  • If total number of reply posts <30 then GOTO 13.
  • When these fine group of people (yes,forum members) have solved any bugs, DON’T tell them.
  • Oh damn it should be three RED LEDs.
  • You need to use http://forum.arduino.cc/, sign up under new name even if same project, and/or get the MAC next door to do it for you.
  • If RED solution solved GOTO 24.
  • GOTO step 13. (See very structured program)
  • Finished?? Good.
  • Hey thats only 24 steps, X-Y Problem.
  • Sorry 25 steps.
  • Sorry 26 steps.
  • Damn still a bug, GOTO 12

Okay I’m off to work, I’m still taking the tablets… lets…lets… lets…

Tom… :slight_smile:

AWOL: Sorry folks, the One True write-only language is APL

Like the Game of Life in APL?

life←{↑1 ⍵∨.∧3 4=+/,¯1 0 1∘.⊖¯1 0 1∘.⌽⊂⍵}

https://en.wikipedia.org/wiki/APL_%28programming_language%29

AWOL: Sorry folks, the One True write-only language is APL

Yes, APL has certainly taken the cake for the last 50 years, however there is a new contender which I saw a few weeks ago playing code golf.

Here is Parenthetic, two characters make up the whole language and it has a python based compiler. https://github.com/cammckinnon/Parenthetic

I love their sample, "Hello World":

((()()())(()(()()))((()(()))((())()()()()()()())((()()(()))((())()()()()()()()()())
((())()()()()()()()()()()))))((()()())(()(()()()))((()(())(())())((())()()()()()()(
)()()()()()()()()()()()()()()()()()()()()()()()()())))((()(()))((()(())(())())((()(
()))(()(()()))((())()()()()()()())))((()(())(())())((()(()))(()(()()))((())()()()()
)))((()(())(())())((()(()))(()(()()))((())()()()()()()()()()()())))((()(())(())())(
(()(()))(()(()()))((())()()()()()()()()()()())))((()(())(())())((()(()))(()(()()))(
(())()()()()()()()()()()()()()())))(()(()()()))((()(())(())())((()(()))(()(()()))((
())()()()()()()()()()()()()()()()()()()()()()())))((()(())(())())((()(()))(()(()())
)((())()()()()()()()()()()()()()())))((()(())(())())((()(()))(()(()()))((())()()()(
)()()()()()()()()()()()()())))((()(())(())())((()(()))(()(()()))((())()()()()()()()
()()()())))((()(())(())())((()(()))(()(()()))((())()()()))))

Ohhh for a Parenthesis Mismatch compile error.

Tom.... :)

Actually, Parenthesis Mismatch is the only error it will give you. I looked in the compiler.

More than you ever thought infeasible here

HAI,

Ook. Ook?
" :) ....moT">:v
 ^,_@

Ook! is a programming language designed to be understood by Orangutans.

Yes, quite amusing. :P

Whether it succeeds in its design parameters is problematic, no doubt.

HAI

One instruction set computer
A one instruction set computer is a machine which supports only one operation.

Even a simple switch has two instructions, ON OFF.

Ahh… a permanent short circuit (piece of wire) could be a single instruction set computer? ? ? ?

Tom… (OoK! Ook! :))
Damn Parenthesis Mismatch.

TomGeorge: HAI

Even a simple switch has two instructions, ON OFF.

Not if you consider OFF to be a non-instruction. It's either ON or not ON, a negation of the ON instruction.

TomGeorge: Ohhh for a Parenthesis Mismatch compile error.

Tom.... :)

Now [u]THAT[/u] would take some finding!

TomGeorge:
Hi,
You are only supposed to take one tablet ,twice daily, without alcohol.

Tom… :slight_smile:

Lol.

#define my asm
#define every while
#define type unsigned char
#define answer 0x20
#define endO &=~
#define  mysteries |= answer;
#define reptile 0x25))
#define _or *)
#define is (
#define obfuscated (*(
#define dinosaur (*
#define C volatile type
#define think k = F_CPU >> 4
#define end0 |=
#define _and *)(
#define other 0x24))
#define bird volatile
#define name (
#define is_beautiful ::)
#define time (k--)
#define _C every time
#define are my bird name "nop"
#define beautiful is_beautiful

void setup() { obfuscated C _and other mysteries }

void loop()
{
    dinosaur is volatile type _or is reptile end0 answer;
    
    unsigned long think; every time my bird name "nop" is_beautiful;
   
    dinosaur is volatile type _or is reptile endO answer;    
   
    think;  _C are beautiful;
}

beer blink on Arduino Uno.