Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 17 of 17

Thread: Beef up my Java knowledge and experience

  1. #1
    Junior Member
    Join Date
    Jul 2011
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Talking Beef up my Java knowledge and experience

    Hello there, 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 Java experience under my belt by taking on small projects which gradually help me raise my experience, please any projects you think I should try to undertake, I'm open to anything but would like to start from easy projects then move onto more harder ones.


  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,318
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: Beef up my Java knowledge and experience

    What type of projects? The reply is typically the same for questions such as this: what interests you? Are there things that you could write along these lines? More generally, there's always sourceforge for open source projects, or how about Project Euler for more mathematical/programming problems.

  3. #3
    Junior Member
    Join Date
    Jul 2011
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Beef up my Java knowledge and experience

    I find that maze generation interests me and I would like to make my own maze generation program one day. My real interests lie in game making which I find more entertaining. I'll look at sourceforge but stuff like project Euler to not interest me at all.

  4. #4
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,424
    My Mood
    Hungover
    Thanks
    144
    Thanked 636 Times in 540 Posts

    Default Re: Beef up my Java knowledge and experience

    Quote Originally Posted by jammy1257 View Post
    I find that maze generation interests me and I would like to make my own maze generation program one day. My real interests lie in game making which I find more entertaining. I'll look at sourceforge but stuff like project Euler to not interest me at all.
    Can I ask why "stuff like Project Euler" don't interest you at all? A lot of game programming is really tough, really tedious, and oftentimes boring. It takes a long time to have something that's fun to play around with. If you have no interest in that kind of thing, then chances are you don't actually have an interest in "game making"- just game playing.

    But maze generation isn't too difficult. You could even start out by simply outputting it to a text file (0 for empty, 1 for wall, something like that) instead of messing around with the GUI side of things.
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  5. #5
    Junior Member
    Join Date
    Jul 2011
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Beef up my Java knowledge and experience

    Project Euler seems like the stuff I have already done in my computer science degree, it's mostly finding the nth number and maths based. I could program to find the answer to such questions but I'd rather focus on what motivates me.

    I would like to make a maze generation that shows the 0 as a empty space and the 1 as a solid line, but I have no idea and I've read about most maze generation programs using complex algorithms and binary search trees, which I learnt about but have no idea to code them.
    Last edited by jammy1257; July 13th, 2011 at 07:59 AM.

  6. #6
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,424
    My Mood
    Hungover
    Thanks
    144
    Thanked 636 Times in 540 Posts

    Default Re: Beef up my Java knowledge and experience

    Quote Originally Posted by jammy1257 View Post
    Project Euler seems like the stuff I have already done in my computer science degree, it's mostly finding the nth number and maths based. I could program to find the answer to such questions but I'd rather focus on what motivates me.
    Fair enough. I might even agree with you, but if your knowledge is "fairly basic" as you said, it's a great way to practice the basics (and some not-so-basics). And if you really want to get into game programming, a firm grasp of the basics is a prerequisite for doing anything interesting. Just my two cents.
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  7. #7
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,318
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: Beef up my Java knowledge and experience

    ...and I've read about most maze generation programs using complex algorithms and binary search trees, which I learnt about but have no idea to code them
    Then this is a perfect time to learn them if games are the path you wish to take. Binary tree's (and tree's in general) are an extremely important data structure to learn as are the algorithms used to traverse the trees. Here you would make a game and put yourself in a position to learn a new and difficult concept to solve a problem - a position which one will find constantly when game programming
    See Maze generation algorithm - Wikipedia, the free encyclopedia

  8. #8
    Junior Member
    Join Date
    Jul 2011
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Beef up my Java knowledge and experience

    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.

    MazeWorks - How to Build a Maze

  9. #9
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,424
    My Mood
    Hungover
    Thanks
    144
    Thanked 636 Times in 540 Posts

    Default Re: Beef up my Java knowledge and experience

    Quote Originally Posted by jammy1257 View Post
    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.

    MazeWorks - How to Build a Maze
    You can certainly set the border of a JLabel to only show certain sides of it (How to Use Borders (The Java™ Tutorials > Creating a GUI With JFC/Swing > Using Swing Components)), but I don't know what that has to do with building a maze. Like I said, I'd recommend you start off with something more basic, without a GUI. Or even take the time to work your way through the basic tutorials before trying to tackle this project.
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  10. #10
    Junior Member
    Join Date
    Jul 2011
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Beef up my Java knowledge and experience

    Because my Cells are JLabels, with borders, a set size and a background colour. When using Depth First Search you must knock down "walls" which refers to the side of the JLabels.

  11. #11
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,424
    My Mood
    Hungover
    Thanks
    144
    Thanked 636 Times in 540 Posts

    Default Re: Beef up my Java knowledge and experience

    Quote Originally Posted by jammy1257 View Post
    Because my Cells are JLabels, with borders, a set size and a background colour. When using Depth First Search you must knock down "walls" which refers to the side of the JLabels.
    Huh? That seems like a really backwards way to go about it. Is that really what the tutorial says to do?
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  12. #12
    Junior Member
    Join Date
    Jul 2011
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Beef up my Java knowledge and experience

    It's not a tutorial but it contains the concept.

    Quote from the website:

    Each square of the grid is a cell. The horizontal and vertical lines represent the walls of the maze. The generation algorithm we're using will assume that, at the beginning, all the walls of the maze are up. Then we selectively knock down walls until we've made a working maze that fits our definition of "perfect."

    Depth-First Search

    This is the simplest maze generation algorithm. It works like this:

    1) Start at a random cell in the grid.
    2) Look for a random neighbor cell you haven't been to yet.
    3) If you find one, move there, knocking down the wall between the cells. If you don't find one, back up to the previous cell.
    4) Repeat steps 2 and 3 until you've been to every cell in the grid.

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

  13. #13
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,424
    My Mood
    Hungover
    Thanks
    144
    Thanked 636 Times in 540 Posts

    Default Re: Beef up my Java knowledge and experience

    Yeah that all sounds good, but I don't see any mention of a JLabel in there. Like I said, I'd start with something that doesn't use a GUI- simply outputting the maze to a text file, for example. When you get that part working (and working perfectly), then you can worry about taking that and building a GUI around it (and my approach would not involve JLabels at all).
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  14. #14
    Junior Member
    Join Date
    Jul 2011
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Beef up my Java knowledge and experience

    Quote Originally Posted by KevinWorkman View Post
    Yeah that all sounds good, but I don't see any mention of a JLabel in there. Like I said, I'd start with something that doesn't use a GUI- simply outputting the maze to a text file, for example. When you get that part working (and working perfectly), then you can worry about taking that and building a GUI around it (and my approach would not involve JLabels at all).
    Well you see I couldn't think of a way to make a Cell so I decided to use a JLabel and display the maze using a GUI. I think I'll stop that for now and try your suggestion about making a maze made up of 0's and 1's.

  15. #15
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,424
    My Mood
    Hungover
    Thanks
    144
    Thanked 636 Times in 540 Posts

    Default Re: Beef up my Java knowledge and experience

    Quote Originally Posted by jammy1257 View Post
    Well you see I couldn't think of a way to make a Cell so I decided to use a JLabel and display the maze using a GUI. I think I'll stop that for now and try your suggestion about making a maze made up of 0's and 1's.
    Yeah, I'd say splitting up the different tasks is a good idea. Keep the maze generation stuff separate from the GUI stuff. I would start by filling a 2D boolean array with values that make a maze- true for wall, false for a path, or something like that. Then you can output that to a file however you want (the trues can be a X, the spaces an O for example). When you get that bit working, then worry about the GUI.
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  16. #16
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,424
    My Mood
    Hungover
    Thanks
    144
    Thanked 636 Times in 540 Posts

    Default Re: Beef up my Java knowledge and experience

    This thread has been cross posted here:

    http://gamejolt.com/community/forums/topics/maze-generation-challenge/902/

    Although cross posting is allowed, for everyone's benefit, please read:

    Java Programming Forums Cross Posting Rules

    The Problems With Cross Posting

    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  17. #17
    Junior Member
    Join Date
    Jul 2011
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Beef up my Java knowledge and experience

    Quote Originally Posted by KevinWorkman View Post
    This thread has been cross posted here:

    http://gamejolt.com/community/forums/topics/maze-generation-challenge/902/

    Although cross posting is allowed, for everyone's benefit, please read:

    Java Programming Forums Cross Posting Rules

    The Problems With Cross Posting

    Thanks for doing that for me, I forgot.

    Cross-posted:
    Beef up my Java/C/C++ knowledge and experience Topic :: rpgmaker.net
    Beef up my Java knowledge and experience - Java

    I have done my maze... but I am going to try to implement a depth first search maze generation.
    ImageShack® - Online Photo and Video Hosting

    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?
    Last edited by jammy1257; July 14th, 2011 at 04:07 PM.

Similar Threads

  1. freelancer experience
    By the light in forum The Cafe
    Replies: 10
    Last Post: November 19th, 2012, 11:24 PM
  2. NEW COMER SEEKING KNOWLEDGE AND GURUS
    By Abu Muhammad in forum Member Introductions
    Replies: 1
    Last Post: March 17th, 2011, 04:34 AM
  3. Sr. Back End Java Developer with Inquira experience
    By Patrick88 in forum Paid Java Projects
    Replies: 1
    Last Post: February 17th, 2011, 05:31 PM
  4. Replies: 5
    Last Post: June 10th, 2010, 10:19 AM
  5. increasing my java knowledge
    By doogiexiv in forum Java Theory & Questions
    Replies: 1
    Last Post: March 8th, 2010, 11:00 PM

Tags for this Thread