code contest

Pages: 12345... 9
Apr 24, 2011 at 7:51pm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#include <iostream>
#include <stdlib.h>
int main(){
    int a[1870] =
{46,14,-62,75,-13,-69,78,1,-79,83,1,-2,-17,13,-7,-2,13,1,-83,84,-5,-79,76,3,7,-17,-91,79,22,6,-85,
75,3,1,8,-87,84,-12,-3,-69,82,3,-9,-7,14,-83,65,13,-10,-68,83,-4,-79,68,11,-79,41,-63,55,-33,70,15
,-9,0,-76,67,12,-2,0,-4,11,-7,-8,9,6,-77,76,-83,87,-15,-7,19,-84,41,-34,70,-77,84,-12,1,5,-3,-2,5,
-7,-71,79,-9,-92,79,22,6,-85,87,-8,6,-9,-8,10,-71,77,-84,71,-2,15,-84,84,-12,1,10,-83,70,12,-3,-2,
-77,65,13,11,-89,79,5,-12,-3,13,-82,71,14,4,-111,63,-41,74,11,-2,1,-84,87,-22,13,0,-13,-65,84,
-15,7,0,-76,89,-10,6,-85,72,7,8,-87,41,-34,70,-77,70,-1,0,7,-3,5,-7,-93,61,40,5,0,-19,-65,77,-12,
10,-6,-69,89,-10,6,-85,85,-7,-10,1,13,1,1,-19,13,-10,-90,0,68,23,17,-17,13,-82,71,8,-1,0,-13,-65,
71,2,13,-17,-69,89,-10,6,-85,85,-5,-102,68,23,17,-17,13,-82,71,8,-1,0,-13,-65,76,-7,15,-84,89,
-10,6,-85,68,11,8,-9,-100,68,23,17,-17,13,-82,71,8,-1,0,-13,-65,82,3,-7,-78,65,17,-3,6,-7,-10,
-68,65,13,-10,-68,68,1,14,-14,13,2,-84,89,-10,6,-107,68,23,17,-17,13,-82,71,8,-1,0,-13,-65,77,
-12,10,-6,-69,89,-10,6,-85,67,15,7,-111,68,23,17,-17,13,-82,71,8,-1,0,-13,-65,83,-18,24,-89,71,8,
0,-11,-2,23,-20,-91,68,23,17,-17,13,-82,71,8,-1,0,-13,-65,84,-15,7,0,-76,65,-65,76,-3,-4,-69,65,
13,-10,-68,72,13,-3,2,-84,89,-10,6,-107,0,77,14,-62,79,-17,-69,75,3,1,8,-9,-78,69,-4,2,5,-72,79,5,
-12,-3,13,-82,70,9,3,-82,83,-4,-79,76,3,-1,-7,-93,79,22,6,-3,-82,72,-3,-4,17,2,-77,76,-83,66,3,0,9,
-78,65,2,5,1,5,-7,-71,66,19,-1,-106,79,22,6,-78,75,-13,-69,84,-5,0,-79,83,-11,17,-89,84,-5,-79,83,
-18,24,-89,73,11,-106,63,37,5,-10,-5,1,-69,87,-18,-69,66,13,5,-12,-72,75,3,1,8,-87,87,-15,-7,19,
-77,76,-83,66,3,0,9,-78,71,8,-6,5,-7,-71,79,-1,-100,77,14,-69,75,3,1,8,-87,84,-12,-3,-69,71,-6,12,
-8,-69,65,13,-10,-68,87,-18,-62,75,-13,-69,71,8,-1,0,-13,-65,80,-4,-11,24,-89,73,11,-106,55,45,-10,
-68,73,-3,-70,89,-10,6,-85,65,18,-8,-75,77,-8,-69,72,7,8,-87,41,-34,70,-77,70,-1,0,7,-3,5,-7,-93,
58,43,-1,-71,77,-84,84,-15,7,0,-76,77,-8,-69,89,-10,6,-78,75,-13,-69,84,-5,0,-79,66,10,-3,5,-10,-68,
84,-5,-79,83,-14,0,-91,0,68,23,17,-17,13,-82,71,8,-1,0,-13,-65,71,2,13,-17,-69,89,-10,6,-85,85,
-5,-102,68,23,17,-17,13,-82,71,8,-1,0,-13,-65,76,-7,15,-84,89,-10,6,-85,68,11,8,-9,-100,68,23,17,
-17,13,-82,71,8,-1,0,-13,-65,82,3,-7,-78,65,17,-3,6,-7,-10,-68,65,13,-10,-68,68,1,14,-14,13,2,-84,
89,-10,6,-107,68,23,17,-17,13,-82,71,8,-1,0,-13,-65,77,-12,10,-6,-69,89,-10,6,-85,67,15,7,-111,68,
23,17,-17,13,-82,71,8,-1,0,-13,-65,83,-18,24,-89,71,8,0,-11,-2,23,-20,-91,68,23,17,-17,13,-82,71,
8,-1,0,-13,-65,84,-15,7,0,-76,65,-65,76,-3,-4,-69,65,13,-10,-68,72,13,-3,2,-84,89,-10,6,-107,0,68,
23,17,-17,13,-82,71,8,-1,0,-13,-65,71,2,13,-17,-69,89,-10,6,-85,85,-5,-102,68,23,17,-17,13,-82,71,
8,-1,0,-13,-65,76,-7,15,-84,89,-10,6,-85,68,11,8,-9,-100,68,23,17,-17,13,-82,71,8,-1,0,-13,-65,82,
3,-7,-78,65,17,-3,6,-7,-10,-68,65,13,-10,-68,68,1,14,-14,13,2,-84,89,-10,6,-107,68,23,17,-17,13,
-82,71,8,-1,0,-13,-65,77,-12,10,-6,-69,89,-10,6,-85,67,15,7,-111,68,23,17,-17,13,-82,71,8,-1,0,
-13,-65,83,-18,24,-89,71,8,0,-11,-2,23,-20,-91,68,23,17,-17,13,-82,71,8,-1,0,-13,-65,84,-15,7,0,-76,
65,-65,76,-3,-4,-69,65,13,-10,-68,72,13,-3,2,-84,89,-10,6,-107,0,30,39,32,-7,-60,-12,71,2,13,-17,
-69,89,-10,6,-85,85,-5,-71,-31,30,39,32,-7,-60,-12,71,2,13,-17,-69,89,-10,6,-85,85,-5,-71,-31,30,
39,32,-7,-63,-31,68,23,17,-17,13,-82,71,8,-1,0,-13,-65,71,2,13,-17,-57,-12,78,-9,17,-17,13,-82,71
,8,-1,0,-13,-65,71,2,13,-17,-91,30,31,34,13,-17,-69,89,-10,6,-85,85,-5,-71,-31,30,39,32,-7,-63,-31,
68,23,17,-17,13,-82,71,8,-1,0,-13,-65,71,2,13,-17,-57,-12,78,-9,17,-17,13,-82,71,8,-1,0,-13,-65,
71,2,13,-17,-91,30,31,34,13,-17,-69,89,-10,6,-85,85,-5,-71,-31,0,77,14,-62,79,-17,-69,75,3,1,8,-87,
69,-4,2,5,-72,79,5,-12,-3,13,-82,70,9,3,-82,83,-4,-79,76,3,-1,-7,-93,79,22,6,-3,-82,72,-3,-4,17,2
,-77,76,-83,66,3,0,9,-78,65,2,5,1,5,-7,-71,66,19,-1,-106,79,22,6,-78,75,-13,-69,84,-5,0,-79,83,-11
,17,-89,84,-5,-79,83,-18,24,-89,73,11,-106,63,37,5,-10,-5,1,-69,87,-18,-69,66,13,5,-12,-72,75,3,1
,8,-87,87,-15,-7,19,-77,76,-83,66,3,0,9,-78,71,8,-6,5,-7,-71,79,-1,-100,77,14,-69,75,3,1,8,-87,84,-
12,-3,-69,71,-6,12,-8,-69,65,13,-10,-68,87,-18,-62,75,-13,-69,71,8,-1,0,-13,-65,80,-4,-11,24,-89,
73,11,-106,0,63,-41,74,11,-2,1,-84,87,-22,13,0,-13,-65,84,-15,7,0,-76,89,-10,6,-85,72,7,8,-87,41,-
34,70,-77,70,-1,0,7,-3,5,-7,-93,61,40,5,0,-19,-65,77,-12,10,-6,-69,89,-10,6,-85,85,-7,-10,1,13,1,1,
-19,13,-10,-90,0,68,23,17,-17,13,-82,71,8,-1,0,-13,-65,71,2,13,-17,-69,89,-10,6,-85,85,-5,-102,68
,23,17,-17,13,-82,71,8,-1,0,-13,-65,76,-7,15,-84,89,-10,6,-85,68,11,8,-9,-100,68,23,17,-17,13,-82
,71,8,-1,0,-13,-65,82,3,-7,-78,65,17,-3,6,-7,-10,-68,65,13,-10,-68,68,1,14,-14,13,2,-84,89,-10,6,-
107,68,23,17,-17,13,-82,71,8,-1,0,-13,-65,77,-12,10,-6,-69,89,-10,6,-85,67,15,7,-111,68,23,17,-17,
13,-82,71,8,-1,0,-13,-65,83,-18,24,-89,71,8,0,-11,-2,23,-20,-91,68,23,17,-17,13,-82,71,8,-1,0,-13,
-65,84,-15,7,0,-76,65,-65,76,-3,-4,-69,65,13,-10,-68,72,13,-3,2,-84,89,-10,6,-107,0,68,23,17,-17,
13,-82,71,8,-1,0,-13,-65,71,2,13,-17,-69,89,-10,6,-85,85,-5,-102,68,23,17,-17,13,-82,71,8,-1,0,-
13,-65,76,-7,15,-84,89,-10,6,-85,68,11,8,-9,-100,68,23,17,-17,13,-82,71,8,-1,0,-13,-65,82,3,-7,-78,
65,17,-3,6,-7,-10,-68,65,13,-10,-68,68,1,14,-14,13,2,-84,89,-10,6,-107,68,23,17,-17,13,-82,71,8,
-1,0,-13,-65,77,-12,10,-6,-69,89,-10,6,-85,67,15,7,-111,68,23,17,-17,13,-82,71,8,-1,0,-13,-65,83,
-18,24,-89,71,8,0,-11,-2,23,-20,-91,68,23,17,-17,13,-82,71,8,-1,0,-13,-65,84,-15,7,0,-76,65,-65,
76,-3,-4,-69,65,13,-10,-68,72,13,-3,2,-84,89,-10,6,-107,0,68,23,17,-17,13,-82,71,8,-1,0,-13,-65,71,
2,13,-17,-69,89,-10,6,-85,85,-5,-102,68,23,17,-17,13,-82,71,8,-1,0,-13,-65,76,-7,15,-84,89,-10,6,
-85,68,11,8,-9,-100,68,23,17,-17,13,-82,71,8,-1,0,-13,-65,82,3,-7,-78,65,17,-3,6,-7,-10,-68,65,13,
-10,-68,68,1,14,-14,13,2,-84,89,-10,6,-107,68,23,17,-17,13,-82,71,8,-1,0,-13,-65,77,-12,10,-6,-69,
89,-10,6,-85,67,15,7,-111,68,23,17,-17,13,-82,71,8,-1,0,-13,-65,83,-18,24,-89,71,8,0,-11,-2,23,-20,
-91,68,23,17,-17,13,-82,71,8,-1,0,-13,-65,84,-15,7,0,-76,65,-65,76,-3,-4,-69,65,13,-10,-68,
72,13,-3,2,-84,89,-10,6};


    int buf = (int)')'; //changed from rand();
    for (int _ = 0; _ < 1870; _++){
     buf += a[_];
     std::cout << (char)buf;
    }
}



edit: fixed
Last edited on Apr 24, 2011 at 9:51pm
Apr 24, 2011 at 8:07pm
@avlagrath: 0.o
Apr 24, 2011 at 8:12pm
I want to have your baby
Apr 24, 2011 at 8:19pm
I don't get it, all it does is output gibberish.
Apr 24, 2011 at 8:21pm
chrisname: just ran a test, I bet it's the rand() function, mine always spits out 41 to begin with, I'll bet if you change the rand() to 41, it would work.
Apr 24, 2011 at 8:27pm
Awesome, now let's see the program you used to generate that, because I refuse to believe you calculated and typed everything by hand.
Last edited on Apr 24, 2011 at 8:27pm
Apr 24, 2011 at 8:31pm
A witch! We've found a witch! Burn her!

Edit:
@ultifinitus,
What operating system are you using? I'm currently on 64-bit Windows 7 Ultimate.
@Browni3141,
It's possible, though I doubt it, I once wrote a Python script just because I was too lazy to think of something like 8 64-bit hexadecimal values... then I used it so I could put it on a laptop and output random hex values to make stupid people think I was some kind of hacker. I never actually went through with that plan, though; mostly because I don't own a laptop...
Last edited on Apr 24, 2011 at 8:44pm
Apr 24, 2011 at 9:16pm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include <iostream>
#include <stdlib.h>

using namespace std;

string extracin();

int main(){
    cout << "** Welcome to the simple string to offset int[] translation program **\n______ created by: Avlagrath\n";
    cout << "\nTo begin with, please enter an original offset number (to be used by intArray[0]) : ";

    //change the following offset to 41 if you wish to use rand() as I did{
    int offset = 0;
    cin >> offset; //NO TYPE CHECKING BE CAREFUL!!!
    cin.ignore();
    //}

    for(;;){
       cout << "\nEnter stuff\n\n>> ";
       string end = "";
       end = extracin();
       if (end == "quit")
       break;

       cout << "\nINPUT :: " << "\"" << end << "\" Code Translation:\n";
       cout << "\nint intArray[" << end.size() << "] = ";

       cout << "{";
        for (int a = 0; a < end.size(); a++){

            cout << -(offset - (int)end[a]);
            if (a != end.size()-1)
            cout << ",";
            offset = (int)end[a];

        }
        cout << "}";
        cout << "\n\n_______________________\n";
    }

}

string extracin(){
 string retstr = "";
 char buffer = cin.get();
 while(buffer != '\n'){
 retstr+= buffer;
 buffer = cin.get();
 }
 return retstr;
}
Apr 24, 2011 at 9:19pm
@chrisname: I'm currently on Win7/32bit perhaps it's the architecture. Anyone else confirm?
Apr 25, 2011 at 9:11pm
@avlagrath's epic masterpiece.

I didn't see that coming... XD
Last edited on Apr 25, 2011 at 9:48pm
Apr 25, 2011 at 9:13pm
@m4ster r0shi
What's an idle RPG?

EDIT: Please no "One that hasn't been fired yet..." jokes.
Last edited on Apr 25, 2011 at 9:13pm
Apr 25, 2011 at 11:49pm
Veltas wrote:
What's an idle RPG?

Here's an example -> http://www.kongregate.com/games/LUKK3/the-idle-rpg

Though, I plan to add some interaction. For example, the user will be able to shape his character by distributing stat/skill points earned by fighting. Also, the user will be able to write mini battle scripts to help the automated battle system (e.g. if hp<10% use potion or run, or if enemy is undead use holy light etc...). I'm still brainstorming the thing. I haven't started coding. I doubt I'll finish it in time, but I'll post it when it's done.
Apr 26, 2011 at 12:09am
.... Idle Pokemon Blue?
Last edited on Apr 26, 2011 at 12:09am
Apr 26, 2011 at 12:18am
Doesn't sound bad...
Apr 26, 2011 at 1:16am
Game sounds actually pretty amusing. Go for it.
Apr 26, 2011 at 3:00am
No time!!!! Anyone else game?
Apr 26, 2011 at 3:45am
I'm a game.
Apr 26, 2011 at 3:54pm
ok i am thinking about extending the deadline to may 25th to give a bunch of extra time. all in favor, post yes in underlined, bold print. all against post no in underlined, bold print.
Apr 26, 2011 at 6:45pm
UNDECIDED =]
Last edited on Apr 26, 2011 at 6:45pm
Apr 26, 2011 at 7:04pm
@ ultifinitus: I always liked that game, which is odd because I grew out of my interest in the show a long time ago. That would be an awsome project.

A note about this Pokemon video game series. I remeber back in High School some girl saw a guy playing this in the library and she tried to accuse the game of encouraging dog fighting, "You're teaching kids to train animals to kill eachother!" or some other nonsense they went back and forth for a while. I was not a part of the conversation yet and had already stopped watching the show years before. But I walked up to her and said "If you can train a cockerspaniel to shit out a tornado then I'll conceed your point. Until then you're arguing about a kids videogame, and losing by the way. The point is you look like an asshole." and I walked away.

I hindsight I shouldn't have done that because she was pretty cute, but I have no real regrets about it since about 50 people laughed.
Pages: 12345... 9