ES Recruitment Drive
About the array with no bounds: it's only possible if you fill it with stuff straight away, then it will make the array's max size equal to what you put in to it; map[] = "123" is the same as map[3]


About the square brackets: That means 'value at that index', so map[0] is the first value, map[1] is the second. In that switch we wanted to loop through and do all of them, so we did map[i] and incremented i each time. And in my example code again I made a mistake -_-; I forgot to increment i
Also I forgot that isn't at all how you declare arrays in C, so I change it to char *...
char *map = "1111z1001z1001z1111x";

void drawmap() {
    int i=0;
    for(;;) {
        switch(map[i]) {
            case '0': cout << ' '; break;
            case '1': cout << '#'; break;
            case '2': cout << '/'; break;
            case 'z': cout << endl; break;
            defauilt: break; }
        i++; } }
there!

Good work, that looks really cool!

You tested out cursors? Or did that end up not working because of the libraries?
I hope I don't make problems for you by saying just to use strings instead of 2d arrays. Well it was fun and educational so if it doesn't work just swap back to map[][] XD

I never made one of these kinds of programs so I'm just saying a ton of stuff without much thought behind it...
<Faint> the rules have been stated quite clearly 3 times now from high staff
Thanks! ^^
Here is the code if you were interested.

:P



Guess I'm going to have to change it now though ^^

Haha I have a feeling I won't be able to make movement happen inside the strings, so I might have to go back to arrays after all ^^' I guess I'll do some research on arrays and learn every tiny detail behind how they work and how they can be applied and take a 3rd swing at it xD
-----
I'm thinking.. is it possible to change what has been displayed without disturbing the entire thing or causing a new display to spawn?

For example just imagine I have my room there

#####
#.o....#
#...... #
##..# # can I cause this o to be swapped with the next_y or next_x position without having to redraw the entire thing and cause the flash?
-----
Ah, seems what I really need to know at the moment is how to make header files.
I think I'm just going to go through the entire C++ Essentials Guide over a week or so and download the Eclipse or Code::Blocks IDE.

I've been using a really outdated and old one called Dev C++ but I kinda liked it since it was simple and I didn't need to know anything about C++ to set it up ^^'
After I've studied I'll try again with knowledge behind what I'm using and actually knowing how to create header files and perhaps I'll understand how to do this part without too much confusion:

"On the main page you can find detailed information about the console library and how to use it. Feel free to take a look there if you have any questions. But just to cover the basics, all examples require the following files to be present in your project when you build:
Static library for the Console interface:
if you're using a GCC-based compiler (like MinGW), use libConsole.a
if you're using Microsoft Visual Studio, use Console.lib
Header file to tell your compiler what's available in the console interface library. This is cleverly named Console.h.
When building on a GCC-based compiler, remember that you'll need to add "-L. -lConsole" to your command line, for example, to build the example project for this article, the command line should look something like "gcc -Wall article1.cpp -L -lConsole -o Article1.exe""
Last edited by souldevilj; Feb 19, 2014 at 12:23 PM. Reason: <24 hour edit/bump
To move things without casuing a flash you need to use a cursor, basically you move the cursor to where you want to draw then overwrite what is there, that way you don't redraw the whole screen.




Headers are pretty easy, if you google "c headers tutorial example" it should give you an idea.

The -l argument tells it to link the library, so -lConsole links the Console library. Try it out with #include <console.h> and see if gcc derp.cpp -lConsole works :3
<Faint> the rules have been stated quite clearly 3 times now from high staff
Alrighty I'll give it a go, if I can get this console.h library along with the cursor related libraries then maybe I can continue this path xP
I'm supposed to contact Dubit about work experience next year because they came to my college and saw the game I created with my team.
But I don't know what to say so it's been nearly a month of me not saying anything to them >.<
You could google them and it'd be the very first thing you see. Damn xS
Oh yeah, dubit looks pretty cool.
<Faint> the rules have been stated quite clearly 3 times now from high staff
They do
I want to contact them really badly but I have no idea what to say.

I think I'll ask my friend what he sent to them- or rather I've asked and he hasn't replied in 2 days. Sigh.. I need to man up :'P