Pencet CTRL - V dan Langsung post disini
I dare you.
Gue pengen tahu terakhir kali loe ketik apaan.
nb : semua link2 bokep akan di sensor *
Pencet CTRL - V dan Langsung post disini
I dare you.
Gue pengen tahu terakhir kali loe ketik apaan.
nb : semua link2 bokep akan di sensor *
win-win solution adalah anak kecil dibully sama orang gede terus dikasih permen biar diem
:D
TIDAK MENERIMA BARCEN
Embrace: The Philosophy of RiXtopia
Ti ati.
✓ The World of RiX ~ Index
✓ My SoundCloud
OFFICIAL PENSI DOTA 1 IDGS - MOVE ON DOTA 2
*NULL*
clipboard gw kosong
edit: oh maaf saya emang oon, maksudnya post sebelum ini ya...
http://forum.indogamers.com/showthre...t=#post7651715
Last edited by amber; 01-12-12 at 16:39.
U-N-I-T-E-D
United are the team for me
With A knick knack paddy whack give a dog a bone
Why dontCityf*ck off home
"I have to train with 10 men [to prepare for the Barcelona semi-final], how to play with 10 men, because I go there with Chelsea, I finish with 10, I go there with Inter, I finish with 10 and I have to train to play with 10 men because it can happen again" - Jose Mourinho
-sdabuls6fnd3soos
free dota2 key! pm me :D
AS:
BS:
Agi:
Ref:
Conc:
Judg:
Luk:
+Personal Corner | Lunatic Moe Anime Review
+My Story INDEX
+GRP/BRP Formula | IDGS Newbie Guide
The moment you say a word of parting, you've already parted.
So long as you and I are both somewhere in this world, we haven't parted.
So long as you don't say it, you haven't parted.
That is the way of the world:
The Law of Linkage.
Shichimiya Satone - Sophia Ring S.P. Saturn VII
package tugassembilanbelasnov;
import java.awt.*;
import java.awt.event.*;
import java.awt.image.BufferedImage;
import javax.swing.*;
import javax.swing.border.LineBorder;
public class TicTacToe extends JApplet {
// Indicate which player has a turn, initially it is the X player
private char whoseTurn = 'X';
// Create and initialize cells
private Cell[][] cells = new Cell[3][3];
// Create and initialize a status label
private JLabel jlblStatus = new JLabel(" "+"X's turn to play");
/** Initialize UI */
public TicTacToe() {
jlblStatus.setHorizontalTextPosition(JLabel.CENTER );
// Panel p to hold cells
JPanel p = new JPanel(new GridLayout(3, 3, 0, 0));
for (int i = 0; i < 3; i++)
for (int j = 0; j < 3; j++)
p.add(cells[i][j] = new Cell());
// Set line borders on the cells panel and the status label
p.setBorder(new LineBorder(Color.red, 1));
jlblStatus.setBorder(new LineBorder(Color.red, 1));
// Place the panel and the label to the applet
add(p, BorderLayout.CENTER);
add(jlblStatus, BorderLayout.SOUTH);
}
/** Determine if the cells are all occupied */
public boolean isFull() {
for (int i = 0; i < 3; i++)
for (int j = 0; j < 3; j++)
if (cells[i][j].getToken() == ' ')
return false;
return true;
}
/** Determine if the player with the specified token wins */
public boolean isWon(char token) {
for (int i = 0; i < 3; i++)
if ((cells[i][0].getToken() == token)
&& (cells[i][1].getToken() == token)
&& (cells[i][2].getToken() == token)) {
return true;
}
for (int j = 0; j < 3; j++)
if ((cells[0][j].getToken() == token)
&& (cells[1][j].getToken() == token)
&& (cells[2][j].getToken() == token)) {
return true;
}
if ((cells[0][0].getToken() == token)
&& (cells[1][1].getToken() == token)
&& (cells[2][2].getToken() == token)) {
return true;
}
if ((cells[0][2].getToken() == token)
&& (cells[1][1].getToken() == token)
&& (cells[2][0].getToken() == token)) {
return true;
}
return false;
}
// An inner class for a cell
public class Cell extends JPanel {
// Token used for this cell
private char token = ' ';
public Cell() {
setBorder(new LineBorder(Color.red, 1)); // Set cell's border
addMouseListener(new MouseListener()); // Register listener
}
/** Return token */
public char getToken() {
return token;
}
/** Set a new token */
public void setToken(char c) {
token = c;
repaint();
}
/** Paint the cell */
protected void paintComponent(Graphics g) {
super.paintComponent(g);
g.setColor(Color.red);
if (token == 'X') {
g.drawLine(10, 10, getWidth() - 10, getHeight() - 10);
g.drawLine(getWidth() - 10, 10, 10, getHeight() - 10);
}
else if (token == 'O') {
g.drawOval(10, 10, getWidth() - 20, getHeight() - 20);
g.fillOval(10,10,getWidth() - 20,getHeight() - 20);
}
}
private class MouseListener extends MouseAdapter {
/** Handle mouse click on a cell */
public void mouseClicked(MouseEvent e) {
// If cell is empty and game is not over
if (token == ' ' && whoseTurn != ' ') {
setToken(whoseTurn); // Set token in the cell
// Check game status
if (isWon(whoseTurn)) {
jlblStatus.setHorizontalTextPosition(JLabel.CENTER );
jlblStatus.setVerticalTextPosition(JLabel.CENTER);
jlblStatus.setForeground(Color.green);
jlblStatus.setText(" "+whoseTurn + " won! The game is over");
whoseTurn = ' '; // Game is over
}
else if (isFull()) {
jlblStatus.setText(" "+"Draw! The game is over");
whoseTurn = ' '; // Game is over
jlblStatus.setForeground(Color.red);
}
else {
jlblStatus.setHorizontalTextPosition(JLabel.CENTER );
jlblStatus.setVerticalTextPosition(JLabel.CENTER);
whoseTurn = (whoseTurn == 'X') ? 'O': 'X'; // Change the turn
jlblStatus.setText(" "+whoseTurn + "'s turn"); // Display whose turn
}
}
}
}
}
/** This main method enables the applet to run as an application */
public static void main(String[] args) {
// Create a frame
JFrame frame = new JFrame("TicTacToe");
// Create an instance of the applet
TicTacToe applet = new TicTacToe();
// Add the applet instance to the frame
frame.add(applet, BorderLayout.CENTER);
// Display the frame
frame.setSize(300, 300);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOS E);
frame.setVisible(true);
}
}
Who is Trafalgar Law? The Captain and Doctor of the Heart Pirates? a Man with bounty 200.000.000 Beli? Surgeon of Death? No , He is just a Rookie Pirate who know the meaning about "Will of D."
"I told you, I'm waiting for the right time...Dont get rushed, "One Piece" isn't going anywhere...Now, enough talking, Shut up and follow my orders...I'll be sure, To steal the proper throne" - Trafalgar Law
GeGeHaRe One Piece Predictions
New Nakama - Country Of Brigands - Wano Country - X Mark - Fire Sword
Share This Thread