code contest

Pages: 123456... 9
Apr 26, 2011 at 7:57pm
@Computergeek01: "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."

??? Little bit harsh, no?

@m4ster r0shi, I like the idea you have of taking an idle RPG and making it more interactable.

I've got to say, it's like having a virtual RPG character pet. XD I much prefer the idea with your extensions, as a normal idle RPG sounds pretty boring to be honest.
Last edited on Apr 26, 2011 at 8:05pm
Apr 26, 2011 at 8:01pm
I think he was right. She can take her self-righteousness elsewhere.
Apr 26, 2011 at 8:08pm
@ Veltas: What can I say? I was\am an impulsive jerk. Time and time again I have seen that my reaction to situations is largely based on wheither or not I have an audience and how large that audience is. It's not like I slapped her, I do draw the line SOMEWHERE.

@ chrisname: I'm glad someone else thought so!
Apr 26, 2011 at 9:16pm
@Computergeek01: Well don't worry about it then; I wasn't there, what do I know?

@cainen172: Who are the three judges?
Last edited on Apr 26, 2011 at 9:20pm
Apr 26, 2011 at 9:44pm
2 other kids from my school that know some c++
Apr 26, 2011 at 10:11pm
one other thing i wanted to post...

if you are making an rpg game...usefulness factor can be replaced with how in-depth it is. for example if all the game does is go through 1 short quest that lasts only like 2 seconds, it wont get a very good grade
Apr 26, 2011 at 10:23pm
I think I get it now, you and your friends are grading the "Wow factor" of the end product not the code that was used to generate it.

This is what I've been wondering about. This is also highley subjective which I don't know if I like. For me an application might be graceful, clever and absolutley facinating and you might dismiss it as malicious completely ignoring the charm inherit in it's execution. You're also leaving the door wide open by not listing ANY restrictions on function, size or API\Libraries used. Some one who is familiar with Boost::ASIO for example will have a distinct advantage over another person by simply building off of someone elses work especially if you and your friends are familiar with what that library should be able to do. You don't say if you want it to be cross platform or targeted at a specific one.
Last edited on Apr 26, 2011 at 10:24pm
Apr 26, 2011 at 11:02pm
I also made a compression lib that de/recompressed data from various NES/SNES/GB games.

Maybe I can post that when I get home.
Apr 27, 2011 at 2:13pm
@computergeek01: no i already posted what i will be grading the code on....
Apr 28, 2011 at 4:25pm
@Disch I think he didn't want any past projects.
Apr 28, 2011 at 4:57pm
@Veltas:

Looks like you're right.

Original post wrote:

You can post a code that you have been working on for a while too. but you cant post one that you did like 4 months ago.


I read that first sentence, but I guess I missed the 2nd one. =(

Oh well, guess I can't participate.
Apr 28, 2011 at 6:04pm
This is something I did a while back so don't count it... :)

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

#include <iostream>

int add(int a, int b) {
	int m = a ^ b,
		n = a & b;
	if( n != 0 )
		return add(m, n << 1);
	else
		return m;
}

int subtract(int a, int b) {
	int m = a ^ b,
		n = ~a & b;
	if( n != 0 )
		return subtract(m, n << 1);
	else
		return m;
}

int main(int argc, char *argv[]) {
	if( argc < 3 )
		return 1;
	
	int a = atoi( argv[1] ),
		b = atoi( argv[2] );
	std::cout << a << " + " << b << " = " << add(a, b) << '\n';
	std::cout << a << " - " << b << " = " << subtract(a, b) << '\n';
	
	return 0;
}

//Now all I have to do is reinvent Fire and The Wheel using only bitwise operations...
Apr 28, 2011 at 6:12pm
Also... Little know fact, arrays in c++ don't have to start at 0...

1
2
3
template <typename T> void stopComplaining(T *&array) {
  array--;
}
Last edited on Apr 28, 2011 at 6:18pm
Apr 29, 2011 at 7:09am
Awesome stuff Mathhead200. Maybe you could create a bitwise function for multiplication!

@Disch: Shame about your predicament, do you not have time to write something else then?
Apr 29, 2011 at 10:24am
In these 4 pages of thread you have only shown C++ cannot be used to write awesome programs.
For me awesome is achievieng a non-trivial behaviour with simple code. LISP is awesome. TeX is awesome. Unix is awesome. For example it would be awesome if you could write a standard compliant C++ interpreter in C++ and the code would fit fully on the screen. That would be really awesome. But I doubt you can.

And you are showing just the opposite. Most of the code is good for obfuscated C++ contest, not for awesome C++ contest. Just my 3 cents.
Last edited on Apr 29, 2011 at 10:28am
Apr 29, 2011 at 1:23pm
rapidcoder wrote:
For me awesome is achievieng a non-trivial behaviour with simple code.

How about a C++ program that uses genetic algorithms to find a good solution
to the binary knapsack problem? -> http://codepad.org/yWPxzqms

Though, you could say I'm cheating a bit, since the non-trivial behaviour
(BKP solution) is achieved by the algorithm. But still, since the algorithm
is implemented in C++, it's C++ code that achieves non-trivial behaviour :D

Also, since this is something I wrote for a homework assignment
several months ago, it can't be an entry for the competition.

PS: Don't put small values (e.g. 1 or 2) for N or pool size.
Last edited on Apr 29, 2011 at 1:30pm
Apr 29, 2011 at 1:52pm
@rapidcoder,
I don't know about anyone else, but I think writing deliberately obfuscated, but clever, code is much more fun than writing normal programs. It's nice to break the repetition once in a while.
Apr 29, 2011 at 2:07pm
@rapidcoder: I'm sure that LISP, TeX and Unix are awesome but that's a pretty loose example for awesome C++ code. Also, only one example was obfuscated, the rest were easy enough to read.

@m4ster r0shi: Surely you can do cool stuff in all Turing-complete programming languages since the cool stuff really is the algorithm at work?
Apr 29, 2011 at 3:19pm

How about a C++ program that uses genetic algorithms to find a good solution
to the binary knapsack problem? -> http://codepad.org/yWPxzqms


Whoa, 400+ LOC for solving a problem that is almost trivial?
It is not awesome at all. First, GAs are the kind of metaheuristics that are neither simplest, nor the most efficient. There are simpler and better metaheuristics for solving KP, e.g. VNS.

Second, the same algorithm can be implemented in any language, so that it is written in C++ doesn't make it any more or less awesome. If you did the same in 20 LOC, well that would be something.

I mean it is extrmely hard to write awesome code in C++, because C++ is so verbose. Even a simple solution looks quite complicated in it.


I'm sure that LISP, TeX and Unix are awesome but that's a pretty loose example for awesome C++ code.


It is example of awesome code, but not C++ code. All they have nothing in common with C++.
And actually that you can write a LISP interpreter entirely in LISP and its *full* source code fits on the screen - yeah, that is what I call awesome.
Last edited on Apr 29, 2011 at 3:29pm
Apr 29, 2011 at 3:32pm
Bill Gates surprisingly wrote:
Measuring software productivity by lines of code is like measuring progress on an airplane by how much it weighs.
Pages: 123456... 9