Public Group

# Greetings and questions^_^

This topic is 4733 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi there!My name is Carol and I´m new to Gamedev.My original language is NOT English,so excuse me if I make spelling mistakes and things like that.^^ I use Dev-C++ as IDE and I´d like to know how can I do 2 things: 1.Change background and word colors on a DOS console app.Because I´ve tried using conio.h,conio.c,used functions like textcolor(BLACK) and textbackground(WHITE),but,firstly,the output colors are never the ones I want,and secondly,I want to paint the whole background,and not only the text background.What should I use? 2.How can I detect the arrow keys and/or the mouse?It seems there´s a function for that in conio.h,but I understand nothing of it XD Any suggestions for where I should look up for answers are accepted. Thanks in advance ^^

##### Share on other sites
Hello and welcome to gamedev!

Well, it looks like you are writing console applications, which is a good start for new people. Unfortunatly, many things in conio.h have been depreciated under windows, cause it was originaly a borland dos library.

I suggest you start here.

MSDN is chock full of info.

Good luck and enjoy your stay!

##### Share on other sites
Minor problem: MSDN supports the Microsoft version of C++. Dev-C++ will be mostly similar, so it's a good resource, but some of it you will need to port because not all the functions are exactly the same. However, for most of your uses, MSDN will be fine.

##### Share on other sites
Thanks!I´ve taken a look at some functions at MSDN and it seems really an excellent source.Well,but the problem is,I can´t keep programming my TicTacToe game right now because I have to implement an algorithm called the Dijkstra´s Algorithm.It is something about graphs,and it should be done in C.The problem is:I know nothing about graphs,I´m in my first semester of Computer Engineering course and my professor is nuts...Any suggestions?XD

##### Share on other sites
Here's an overview:

http://www.math.niu.edu/~rusin/known-math/index/05CXX.html

Basically the idea of a graph is like a bunch of cities connected by roads. Say that there are some cites: Alonso, Beta, Condoro, Divitria, Erba, Fang, and Guluk. There's a couple ways to 'connect' these cities in code. The simpliest, if I remember, is just a matrix, although it takes up extra space. I know there are other implementations hopefully someone else will talk about them... Anyway say that:

Alonso is connected to Beta, Divitria, and Guluk.
Beta is connected to Alonso, Condoro, and Erba
Condoro is connected to Beta, Divitria, Erba, Fang and Guluk
Divitria is connected to Alonso, Condoro, and Guluk
Erba is connected to Beta, Condoro, and Fang
Fang is connected to Condoro, Erba, and Guluk
Guluk is connected to Alonso, Condoro, Divitria, and Fang

In compact matrix form:
          Beta      Condoro   Divitria  Erba      Fang      GulukAlonso    1         0         1         0         0         1Guluk     0         1         1         0         1Fang      0         1         0         1        Erba      1         1         0Divitria  0         1Condoro   1

I believe there's also a way using linked lists. Of course there are weighted graphs as well where instead of putting just a 1 when there was a connection you'd put for example the distance between the cities. I could be very wrong on some points, it's been like 2 years since I thought of this stuff. I just showed how to store it... I'd imagine that there would be a way to add a city with no roads and then have a way to specify what cities are connected to the new one. well I just hope that gave you a little bit to think on.

##### Share on other sites
Well thanks,I managed to do it.Graphs don´t seem so difficult...But what´s the difference between graphs implementation using structs(or classes) and usual unidimensional arrays?Is it efficiency or people like to complicate it(because the usage of structs seemed unnecessary to me)?

##### Share on other sites
This may help you. You'll also have to fiddle with the cursor a lot.

• 10
• 19
• 14
• 19
• 15