Sign in to follow this  
jyujinkai

New programmer has new programmer questions.

Recommended Posts

Be nice... I know you prob get these kind of questions all the time but I couldn't find the answers in a faq and couldn't figure out how to get a search for the answers that wasn't a zillion pages to look though... .. . Anyway. I am a new programmer. I am starting my classes next year, but i have been jumping ahead in preparation by going though a number of books in my spare time. Anyway. I have read though the books and done the exercises in them and feel pretty confident with what they were trying to teach me. (they are simple books : ) My question is dose anyone know of some places on the net were I can find other exercises to do. What I mean is that I find it a little hard to figure out a exersice to test a certain idea that I have been through taught from the books.. and when I do if I can not make it work I am kinda stuck as to why. I was hoping that some of you may know a site were I could download or read questions/exercises that I can work though to get a better knoladge of what I am doing and preferably have a forum there for Q and A or at least a version of the correct code so I can go though it and see what I have done wrong. Thanks in advance for any help you may give me. Jynks

Share this post


Link to post
Share on other sites
Well it really depends on what sort of execises you want.

For algorithmic trickery I would suggest an online judge like valladolid but I think a much better way to learn is to start some small project.

Don't you have some task you routinly do that would benefit from automation?

Or why not write a small game?

Hey, you've just opened the door to endless oppurtinities and here you are asking for pre canned questions.

Find your passion.

Share this post


Link to post
Share on other sites
@DigitalDelusion

Hmm that link looks like that kind of thing I am looking for but way to complicated. Like I said I am just starting and not really ready to make a small game or tackle some kind of logic twist that needs some creative thinking...

I am more interesting in simple problems like (using the game dev theme of this site)

Q - Write a program that asks a user to build a character. Name, Class, Race, random stats and then a incremental stat adjustment from the user.

Things like that. Real simple but not impossible for a beginner like me. It is just when I try to make exercises for myself and I hit a wall I do not know where I can go to ask for help as I am not quite ready for this forum and its very specific area of interest.

Share this post


Link to post
Share on other sites
Well first off, what language are you learning?

Secondly, whatever problems you hit, just ask for help here on the specific problem :)

Thirdly, what have you covered already?

Graf

Share this post


Link to post
Share on other sites
how about creating a program that makes a map with one working path by taking a grid such as below (where '>' is the start and '<' is the end) and removing lines between cells to make the maze go from the start to the end.

You must have the path connect to every cell and there must be at least one "dead end" Also, you can not have the map have more than two openings (start and end)

----------
<_|_|_|_|_|
|_|_|_|_|_|
|_|_|_|_|_|
|_|_|_|_|_|
|_|_|_|_|_>





Each cell must have at least one wall touching it.

Bonus points for a recursive algorithm.


an example of a valid solution:


----------
< |_ _ | |
|_ _ | | |
| _ | |
| | | | |
|_|_|_ _|_>



Share this post


Link to post
Share on other sites
@Grafalgar

I have not covered much only a few "for the beginer" type books. I am trying to learn C++. I only have experience in Visual Basic and PHP. I have been told it is a harder one to learn but it seams to me to be the one that is used the most in the end applications I wish to be involved in. Re,meber this is all a "head start" to proper tuition next year at a school.

I am at a stage where I can do basics. I have yet to make any application that is more complicated that taking imput from user, processing it, and displaying it.

@M2tM

That is exactly the kind of questions I am thinking of.. Much apreciated. I assume you want the map to be created randomly. Not just hard coded in? I will have a serious attempt at this, though I am very new so do not expect me to get it right. :)

Share this post


Link to post
Share on other sites
Random would be great. Glad you like the problem, it's not terribly original, but it's interesting enough and fun enough and on top of that you can look at it from a game perspective. Plus you can display the maze in plain ascii text which is a big plus because fooling around with graphics stuff is hard when you're starting out.

Here are my tips for starting out (WARNING, they are pretty basic, but if you want to do this all on your own, don't read them. On the other hand, they only talk about the display so it's not a big spoiler or anything and might help you get started since you're new.):







-Get some code that displays a map that can be easily changed wall-by-wall first, then start working on the actual maze solution.

-You might want to consider storing the map in some form of two dimensional array.

-Consider making the walls toggle-able on or off.

That's all I'll give you as a hint, and it's only a hint on how to make the maze display, but I hope it gets you thinking of a solid design.

[Edited by - M2tM on December 5, 2005 8:47:06 PM]

Share this post


Link to post
Share on other sites
Quote:
Original post by jyujinkai
Q - Write a program that asks a user to build a character. Name, Class, Race, random stats and then a incremental stat adjustment from the user.


Well, what's wrong with this little exercise? Indeed, it is an excellent start. And why not build upon that? Once you have your character generator, make a system where two characters can fight, with really simple AI controlling both sides. Then let the player control one character. Then try to build an AI that you can't beat every time. And so on.

Share this post


Link to post
Share on other sites
i need help in collision detection...im currently using the bounding box in directx9...but what i want to do is.....if they collide..i use a better more accurate collision detection method...any help

Share this post


Link to post
Share on other sites
generate your own exercises. you'll learn what you want to if you do.
"small games" are a wide range. "guess the number" is a (very) small game. easy to programm, start with it to get the grast of user input and randomization.

then try the mentioned maze-generator.
maybe have your own character-editor.
create some datastructure to let some player move your character through the ramdomly generated maze.
add a better graphical representation, some things to collect.
finally some monster with AI (random-movement would be sufficient for the first try) and the fight-code.

there you got your not-so-small-game. move on from there. you could create a basic rpg-like game even before your course starts.
but this is only an example. if your not interested in an rpg, you could choose a different approach. think of what you want to do and begin with small steps to archieve that. break the big task down far enough and you got some easy exercises that later combined make a game or other app.

Share this post


Link to post
Share on other sites
Well you have a 10 × 10 matrix, pick 25 squares randomly and mark them with a -1, let's call a -1 a mine. then just fill the rest of the matrix so each cell contains the number of mines that are close to that cell (yes this is like a non-playable minesweeper)

(I am gonna use # instead of -1, and a single space instead of 0 for this sample:


-|-|-|-|-|-|-|-|-|-|
| | | | | | | | | |
-|-|-|-|-|-|-|-|-|-|
| |1|1|1| | | | | |
-|-|-|-|-|-|-|-|-|-|
| |1|#|1| | | | | |
-|-|-|-|-|-|-|-|-|-|
| |1|1|1| | | | | |
-|-|-|-|-|-|-|-|-|-|
| | | | |1|1|1| | |
-|-|-|-|-|-|-|-|-|-|
| | |1|1|2|#|1| | |
-|-|-|-|-|-|-|-|-|-|
| | |1|#|2|1| | | |
-|-|-|-|-|-|-|-|-|-|
| | |1|2|3|1|1| | |
-|-|-|-|-|-|-|-|-|-|
| | |1|#|2|#|1| | |
-|-|-|-|-|-|-|-|-|-|
| | |1|1|2|1|1| | |
-|-|-|-|-|-|-|-|-|-|


Share this post


Link to post
Share on other sites
Quote:
Original post by DarkScript
i need help in collision detection...im currently using the bounding box in directx9...but what i want to do is.....if they collide..i use a better more accurate collision detection method...any help


I don't want to be rude, but please make your own topic. I don't think you will get much help using someone elses topic. If you have trouble with making your own topic, ask how.

To the original poster, if you like games, I recommend you make a small one. Try a text version of pong maybe. Guess the number is good as well. Start small, but apply what you learn. If you just answer little exercises, you might learn some, but applying it works better if you really want to learn to use what you learn. Programming isn't like math class because in math, you prove what you know, but a successful programmer proves by doing/making something, not just showing that he knows what a class in C++ is.

Share this post


Link to post
Share on other sites
Hi there.... I have worked though the map problem given to me by "M2tM". Thanks... it is pretty hard for my level.. remember I have only been programming for 4 days and learning from a book at the moment : )

Anyway, I have the map gen working almost 100%. Basically it will create the map, and open the pathways but has no way of telling if it has made a legitimet path from entry to exit.. so 1/2 the maps made will be invalid.. the other 1/2 will look fine...

I am sure I have gone about this wrong.. mabey there is a lot I am missing... but I think I will need to read more of my book as I still have about 1/3 of it to go. Still it was a lot of fun working on a problem that had no answer in the book... thanks again. M2tM.

I will now have a go at doing that "build a character / have it fight" idea of "King of Men", then get back into sloggn though the book.

Please download and have a look at my source and the exe. Any comments appreciated.. form errors in code to presentation, to "HINTS" about how to get it working 100%. Please do not just tell me what to do.

Thanks again :)
Random_Map_01.cpp
Random_Map_01.exe


(if those links break at some time in the future.. please look up The Animation Club, you will find the files there)

@Vexorian
I honestly didn't read your post before I posted these results. As you can probably tell due to the fact that the source dosn't reflect your idea. That seams like a good way of doing it though, to have the program select some "key" points and then build spaces around it... but wouldn't that result in having the same map built each time? And if not how would you stop it from making a dud map (like mine dose 1/2 the time)

Share this post


Link to post
Share on other sites
@Vexorian

oh... sorry I didn't understand you post then.. please explain?

@ghostbear77

Here is the number guessing exersice you talked about. Please download and have a look at my source and the exe. Any comments appreciated.. form errors in code to presentation, etc.
Thanks again :)

Source:
GuessRandomNumber_-_DO.cpp
GuessandomNumber_-_WHILE.cpp
Reverse-GuessNumberGame.cpp

Programs
GuessRandomNumber_-_DO.exe
GuessandomNumber_-_WHILE.exe
Reverse-GuessNumberGame.exe

(if those links break at some time in the future.. please look up The Animation Club, you will find the files there)

Share this post


Link to post
Share on other sites
He was describing a version of minesweeper. If you don't have it under "start->programs->accessories->games" check on google and you should be able to download a copy.

It's a good exercise, but you might have more fun with a character stat thing. Like have a character class and be able to set up two characters and make them fight or something like that. It was your idea anyway so I suppose you should implement it however makes sense to you.

I'm really glad you liked the map thing, it's not a really easy problem especially for a beginner. I'm impressed you got something working, I'll take a look when I get home from work.

Share this post


Link to post
Share on other sites
yeah, something like that. lol

i didn't mean it as exercises but hints on what you could do. use your imagination, say "i want to make an spaceshooter/rpg/rts." and then begin small. i am at the very beginning myself. having made some little programs, not games yet and nothing graphical.
now i've started a remake of "Omega Race" some old C64-'classic' (well it is for me at least) that something like an asteroid-clone. my first step is to create the graphics ("models"), then movement, controls, shooting, ect. you get it, one part after the other. and its all a learning-by-doing too.
i think its an ok way to do it (for now). like in a team, where everybody does something else (one creates the graphics, another the physics-system, and input, ...). but since you're alone, you are everyone in the team, doing the pieces one by one.

you seem to know 'how' to do it, but not 'what'. maybe you should look for some team, that has an idea and participate? when you finally found your own dream, start to work at it. you'll have learned a lot more until then, working with others on their dream. (and maybe it even becomes yours, who knows.)

Share this post


Link to post
Share on other sites
I do have a "dream" game in mind. One that I hope to have an attempt at in the future. I personally am sick of 3d games that are all based on reflex. FPS boar the tears out of me and most RPGs are so lacking that I spend the time reading a good book. The games I seam to be spending more and more time playing are all what I call "quick fix" games or inivative strategy/puzzle games.

A "quick fix" game is something like Galalga, Pacman, Xevious etc etc. Quick to play, you can control it with out reading a 200 page manual and the play time is quick addictive and satisfying , though still leaving room for you to get back to your life. I've yet to come up with a cool idea to enter into that arena. I have seen some good ones over time but nothing recently.. this one here is pretty cool. Though more "wow, thats cool" than "man I can't stop playing". N

As for the long term game, well It is a little large to chat about in this thread... not that it is huge. It is at its very core a cross between a CCG (collectors Card game) and chess, then to spice it up I might add a little Hero's of Might and Magic into the mix... but early days... still gotta get the hang of simple C++ first :). Who knows how my ideas will change once I understand some of the "how's and why's". Entire gaming ideas may open or close to me as I learn how it all works.

As for teams, I am all for community helping and stuff, not sure how I could help most on this forum apart from making 3D content. (I do 3D VFX for film nad TV) Still I am always ready to help if I can.

Share this post


Link to post
Share on other sites
Create a game of guess my number.

Create a map that has (x,y) coords that the user can choose which direction to go, later add things like area descriptions, and enemy encounters. (Textbased game)

Calculate the sum of all 6 digit palindromes.

Create a program to solve towers of hanoi.

Share this post


Link to post
Share on other sites
Assuming you only know console programming check out benryves tutorials. They show you how to do a lot more with the console, perhaps even make a game. I suggest you learn win32. If you know that then I can suggest A LOT More.

Also, when I was first learning I made a program for my first programming class (java), it was to draw things like triangles, squares, and circles anywhere in the console by specifying the (x,y) coordinates and size. It was very much object orientated based, objects for the square, triangle, rectangle, and a drawing object, it also had polymorphism. That will give you something to do. [smile]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this