BEEF UP MY JAVA/C/C++ KNOWLEDGE AND EXPERIENCE

Posts

Pages: first 12 next last
I study computer science and I want to prepare for my final year as I have to do a very hard programming based project and I would like to make it easier for myself by starting now. I have fairly basic knowledge of Java, C/C++ and I would like to get more experience under my belt by taking on small projects which gradually help me raise my experience, I'm open to suggestions.
Build a Linked list in C++ (or other data structures)
Build a Quicksort algorithm in C++ (or other sorting algorithm)

For Java, build a simple game!

http://zetcode.com/tutorials/javagamestutorial/
Hexatona
JESEUS MIMLLION SPOLERS
3702
I made a roguelike in c++ at first, and sdl, using this guy's tutorials.

http://lazyfoo.net/SDL_tutorials/index.php

then, i used the link that kentona just posted to convert everything i gad done into java.

I good way to beef up your knowledge of a language is setting up something like a tutorial project (or game) that you kinda do a little of everything with, so that later on when you forget how to do something, you can just look at your project and see how you used it.
author=Hexatona
I good way to beef up your knowledge of a language is setting up something like a tutorial project (or game) that you kinda do a little of everything with, so that later on when you forget how to do something, you can just look at your project and see how you used it.

I also do that but this time I'm trying to make some serious improvements to my programming skills so that I don't struggle for my last year project.
author=kentona
Build a Linked list in C++ (or other data structures)
Build a Quicksort algorithm in C++ (or other sorting algorithm)


Yes, those are good choices.

He should do most data structures over again, LLL, CLL, DLL, Tree's (w/ binary search) Hash Tables, perhaps even an association list w/ a grid structure.

But the best experience I had w/ organization, code completeness, understand-ability, and high-level efficiency optimizations is by making a game. You could use a data structure of your choice to manage the player inventory and get started familiarizing yourself with how an algorithm is built.

I would try my hand at making an A* pathfinding algorithm from scratch (I used a conceptual tutorial found: here). It's all good practice.
This is a good point to the right direction guys. I'm actually building a maze generation program as we speak, trying to implement binary search tree data structure into it. I'll give a go at the A* path finding after, I know that's mostly used for RTS games.
author=supremewarrior
This is a good point to the right direction guys. I'm actually building a maze generation program as we speak, trying to implement binary search tree data structure into it. I'll give a go at the A* path finding after, I know that's mostly used for RTS games.


You can use the A* algorithm to navigate your maze! And A* is also used in far more than just RTS's: Shooters, RPG's, any game really uses a form of it, even sports games like football or baseball!

A binary maze had already been attempted: here. The maze is kinda stupid but whatever, lol. :D

It's also like 5 lines of code max.
I have started my maze generation using this website below, the problem I'm having is that in Java you can set borders for JLabel but it will set it for all the edges where as I'm trying to create a maze that seems to be a problem for me.

http://www.mazeworks.com/mazegen/mazetut/index.htm

Cross-posted:
http://gamejolt.com/profile/kevinworkman/8468/
http://www.javaprogrammingforums.com/java-theory-questions/9804-beef-up-my-java-knowledge-experience-2.html
http://www.programmingforums.org/post214780.html#post214780

EDIT: Made my maze, I will try to implement Depth First Search.
http://imageshack.us/photo/my-images/39/mazex.png/
i am currently in this exact situation. my CSCE department head said that i'll be able to skip a few classes if i can complete a project of his choosing to his satisfaction, so i'm gonna get a book and brush up before the fall.

so if anyone has a good book to recommend for someone who knows how to program, just not in C++, please do!
author=Pasty
so if anyone has a good book to recommend for someone who knows how to program, just not in C++, please do!

The Internet has you covered. As long as you're familiar with OODP you should be set. Just look up every single thing until you've got the hang of; it's a great way to learn. Just dive in with small programs or look up tutorials to challenge yourself.
I'm stuck on this particular point:
Look for a random neighbor cell you haven't been to yet.

How do I "LOOK" for a random neighbour cell? Any hints?
Well, you're neighbors are :
cells[y-1][x], cells[y+1][x], cells[y][x-1], and cells[y][x+1]
right? So just grab a random number from 0-3 and use one of the options.
author=psy_wombats
Well, you're neighbors are :
cells[y-1][x], cells[y+1][x], cells[y][x-1], and cells[y][x+1]

right? So just grab a random number from 0-3 and use one of the options.


Why do you have -1 and +1 ?
author=supremewarrior
Why do you have -1 and +1 ?
Think of your big grid of cells. It'd be just like in RPGmaker. Every cell has its x/y coordinate that determines its position. Increasing X by 1 is one cell to the right, subtracting 1 from Y is one cell above, etc. If that's confusing, just open up RM and move the event cursor around and check the bottom coords display.
author=psy_wombats
author=supremewarrior
Why do you have -1 and +1 ?
Think of your big grid of cells. It'd be just like in RPGmaker. Every cell has its x/y coordinate that determines its position. Increasing X by 1 is one cell to the right, subtracting 1 from Y is one cell below, etc. If that's confusing, just open up RM and move the event cursor around and check the bottom coords display.
I see, have you done this before because I find it hard to translate whats on the website into code.
author=supremewarrior
I see, have you done this before because I find it hard to translate whats on the website into code.

It's an acquired skill.

(I also tend to just try and come up with the algorithms on my own and then look up other people's solutions when I have a basic implementation)
K-hos
whoa You guys are hi-chaining without me? That's just not right. :<
721
If you want to jump into graphical stuff face first then I would suggest: http://www.sfml-dev.org/
Even if you don't know what you're doing, if you have graphics you will be much more motivated to learn, I was anyway.

It's really easy to use too, for example, have some C++;
#include <SFML/Graphics.hpp>
 
 int main()
 {
     sf::RenderWindow window(sf::VideoMode(800, 600), "SFML window");
 
     sf::Image image;
     if (!image.LoadFromFile("a_sprite.png"))
         return EXIT_FAILURE;
     sf::Sprite sprite(image);
 
     while (window.IsOpened())
     {
         sf::Event event;
         while (window.GetEvent(event))
         {
             if (event.Type == sf::Event::Closed)
                 window.Close();
         }

         window.Clear(sf::Color(0,0,0,255));
         window.Draw(sprite);
         window.Display();
     }
 
     return EXIT_SUCCESS;
 }
That's all it takes to create a window and draw an image;
Do you have a preference for the sort of project you'd like to do? I mean, this being a gaming site we tend to think of gaming stuff, but maybe you'd rather build a webserver, build a webapp, explore search strategies for the traveling salesman problem, look at AI...?
author=DFalcon
Do you have a preference for the sort of project you'd like to do? I mean, this being a gaming site we tend to think of gaming stuff, but maybe you'd rather build a webserver, build a webapp, explore search strategies for the traveling salesman problem, look at AI...?
I would like to learn how to do game stuff but I need to work my way up to it, I don't think just skipping everything else and just working on a game would be a good idea right now as I would struggle immensely.
author=Khos
If you want to jump into graphical stuff face first then I would suggest: http://www.sfml-dev.org/
Even if you don't know what you're doing, if you have graphics you will be much more motivated to learn, I was anyway.

It's really easy to use too, for example, have some C++;
#include <SFML/Graphics.hpp>
 
 int main()
 {
     sf::RenderWindow window(sf::VideoMode(800, 600), "SFML window");
 
     sf::Image image;
     if (!image.LoadFromFile("a_sprite.png"))
         return EXIT_FAILURE;
     sf::Sprite sprite(image);
 
     while (window.IsOpened())
     {
         sf::Event event;
         while (window.GetEvent(event))
         {
             if (event.Type == sf::Event::Closed)
                 window.Close();
         }

         window.Clear(sf::Color(0,0,0,255));
         window.Draw(sprite);
         window.Display();
     }
 
     return EXIT_SUCCESS;
 }
That's all it takes to create a window and draw an image;

I'm not that great in C++ but I always see code with :: I am wondering what does it mean? Thats also pretty damn easy to display a window with an image on it, it seems easier than I thought but what about key presses, animation, sound, moving from one room to another?

My reason for trying to do maze generation is because I find it's similar to dungeon generation with a few tweaks it could work the same.
Pages: first 12 next last