New dev team/java learning thread.

Organized and clear discussion only. Be sure to read sub-forum descriptions.

Forum rules
- All off-topic posts will be removed without notice.
- Poorly written topics/posts will be edited without warning
- Unnecessary topics will be deleted or locked without warning.
- Posts may be moved without warning.
User avatar
Developer
Lt. Commander
Lt. Commander
Progress to next rank:
30.2%
 

Posts: 662

Joined: Thu Dec 06, 2012 7:09 pm

Affiliation: Inactive

IGN: ducky215

Post Tue Jan 21, 2014 10:47 pm

Re: New dev team/java learning thread.

How far is everybody on the book?
- I can be reached as ducky215 on minecraft forums -

CMA

User avatar
Captain
Captain
Progress to next rank:
12.1%
 

Posts: 1083

Joined: Fri Jan 10, 2014 3:16 pm

Affiliation: Byzantine Falangists

Post Wed Jan 22, 2014 8:49 am

Re: New dev team/java learning thread.

I've been reviewing Chapter 2 and 3. Last time I did it I got up to the beginning of chapter 6, so that's about where I am I guess.
"Being a christian democrat is like being a christian satanist" - Adam Berces
User avatar
Vice Admiral
Vice Admiral
Progress to next rank:
21.2%
 

Posts: 2414

Joined: Fri Dec 07, 2012 3:40 pm

Location: -> HERE <-

Affiliation: UTN

Post Fri Jan 24, 2014 1:37 pm

Re: New dev team/java learning thread.

Is there a meeting tonight ? If not then maybe tomorrow in the same time as usual ( 9:30 GMT ) unless you don't think thats required. I kinda find it a good stimulus to progress through the book chapters.
They're watching ... Image

"I am forbidden tag" -CvN
User avatar
Fleet Admiral
Fleet Admiral
 

Posts: 3021

Joined: Fri Dec 07, 2012 12:10 pm

Location: In a universe.

Affiliation: [redacted]

IGN: Ivan2006

Post Fri Jan 24, 2014 1:46 pm

Re: New dev team/java learning thread.

I think we agreed that for a meeting date to be valid, it would have to be posted 24 hours before, so propably no.
Quotes:
Spoiler:
CMA wrote:IT'S MY HOT BODY AND I DO WHAT I WANT WITH IT.

Tiel wrote:hey now no need to be rough

Daynel wrote: you can talk gay and furry to me any time

CMA wrote:And I can't fuck myself, my ass is currently occupied

CMA

User avatar
Captain
Captain
Progress to next rank:
12.1%
 

Posts: 1083

Joined: Fri Jan 10, 2014 3:16 pm

Affiliation: Byzantine Falangists

Post Fri Jan 24, 2014 3:06 pm

Re: New dev team/java learning thread.

I can't access skype for now, sorry. Although everyone assume that there's a meeting on each Friday at 9:30 GMT/4:30 EST. I should probably put that in the OP.
"Being a christian democrat is like being a christian satanist" - Adam Berces
User avatar
Developer
Lt. Commander
Lt. Commander
Progress to next rank:
30.2%
 

Posts: 662

Joined: Thu Dec 06, 2012 7:09 pm

Affiliation: Inactive

IGN: ducky215

Post Fri Jan 24, 2014 6:56 pm

Re: New dev team/java learning thread.

I honestly don't think you can learn Java from purely a book. Let's start a throwaway project. Doing a project is more interesting than reading a book and will keep you interested for longer. It provides applicable knowledge and allows you to learn while still making a project. I've heard that you guys aren't experienced enough, blah blah blah, but it isn't really an excuse. Keep learning java through the textbook, sure, but while doing so, let's create a group project. If we keep reading the book, at the rate you all are going, it's going to take several months and by the end you'll be tired of it, and quit. If we do a project now, we can accomplish things.

It doesn't have to be related, even. We could do a tiny mod that added dwarves to the game or made ninjastars an item. I don't really care, as long as we start working so the team doesn't collapse.
- I can be reached as ducky215 on minecraft forums -

CMA

User avatar
Captain
Captain
Progress to next rank:
12.1%
 

Posts: 1083

Joined: Fri Jan 10, 2014 3:16 pm

Affiliation: Byzantine Falangists

Post Fri Jan 24, 2014 7:45 pm

Re: New dev team/java learning thread.

Keon wrote:I honestly don't think you can learn Java from purely a book. Let's start a throwaway project. Doing a project is more interesting than reading a book and will keep you interested for longer. It provides applicable knowledge and allows you to learn while still making a project. I've heard that you guys aren't experienced enough, blah blah blah, but it isn't really an excuse. Keep learning java through the textbook, sure, but while doing so, let's create a group project. If we keep reading the book, at the rate you all are going, it's going to take several months and by the end you'll be tired of it, and quit. If we do a project now, we can accomplish things.

It doesn't have to be related, even. We could do a tiny mod that added dwarves to the game or made ninjastars an item. I don't really care, as long as we start working so the team doesn't collapse.

We should probably do a standalone before a mod, I have plenty of ideas if y'all can't come up with anything.
"Being a christian democrat is like being a christian satanist" - Adam Berces
User avatar
Developer
Lt. Commander
Lt. Commander
Progress to next rank:
30.2%
 

Posts: 662

Joined: Thu Dec 06, 2012 7:09 pm

Affiliation: Inactive

IGN: ducky215

Post Fri Jan 24, 2014 8:26 pm

Re: New dev team/java learning thread.

CMA wrote:
Keon wrote:I honestly don't think you can learn Java from purely a book. Let's start a throwaway project. Doing a project is more interesting than reading a book and will keep you interested for longer. It provides applicable knowledge and allows you to learn while still making a project. I've heard that you guys aren't experienced enough, blah blah blah, but it isn't really an excuse. Keep learning java through the textbook, sure, but while doing so, let's create a group project. If we keep reading the book, at the rate you all are going, it's going to take several months and by the end you'll be tired of it, and quit. If we do a project now, we can accomplish things.

It doesn't have to be related, even. We could do a tiny mod that added dwarves to the game or made ninjastars an item. I don't really care, as long as we start working so the team doesn't collapse.

We should probably do a standalone before a mod, I have plenty of ideas if y'all can't come up with anything.


Like? I'm just saying; small mods are much easier than small standalone games. But sure, post ideas.
- I can be reached as ducky215 on minecraft forums -
User avatar
Vice Admiral
Vice Admiral
Progress to next rank:
21.2%
 

Posts: 2414

Joined: Fri Dec 07, 2012 3:40 pm

Location: -> HERE <-

Affiliation: UTN

Post Sat Jan 25, 2014 3:42 am

Re: New dev team/java learning thread.

Keon you can do a project only once you learn the basics, there is no way around that book if you don't know any programming, without it you just lack the knowledge to understand more complex code and knowledge of proper code writing. Once you know how to write functions and do different basic algorithms I can give you a small console application project, then perhaps a bigger one when you learn about classes and different objects.
They're watching ... Image

"I am forbidden tag" -CvN
User avatar
Developer
Lt. Commander
Lt. Commander
Progress to next rank:
30.2%
 

Posts: 662

Joined: Thu Dec 06, 2012 7:09 pm

Affiliation: Inactive

IGN: ducky215

Post Sat Jan 25, 2014 9:27 am

Re: New dev team/java learning thread.

Iv121 wrote:Keon you can do a project only once you learn the basics, there is no way around that book if you don't know any programming, without it you just lack the knowledge to understand more complex code and knowledge of proper code writing. Once you know how to write functions and do different basic algorithms I can give you a small console application project, then perhaps a bigger one when you learn about classes and different objects.


You do have a valid point, but I still think that the best way for somebody to to learn to code is to code.

The alternative is we wait for 3-4 months while you all read through a badly-written book that will give you little to no practical skills. When you finish, half of you will have quit. The other half will be on the verge of doing so. Your plan is to study, to put off the beginning for as long as possible. I realize that most of you can't code a complete game yet, but I don't expect that. The great thing with team projects is that they are great motivators. Now, your concern that we can't code this yet is valid, but I guess I feel that you all will learn to code faster everybody actually sees what coding is like.

When I first started to learn Python, my first large project (Maybe 2 weeks after I began) was a text-based RPG. When I look back on it, it's terrible. I didn't know about functions until halfway through it, and I didn't know anything about classes. I stored character stats in a hashmap, rather than a class. But the important thing was, I learned new things. I learned about how functions worked, I learned more about the basics, and probably most importantly, I learned the thought process behind making a program. That's something no book can teach you.

I don't know, I'm tired. But tl;dr, we should get out there and make some small thing. We don't need to publish it to the world, just do something. I'd like to hear CMA's standalone ideas.
- I can be reached as ducky215 on minecraft forums -

CMA

User avatar
Captain
Captain
Progress to next rank:
12.1%
 

Posts: 1083

Joined: Fri Jan 10, 2014 3:16 pm

Affiliation: Byzantine Falangists

Post Sat Jan 25, 2014 9:46 am

Re: New dev team/java learning thread.

Keon wrote:
When I first started to learn Python, my first large project (Maybe 2 weeks after I began) was a text-based RPG. When I look back on it, it's terrible. I didn't know about functions until halfway through it, and I didn't know anything about classes. I stored character stats in a hashmap, rather than a class. But the important thing was, I learned new things. I learned about how functions worked, I learned more about the basics, and probably most importantly, I learned the thought process behind making a program. That's something no book can teach you.

Heh, I did almost exactly the same thing. Anyway, I had a bunch of them, but the only ones I can find/remember are:

+Prototype of the research minigame, no idea how this is supposed to work though.
+2D ship combat thing, like [url="this game"]http://www.aresgames.eu/games/ww1-wings-of-glory-line[/url] but space ships and automated and stuff. I don't think it would be hard to do, unless we try to implement realistic physics and keep the graphics very very low. Alternatively, we could make an attempt at trying to make a 3D combat sim, and maybe learn LWJGL, although that's a bit ambitious IMO.
+text based RPG of some sort.
+Some sort of pseudo-AI thing, we could use the same parser(whether we make it or use a library) for this and the RPG

There are a few more, I'll see if I can remember them.
"Being a christian democrat is like being a christian satanist" - Adam Berces
User avatar
Vice Admiral
Vice Admiral
Progress to next rank:
21.2%
 

Posts: 2414

Joined: Fri Dec 07, 2012 3:40 pm

Location: -> HERE <-

Affiliation: UTN

Post Sat Jan 25, 2014 11:13 am

Re: New dev team/java learning thread.

Fine as you wish, the following exercise is worth half a year of programming studying. It covers up some basics such as user I/O (input / output), processing characters, functions, working with strings etc.


Spoiler:
In the game called "Bullseye" (if I recall the name correctly) two players choose a number and try , each one in his turn, to guess the number of the other. In each guess the other player compares the guess with his number:

- If a digit exists in his number but not in the right position the player counts it as a "hit".
- if a digit exists in his number in the exact position the palyer counts it as a "bullseye" .

The palyer only reports the number of "hits" and "bullseye" and not their position (naturally, otherwise it deafeats the point of the game !)

Example:

The chosen number is 6349.
Guesses:

1234 ----- 2 hits.
5678 ----- 1 hit.
2369 ----- 2 bullseye and 1 hit.



Write a program in Java that plays a game of bullseye between a human player and the computer. The computer chooses a random 4 digit number, all digits must be different.
In each turn:

- The human palyer guesses a number, the computer verifies the digits are different.
- The computer checks the number and prints X for a bullseye and 0 for a hit.
- The game will declare victory when it recognizes 4 bullseye and inform how many guesses it took.
- The program will allow to stop the game by pressing 'escape'.
- The number of turns is limited, after 20 turns the game reveals the number and declares defeat.

Additional instructions:

- The computer will save the chosen number as a string ( you may choose the number as int at first and then convert it to a string)
- The computer will save the guessed number into a string as well and insure the number contains 4 digits.
- Each function in the program must not exceed 3 screens in length (that is BTW a very generous space to work with, by writing that I mean break your program into subtasks, each handled with a sapperate function)
- The code must incldue comments that explain the variables, functions and tasks preformed in the program.
- You may use TextIO class included in the java text book.


Program example:

http://www.mediafire.com/download/p22mp ... llseye.exe

[ Do note this is the old program I wrote in C#, java is not even nearly as generous graphics-wise when it comes to console applications so no need to try and replicate the same thing in Java. I will write this program again in java together with you ]
They're watching ... Image

"I am forbidden tag" -CvN
User avatar
Cadet
Cadet
Progress to next rank:
44.4%
 

Posts: 25

Joined: Sun Jan 12, 2014 3:38 am

IGN: craftqq

Post Sun Jan 26, 2014 12:06 pm

Re: New dev team/java learning thread.

Iv121 wrote:Fine as you wish, the following exercise is worth half a year of programming studying. It covers up some basics such as user I/O (input / output), processing characters, functions, working with strings etc.


Spoiler:
In the game called "Bullseye" (if I recall the name correctly) two players choose a number and try , each one in his turn, to guess the number of the other. In each guess the other player compares the guess with his number:

- If a digit exists in his number but not in the right position the player counts it as a "hit".
- if a digit exists in his number in the exact position the palyer counts it as a "bullseye" .

The palyer only reports the number of "hits" and "bullseye" and not their position (naturally, otherwise it deafeats the point of the game !)

Example:

The chosen number is 6349.
Guesses:

1234 ----- 2 hits.
5678 ----- 1 hit.
2369 ----- 2 bullseye and 1 hit.



Write a program in Java that plays a game of bullseye between a human player and the computer. The computer chooses a random 4 digit number, all digits must be different.
In each turn:

- The human palyer guesses a number, the computer verifies the digits are different.
- The computer checks the number and prints X for a bullseye and 0 for a hit.
- The game will declare victory when it recognizes 4 bullseye and inform how many guesses it took.
- The program will allow to stop the game by pressing 'escape'.
- The number of turns is limited, after 20 turns the game reveals the number and declares defeat.

Additional instructions:

- The computer will save the chosen number as a string ( you may choose the number as int at first and then convert it to a string)
- The computer will save the guessed number into a string as well and insure the number contains 4 digits.
- Each function in the program must not exceed 3 screens in length (that is BTW a very generous space to work with, by writing that I mean break your program into subtasks, each handled with a sapperate function)
- The code must incldue comments that explain the variables, functions and tasks preformed in the program.
- You may use TextIO class included in the java text book.


Program example:

http://www.mediafire.com/download/p22mp ... llseye.exe

[ Do note this is the old program I wrote in C#, java is not even nearly as generous graphics-wise when it comes to console applications so no need to try and replicate the same thing in Java. I will write this program again in java together with you ]


Program
Source code
My try at what you proposed. I may have commented a bit too much (as in almost every.single.line)
  Code:
╔═══  ║   ║  ══╦══  ║   ║  ╔══╗   ╔═══  ╔═══╗  ╔══╗   ╔═══╗  ╔═══  ══╦══
║     ║   ║    ║    ║   ║  ║  ║   ║     ║      ║  ║   ║   ║  ║       ║ 
╠══   ║   ║    ║    ║   ║  ╠══╩╗  ╠══   ║      ╠══╩╗  ╠═══╣  ╠══     ║ 
║     ║   ║    ║    ║   ║  ║   ║  ║     ║      ║   ║  ║   ║  ║       ║ 
║     ╚═══╝    ║    ╚═══╝  ║   ║  ╚═══  ╚═══╝  ║   ║  ║   ║  ║       ║ 
User avatar
Vice Admiral
Vice Admiral
Progress to next rank:
21.2%
 

Posts: 2414

Joined: Fri Dec 07, 2012 3:40 pm

Location: -> HERE <-

Affiliation: UTN

Post Sun Jan 26, 2014 1:12 pm

Re: New dev team/java learning thread.

The program contains errors of different sorts and does not meet the requirements of the program:

1. The random number contains 0's and repeating numbers (yea I forgot to add the 0's to the list but the repeating numbers was clearly specified)
2. The program responds incorrectly to my guesses, I didn’t have a single hit in my guess yet I was shown a hit.
3. The player's invalid input is not handled: You are able to input letters and repeating numbers.
4. The player is unable to press 'escape' and leave the game.
5. Try to use less global variables (Like 'hits' for example).
6. Improper usage of strings, a string is an array in it's own right, no need to create a separate string for each number , instead add the new number directly into the string.


Some of those you could have figured if you tested your program properly.

Also a little trick:

  Code:
            String inputNumber = TextIO.getlnString(); //gets the input
            String inputNumberPart[] = new String[4]; //the digits off the input
            int hitCount = 0; //how many hits ("O") you scored
            int bullseyeCount = 0; //hoe many bullseyes ("X") you scored


  Code:
            String inputNumber = TextIO.getlnString(); // gets the input
            String inputNumberPart[] = new String[4];  // the digits off the input
            int hitCount = 0;                          // how many hits ("O") you scored
            int bullseyeCount = 0;                     // hoe many bullseyes ("X") you scored


The later is much more readable , right ? That is ofc if that damn code tag is not being a b**** on your comp because here I had to play around with the text because for some weird reason the size of space on different lines was different ...
They're watching ... Image

"I am forbidden tag" -CvN
User avatar
Cadet
Cadet
Progress to next rank:
44.4%
 

Posts: 25

Joined: Sun Jan 12, 2014 3:38 am

IGN: craftqq

Post Sun Jan 26, 2014 1:49 pm

Re: New dev team/java learning thread.

Iv121 wrote:The program contains errors of different sorts and does not meet the requirements of the program:

1. The random number contains 0's and repeating numbers (yea I forgot to add the 0's to the list but the repeating numbers was clearly specified)
2. The program responds incorrectly to my guesses, I didn’t have a single hit in my guess yet I was shown a hit.
3. The player's invalid input is not handled: You are able to input letters and repeating numbers.
4. The player is unable to press 'escape' and leave the game.
5. Try to use less global variables (Like 'hits' for example).
6. Improper usage of strings, a string is an array in it's own right, no need to create a separate string for each number , instead add the new number directly into the string.


Some of those you could have figured if you tested your program properly.

Also a little trick:

  Code:
            String inputNumber = TextIO.getlnString(); //gets the input
            String inputNumberPart[] = new String[4]; //the digits off the input
            int hitCount = 0; //how many hits ("O") you scored
            int bullseyeCount = 0; //hoe many bullseyes ("X") you scored


  Code:
            String inputNumber = TextIO.getlnString(); // gets the input
            String inputNumberPart[] = new String[4];  // the digits off the input
            int hitCount = 0;                          // how many hits ("O") you scored
            int bullseyeCount = 0;                     // hoe many bullseyes ("X") you scored


The later is much more readable , right ? That is ofc if that damn code tag is not being a b**** on your comp because here I had to play around with the text because for some weird reason the size of space on different lines was different ...


...well, that's what I get for not reading instructions properly. I'll fix it tomorrow. The comments not aligned properly is my fault. I'll fix that, too.
  Code:
╔═══  ║   ║  ══╦══  ║   ║  ╔══╗   ╔═══  ╔═══╗  ╔══╗   ╔═══╗  ╔═══  ══╦══
║     ║   ║    ║    ║   ║  ║  ║   ║     ║      ║  ║   ║   ║  ║       ║ 
╠══   ║   ║    ║    ║   ║  ╠══╩╗  ╠══   ║      ╠══╩╗  ╠═══╣  ╠══     ║ 
║     ║   ║    ║    ║   ║  ║   ║  ║     ║      ║   ║  ║   ║  ║       ║ 
║     ╚═══╝    ║    ╚═══╝  ║   ║  ╚═══  ╚═══╝  ║   ║  ║   ║  ║       ║ 
PreviousNext

Return to Development

Who is online

Users browsing this forum: No registered users and 1 guest

cron