Ran out of Ideas

It's official, I have ran out of things to code. Could any of you give me some ideas? I would prefer challenges that involve STL containers and classes, as that's what I've been covering these last few weeks.

Thanks guys. :)
Anyone there? I need some quick ideas.
have you tried project Euler. But other ideas include:
1) A prime number generator, that uses the Atkin
2)A text based RPG
3)An HTTP server
1) A prime number generator, that uses the Atkin
I'll try this idea out. :)

2)A text based RPG
I really hate making games.

3)An HTTP server
I think that's out of my realm of possibility. Wouldn't that involve sockets?

Like I said, I'm looking for something that involves work with STL containers and classes. But thanks anyway. :D
Last edited on
4)a graphics rpg is sfml
4)a graphics rpg is sfml
Where would I get the graphics for the game?
Last edited on
SFML, SDL, search the web for free sprites and textures. Here is another idea: Code a Traveling Salesman Solver for cities 1<N<20. It takes an input of the cost of each edge and then gives either the best solution or an optimal solution. Experiment with different algorithms.
Code a Traveling Salesman Solver for cities 1<N<20. It takes an input of the cost of each edge and then gives either the best solution or an optimal solution. Experiment with different algorithms.
What exactly do you mean by 'edge'?
If I understand "Salesman Solver" correctly, this would be something I would challenge too. Your program is given a set of points, and it's the program's job to figure out the shortest route to visit all of the points.

The edge would be the line between the two points, I guess cost would be distance/speed limit type stuff (correct me if I'm wrong).

I like this because it can easily get very complicated. You could make specific pick-up/drop-off points. Then start thinking about a truck driving these goods. Containers come in various sizes/weights, so you want to fill your trucks as efficiently as possible.

Another idea is to come up with a program that will actually help a friend. I have a friend who owns a farm, so I've been talking with him about something that would help him plan his farm/daily activities better.
Last edited on
Script Coder wrote:
3)An HTTP server
xhtmlx wrote:
I think that's out of my realm of possibility. Wouldn't that involve sockets?

Sockets are a good thing to know. A simple HTTP server in C++ is not too hard, the boost.asio examples page has four of them: http://www.boost.org/doc/libs/release/doc/html/boost_asio/examples.html

But seeing as you want to practice the C++ containers.. how about putting together a multi-index container, something like a special case of boost.multi_index. Say, a sorted container that can be iterated according to two different sorting criteria, with two different iterators (I think that's a nice paper-and-pencil interview question).
Last edited on
3) Synchronous sockets are relatively simple. The hardest part is learning how to use the functions. You can even write a wrapper for them relatively easily. Or use something like SFML, which comes with a networking module.

Backpack Problem and Travelling Salesman combined? Could be nice for learning optimizations/efficient algorithms.

5) You could try writing a program to determine if a given chess move is legal, and then expand it into a simple Console based chess game for 2 players. (If you're really ambitious you could write an actual AI for it)

6) Write your own mini-CPU (Virtual Machine). It reads a line of bytes and performs calculations based on what it reads.

7) Write a FSM (Finite State Machine) which simulates basic human emotions and interactions with other humans. (Rejected -> Sad)

8) Write a "sentence generator". Give it a list of words, perhaps weighted in some way to generate more meaningful sentences, and make it output random sentences.

9) Learn about the internal format of your favourite picture file-format and write a program to draw things for you.
Last edited on
10) Write a program which reverses a file, byte by byte. Try using std::vector for buffers.
11) Write a class that uses a move constructor and move operator. (C++11 features[1].)
12) Write your own BigInteger class, which allows you to do arbitrary precision arithmetic[2], like computing factorial of 100.

[1] http://www.cprogramming.com/c++11/rvalue-references-and-move-semantics-in-c++11.html
[2] http://en.wikipedia.org/wiki/Arbitrary-precision_arithmetic
fit.mmu.edu.my/icpc/files/Skiena%20-%20Programming%20Challenges.pdf
You can test them in uva.onlinejudge.org
Thanks for all the ideas guys! I'm going to get a few more people to post here before I mark this as solved.
If you have some time on your hands, try building a neural network evolution algorithm. They're amazing creatures, and can be used to solve just about any problem you can define. I've been building a C++ neural net for some time now, and it can solve the XOR problem in a few hundred milliseconds. That doesn't sound very impressive considering it's running on 8 threads of an i7, but if you think that the same program can can find the square of a number to within 1% in a few minutes, and takes about a day to solve the fibonacci sequence to within 0.1%, all without knowing what any of those things mean or how to solve actually solve them, it's pretty cool. Depending on the way you look at them, neural nets are either amazingly creative line-fitters, or the closest thing we have to creating sentience on a PC (although it's got a long way to go...).

My next step is image recognition and ultimately weather prediction. Problem is, the solution to the latter will probably take several months so I'm still working on a file saving/loading algorithm. Memory is also an issue (especially low level cache, but that's another issue).

Anyway to get started you might want to look at Genetic Algorithms using Gaussian mutation. I'd recommend a feed-forward network for most solutions, but if you want to use it as a learning AI you'd probably want a recurrent network.

A researcher called Kenneth Stanley developed a pretty cool recurrent network evolution algorithm called NEAT (http://nn.cs.utexas.edu/?neat) that you might want to check out if you're interested.
Topic archived. No new replies allowed.