Author Topic: java anyone?  (Read 22868 times)

0 Members and 1 Guest are viewing this topic.

Offline [eVo]PvtBenny

  • SA-MP Donator
  • *
  • Posts: 690
    • Awards
Re: java anyone?
« Reply #15 on: October 22, 2012, 04:45:49 PM »
Well i asked in a conversation with my coach/mentor at school and im getting a bit of java as well. Oh joy... lol

Offline [eVo]PvtBenny

  • SA-MP Donator
  • *
  • Posts: 690
    • Awards
Re: java anyone?
« Reply #16 on: November 06, 2012, 10:29:21 PM »
Srrry for the double post.

But does anyone have a good website with all kinds of info on java like tutorials and such. I kinda want to get a headstart at java before we get it at school so i know what they are actually talking about.

im thinking w3schools.org is good ? I learned pretty much everything i know now about html5 and css3 there.

Offline Swanson

Re: java anyone?
« Reply #17 on: November 07, 2012, 02:20:21 AM »
Hey Benny

Especially for you, the best java lectures I've found so far. Enjoy!

http://www.youtube.com/playlist?list=PL84A56BC7F4A1F852

Offline BikeDriver

  • Fisher
  • ******
  • Posts: 1765
  • I can do anything
    • Awards
Re: java anyone?
« Reply #18 on: November 07, 2012, 06:00:41 AM »
cool.

ill give it a try tomorrow since my java teacher is fully retarded
BikeDriv:))))

Haha blwelrwelrt, I registered here earlier :P

Offline [eVo]PvtBenny

  • SA-MP Donator
  • *
  • Posts: 690
    • Awards
Re: java anyone?
« Reply #19 on: November 21, 2012, 05:32:03 PM »
Hey Benny

Especially for you, the best java lectures I've found so far. Enjoy!

http://www.youtube.com/playlist?list=PL84A56BC7F4A1F852

Im not gunna be watching all those vids. I need something more simple like w3schools or something you know. Plus those vids are a guaranteed bore for me and ill be likely to fall asleep

Offline Habdel

  • SA-MP Server Admin
  • SA-MP Developer
  • *
  • *
  • Posts: 302
    • Awards
Re: java anyone?
« Reply #20 on: November 21, 2012, 05:53:33 PM »
I can "code" pawn

Offline EnzoMortelli

Re: java anyone?
« Reply #21 on: November 22, 2012, 09:48:49 AM »
If you can do pawn, you also can do C.
If you can do C, you'd also have no great problems doing java.

Offline [eVo]PvtBenny

  • SA-MP Donator
  • *
  • Posts: 690
    • Awards
Re: java anyone?
« Reply #22 on: November 28, 2012, 09:54:05 PM »
If you can do pawn, you also can do C.
If you can do C, you'd also have no great problems doing java.

With C you mean C++ ?

Offline Niko_boy

  • Tiny Fish
  • *
  • Posts: 9
    • Awards
Re: java anyone?
« Reply #23 on: November 29, 2012, 08:05:32 AM »
If you can do pawn, you also can do C.
If you can do C, you'd also have no great problems doing java.

With C you mean C++ ?

No C and C++ , are both differnt programming C++ > C

Offline SKY

  • Quad Buddy
  • SA-MP Retirees
  • *
  • *
  • Posts: 842
  • GrandDaddy Bikerr, LETS GET IT LETS GO!
    • Awards
Re: java anyone?
« Reply #24 on: December 06, 2012, 06:35:37 PM »
Hey guys im back with a question, im making a tic tac toe game in java eclipse. The game is based on using an array so its 2d and it jusy takes the users x and y coordinate to play a X were they want and they try to beat a dumb cpu. Anyways for those using java or who wanwt to help, i was wondering how i would go upon checking the winner for the game? I tried using if statements and for loops but i couldnt get how to specifically get it working. I currently have everything working except the win check.

if you need my code ill post here. Thank please reply or leave a comment
Since 2008
If you are not part of the quadbuddy association than we can not be friends.

Offline [eVo]PvtBenny

  • SA-MP Donator
  • *
  • Posts: 690
    • Awards
Re: java anyone?
« Reply #25 on: December 06, 2012, 06:40:32 PM »
beat a dumb cpu.

a PLC u mean ? (those are dumb CPU's just FYI)

Offline SKY

  • Quad Buddy
  • SA-MP Retirees
  • *
  • *
  • Posts: 842
  • GrandDaddy Bikerr, LETS GET IT LETS GO!
    • Awards
Re: java anyone?
« Reply #26 on: December 07, 2012, 02:15:28 PM »
beat a dumb cpu.

a PLC u mean ? (those are dumb CPU's just FYI)

its just a stupid ai lol
Since 2008
If you are not part of the quadbuddy association than we can not be friends.

Offline EnzoMortelli

Re: java anyone?
« Reply #27 on: December 07, 2012, 04:03:32 PM »
Well, winning tic tac toe is (obviously) a matter of getting 3 stones in either one vertical, horizontal or diagonal line, right? Supposing the tic tac toe field is 3x3 there should be exactly 8 possible ways of achieving this, 3 vertical, 3 horizontal, 2 diagonal. For the sake of simplicity and through sacrificing some efficiency you could simply save those 8 combinations, and compare it with the player's draws. If the pattern the player klicked contains such a row, he wins. Same for ai. If none, no-one wins.

Would be my first idea so far, haven't played it in a while yet, might think about something more later.

Offline BikeDriver

  • Fisher
  • ******
  • Posts: 1765
  • I can do anything
    • Awards
Re: java anyone?
« Reply #28 on: December 07, 2012, 09:48:23 PM »
Hey guys im back with a question, im making a tic tac toe game in java eclipse. The game is based on using an array so its 2d and it jusy takes the users x and y coordinate to play a X were they want and they try to beat a dumb cpu. Anyways for those using java or who wanwt to help, i was wondering how i would go upon checking the winner for the game? I tried using if statements and for loops but i couldnt get how to specifically get it working. I currently have everything working except the win check.

if you need my code ill post here. Thank please reply or leave a comment

how do you read the color of the one field?

if you know that then its a piece of cake because you can simply write all possible winning combinations down stupidly. as enzo said those are only 8 different ways to win.

like this, considering that the colors are black and white and that the fields are named like this:
1 2 3
4 5 6
7 8 9

*IF*
Field 1 = white
and
Field 2 = white
and
Field 3 = white

*OR*
Field 4 = white
and
Field 5 = white
and
Field 6 = white

*OR*
Field 7 = white
and
Field 8 = white
and
Field 9 = white

*OR*
Field 1 = white
and
Field 4 = white
and
Field 7 = white

*OR*
Field 2 = white
and
Field 5 = white
and
Field 8 = white

*OR*
Field 3 = white
and
Field 6 = white
and
Field 9 = white

*OR*
Field 1 = white
and
Field 5 = white
and
Field 9 = white

*OR*
Field 3 = white
and
Field 5 = white
and
Field 7 = white

*THEN*
White wins

unfortunatly i have no idea how your program works so all i can provide is this pseudo code. of course the above code is simplified to the max.
« Last Edit: December 07, 2012, 09:52:44 PM by BikeDriver »
BikeDriv:))))

Haha blwelrwelrt, I registered here earlier :P

Offline [eVo]PvtBenny

  • SA-MP Donator
  • *
  • Posts: 690
    • Awards
Re: java anyone?
« Reply #29 on: December 08, 2012, 05:39:13 PM »
I obviously need to do some research before i dive into the world of java head first :o