obfuscated Jingle bells

i wanted to write a small code to us as my Christmas status update

so that the output is


Jingle bells
Jingle bells
Jingle all the way



1
2
3
4
5
6
7
8
9
10
11
void main()
{jingle(2);}

void jingle(int j) 
{cout<<Jingle ";
if(j>0)
{cout<<"bells\n";
jingle(--j);
}
else cout<<"all the way\n";
} 




i was wondering if it could be obfuscated
(i thought of ASCII replacement but the program starts to look ugly)
any sugessions??
int <------- main

1
2
3
4
5
6
7
8
9
10
11
12
13
int main()
{ 
    char arr[5] = {112,151,156,147,154,145}; //That is the word 'Jingle'
    //Make the 4 other arrays required. 
    //and then a simple 
    x = 0;
    while(x < 5)
    {
        cout << arr[x]; 
    }
    cout << " ";
    x = 0;
    //same loop but output 'bells\n' 


That code above took me about 3 minutes to type out (most of that time looking for the correct ascii code). I would be surprised if it took more than 15 minutes to do this and no -one would bother looking up the char array codes to see what the output was going to be.
@Mats: i as i mentioned tried this variation
though this is obfuscated its hardly elegant
i'm looking for a balance between the two
Perhaps you could 'hide' everything in a header file and just call things from the header file? No-one reads header files.

header.h
1
2
3
4
void lambdaone()
{
    cout << "Jingle bells\nJingle bells\nJingle all the way... etc";
}


main.cpp
1
2
3
4
5
6
7
#include <lambdaone.h>

int main()
{
    lambdaone();
    return 0;
}


It is not exactly obfusticated, but I don't think many people will check that header file, so will have no idea what is coming.
Last edited on
i would have posted the whole code so this wont work

anyway what i was looking for was better recursion techniques
Topic archived. No new replies allowed.