Programming Challenge (Out-of-Date) - Page 15 - Overclock.net

View Poll Results: Are you interested in participating in and/or helping organise and post these programming challenges
I want to participate. 2 100.00%
I want to contribute by helping posting and organise these challenges. 0 0%
I'll only take part if other people are willing to participate. 0 0%
I can help and participate - I love programming! 0 0%
I do not wish to participate or help. 0 0%
Voters: 2. You may not vote on this poll

Forum Jump: 
 
Thread Tools
post #141 of 306 Old 07-28-2010, 09:49 PM
Softwaring
 
xtascox's Avatar
 
Join Date: Jul 2007
Location: Philadelphia, PA
Posts: 1,592
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Liked: 53
Quote:
Originally Posted by cdolphin View Post
Backtracking will present you with every option, are you planning to rank each outcome?
Things could get interesting if you hashed using a node like structure, adding probability to a given outcome based upon the summation of different outcomes possible after making a given move
Minimax theroem anyone?http://en.wikipedia.org/wiki/Minimax...inimax_theorem
Totally doable...
Setup the webserver and I am in...It will likely be Java however, my C++ is not up to scratch >.<
I'll work on something in my free time and post up the API along with the URI's.

Any chance we can make this a 2 week project?
xtascox is offline  
Sponsored Links
Advertisement
 
post #142 of 306 Old 07-28-2010, 09:58 PM
OVER 9000 GIGGLEHERTZ
 
chatch15117's Avatar
 
Join Date: Sep 2009
Location: Orlando, FL
Posts: 5,000
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Liked: 385
I'm ready but I have it in java

Code:

/****************************************************************/
/*                      TicTacToe                            */
/*@author               chatch15117                           */
/****************************************************************/
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
/**
 * Summary description for TicTacToe
 *
 */
public class TicTacToe extends JFrame
{
// Variables declaration
private JLabel jLabel1;
private JLabel jLabel2;
private JLabel jLabel3;
private JButton jButton1;
private JButton jButton2;
private JPanel contentPane;
//-----
private JButton jButton3;
private JButton jButton4;
private JButton jButton5;
private JButton jButton6;
private JButton jButton7;
private JButton jButton8;
private JButton jButton9;
private JButton jButton10;
private JButton jButton11;
private JButton jButton12;
private JButton jButton13;
private JPanel jPanel1;
//-----
// End of variables declaration


public TicTacToe()
{
super();
initializeComponent();

this.setVisible(true);
}

/**
 * This method is called from within the constructor to initialize the form.
 * WARNING: Do NOT modify this code. The content of this method is always regenerated
 * by the Windows Form Designer. Otherwise, retrieving design might not work properly.
 * Tip: If you must revise this method, please backup this GUI file for JFrameBuilder
 * to retrieve your design properly in future, before revising this method.
 */
private void initializeComponent()
{
jLabel1 = new JLabel();
jLabel2 = new JLabel();
jLabel3 = new JLabel();
jButton1 = new JButton();
jButton2 = new JButton();
contentPane = (JPanel)this.getContentPane();
//-----
jButton3 = new JButton();
jButton4 = new JButton();
jButton5 = new JButton();
jButton6 = new JButton();
jButton7 = new JButton();
jButton8 = new JButton();
jButton9 = new JButton();
jButton10 = new JButton();
jButton11 = new JButton();
jButton12 = new JButton();
jButton13 = new JButton();
jPanel1 = new JPanel();
//-----

//
// jLabel1
//
jLabel1.setText("Turn: X");
//
// jLabel2
//
jLabel2.setText("X- Wins: 0");
//
// jLabel3
//
jLabel3.setText("O- Wins: 0");
//
// jButton12
//
jButton12.setText("CPU");
jButton12.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e)
{
jButton12_actionPerformed(e);
}
});
//
// jButton13
//
jButton13.setText("Person");
jButton13.setEnabled(false);
jButton13.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e)
{
jButton13_actionPerformed(e);
}
});
//
// jButton1
//
jButton1.setText("New Game");
jButton1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e)
{
jButton1_actionPerformed(e);
}

});
//
// jButton2
//
jButton2.setText("Reset");
jButton2.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e)
{
jButton2_actionPerformed(e);
}

});
//
// contentPane
//
contentPane.setLayout(null);
addComponent(contentPane, jLabel1, 175,0,60,18);
addComponent(contentPane, jLabel2, 175,15,60,18);
addComponent(contentPane, jLabel3, 175,30,60,18);
addComponent(contentPane, jButton1, 175,45,90,28);
addComponent(contentPane, jButton2, 175,73,90,28);
addComponent(contentPane, jButton12, 175,101,90,28);
addComponent(contentPane, jButton13, 175,130,90,28);
addComponent(contentPane, jPanel1, 2,0,175,175);
//
// jButton3
//
jButton3.setText("");
jButton3.setMaximumSize(new Dimension(50, 50));
jButton3.setMinimumSize(new Dimension(50, 50));
jButton3.setPreferredSize(new Dimension(50, 50));
jButton3.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e)
{
jButton3_actionPerformed(e);
}

});
//
// jButton4
//
jButton4.setText("");
jButton4.setMaximumSize(new Dimension(50, 50));
jButton4.setMinimumSize(new Dimension(50, 50));
jButton4.setPreferredSize(new Dimension(50, 50));
jButton4.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e)
{
jButton4_actionPerformed(e);
}

});
//
// jButton5
//
jButton5.setText("");
jButton5.setMaximumSize(new Dimension(50, 50));
jButton5.setMinimumSize(new Dimension(50, 50));
jButton5.setPreferredSize(new Dimension(50, 50));
jButton5.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e)
{
jButton5_actionPerformed(e);
}

});
//
// jButton6
//
jButton6.setText("");
jButton6.setMaximumSize(new Dimension(50, 50));
jButton6.setMinimumSize(new Dimension(50, 50));
jButton6.setPreferredSize(new Dimension(50, 50));
jButton6.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e)
{
jButton6_actionPerformed(e);
}

});
//
// jButton7
//
jButton7.setText("");
jButton7.setMaximumSize(new Dimension(50, 50));
jButton7.setMinimumSize(new Dimension(50, 50));
jButton7.setPreferredSize(new Dimension(50, 50));
jButton7.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e)
{
jButton7_actionPerformed(e);
}
});
//
// jButton8
//
jButton8.setText("");
jButton8.setMaximumSize(new Dimension(50, 50));
jButton8.setMinimumSize(new Dimension(50, 50));
jButton8.setPreferredSize(new Dimension(50, 50));
jButton8.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e)
{
jButton8_actionPerformed(e);
}
});
//
// jButton9
//
jButton9.setText("");
jButton9.setMaximumSize(new Dimension(50, 50));
jButton9.setMinimumSize(new Dimension(50, 50));
jButton9.setPreferredSize(new Dimension(50, 50));
jButton9.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e)
{
jButton9_actionPerformed(e);
}
});
//
// jButton10
//
jButton10.setText("");
jButton10.setMaximumSize(new Dimension(50, 50));
jButton10.setMinimumSize(new Dimension(50, 50));
jButton10.setPreferredSize(new Dimension(50, 50));
jButton10.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e)
{
jButton10_actionPerformed(e);
}
});
//
// jButton11
//
jButton11.setText("");
jButton11.setMaximumSize(new Dimension(50, 50));
jButton11.setMinimumSize(new Dimension(50, 50));
jButton11.setPreferredSize(new Dimension(50, 50));
jButton11.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e)
{
jButton11_actionPerformed(e);
}
});
//
// jPanel1
//
jPanel1.setLayout(new FlowLayout(FlowLayout.CENTER, 3, 3));
jPanel1.add(jButton3, 0);
jPanel1.add(jButton4, 1);
jPanel1.add(jButton5, 2);
jPanel1.add(jButton6, 3);
jPanel1.add(jButton7, 4);
jPanel1.add(jButton8, 5);
jPanel1.add(jButton9, 6);
jPanel1.add(jButton10, 7);
jPanel1.add(jButton11, 8);
//
// TicTacToe
//
Dimension screensize = Toolkit.getDefaultToolkit().getScreenSize();
this.setTitle("TicTacToe");
this.setLocation(new Point((int)screensize.getWidth() /2 - 138, (int)screensize.getHeight()/2 - 93));
this.setSize(new Dimension(275, 185));
this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
this.setResizable(false);
}

/** Add Component Without a Layout Manager (Absolute Positioning) */
private void addComponent(Container container,Component c,int x,int y,int width,int height)
{
c.setBounds(x,y,width,height);
container.add(c);
}

int turn = 1, xwins = 0, owins = 0;
boolean win = false, cpu = false;
private void jButton1_actionPerformed(ActionEvent e)
{
System.out.println("\
jButton1_actionPerformed(ActionEvent e) called.");
newGame();
}

private void jButton2_actionPerformed(ActionEvent e)
{
System.out.println("\
jButton2_actionPerformed(ActionEvent e) called.");
reset();
}

private void jButton3_actionPerformed(ActionEvent e)
{
System.out.println("\
jButton3_actionPerformed(ActionEvent e) called.");
if (turn == 1)
{
jButton3.setText("X");
jLabel1.setText("Turn: O");
}
else if (turn == -1)
{
jButton3.setText("O");
jLabel1.setText("Turn: X");
}
jButton3.setEnabled(false);
checkWin();
turn *= -1;
if(cpu && !win) playCPU(3);

}

private void jButton4_actionPerformed(ActionEvent e)
{
System.out.println("\
jButton4_actionPerformed(ActionEvent e) called.");
if (turn == 1)
{
jButton4.setText("X");
jLabel1.setText("Turn: O");
}
else if (turn == -1)
{
jButton4.setText("O");
jLabel1.setText("Turn: X");
}
jButton4.setEnabled(false);
checkWin();
turn *= -1;
if(cpu && !win) playCPU(4);
}

private void jButton5_actionPerformed(ActionEvent e)
{
System.out.println("\
jButton5_actionPerformed(ActionEvent e) called.");
if (turn == 1)
{
jButton5.setText("X");
jLabel1.setText("Turn: O");
}
else if (turn == -1)
{
jButton5.setText("O");
jLabel1.setText("Turn: X");
}
jButton5.setEnabled(false);
checkWin();
turn *= -1;
if(cpu && !win) playCPU(5);
}

private void jButton6_actionPerformed(ActionEvent e)
{
System.out.println("\
jButton6_actionPerformed(ActionEvent e) called.");
if (turn == 1)
{
jButton6.setText("X");
jLabel1.setText("Turn: O");
}
else if (turn == -1)
{
jButton6.setText("O");
jLabel1.setText("Turn: X");
}
jButton6.setEnabled(false);
checkWin();
turn *= -1;
if(cpu && !win) playCPU(6);
}

private void jButton7_actionPerformed(ActionEvent e)
{
System.out.println("\
jButton7_actionPerformed(ActionEvent e) called.");
if (turn == 1)
{
jButton7.setText("X");
jLabel1.setText("Turn: O");
}
else if (turn == -1)
{
jButton7.setText("O");
jLabel1.setText("Turn: X");
}
jButton7.setEnabled(false);
checkWin();
turn *= -1;
if(cpu && !win) playCPU(7);
}

private void jButton8_actionPerformed(ActionEvent e)
{
System.out.println("\
jButton8_actionPerformed(ActionEvent e) called.");
if (turn == 1)
{
jButton8.setText("X");
jLabel1.setText("Turn: O");
}
else if (turn == -1)
{
jButton8.setText("O");
jLabel1.setText("Turn: X");
}
jButton8.setEnabled(false);
checkWin();
turn *= -1;
if(cpu && !win) playCPU(8);
}

private void jButton9_actionPerformed(ActionEvent e)
{
System.out.println("\
jButton9_actionPerformed(ActionEvent e) called.");
if (turn == 1)
{
jButton9.setText("X");
jLabel1.setText("Turn: O");
}
else if (turn == -1)
{
jButton9.setText("O");
jLabel1.setText("Turn: X");
}
jButton9.setEnabled(false);
checkWin();
turn *= -1;
if(cpu && !win) playCPU(9);
}

private void jButton10_actionPerformed(ActionEvent e)
{
System.out.println("\
jButton10_actionPerformed(ActionEvent e) called.");
if (turn == 1)
{
jButton10.setText("X");
jLabel1.setText("Turn: O");
}
else if (turn == -1)
{
jButton10.setText("O");
jLabel1.setText("Turn: X");
}
jButton10.setEnabled(false);
checkWin();
turn *= -1;
if(cpu && !win) playCPU(10);
}

private void jButton11_actionPerformed(ActionEvent e)
{
System.out.println("\
jButton11_actionPerformed(ActionEvent e) called.");
if (turn == 1)
{
jButton11.setText("X");
jLabel1.setText("Turn: O");
}
else if (turn == -1)
{
jButton11.setText("O");
jLabel1.setText("Turn: X");
}
jButton11.setEnabled(false);
checkWin();
turn *= -1;
if(cpu && !win) playCPU(11);
}

private void jButton12_actionPerformed(ActionEvent e)
{
jButton12.setEnabled(false);
jButton13.setEnabled(true);
cpu = true;
}

private void jButton13_actionPerformed(ActionEvent e)
{
jButton12.setEnabled(true);
jButton13.setEnabled(false);
cpu = false;
}

private void checkWin()
{
if( jButton3.getText() == jButton4.getText() && jButton4.getText() == jButton5.getText() && jButton3.getText() != ""){
win = true;
}
else if(jButton6.getText() == jButton7.getText() && jButton7.getText() == jButton8.getText() && jButton6.getText() != ""){
win = true;
}
else if(jButton9.getText() == jButton10.getText() && jButton10.getText() == jButton11.getText() && jButton9.getText() != ""){
win = true;
}

//virticle wins
else if(jButton3.getText() == jButton6.getText() && jButton6.getText() == jButton9.getText() && jButton3.getText() != ""){
win = true;
}
else if(jButton4.getText() == jButton7.getText() && jButton7.getText() == jButton10.getText() && jButton4.getText() != ""){
win = true;
}
else if(jButton5.getText() == jButton8.getText() && jButton8.getText() == jButton11.getText() && jButton5.getText() != ""){
win = true;
}

//diagonal wins
else if(jButton3.getText() == jButton7.getText() && jButton7.getText() == jButton11.getText() && jButton3.getText() != ""){
win = true;
}
else if(jButton5.getText() == jButton7.getText() && jButton7.getText() == jButton9.getText() && jButton5.getText() != ""){
win = true;
}
else {
win = false;
}
if (win && turn == 1) 
{
JOptionPane.showMessageDialog(null, "X Wins!!");
xwins++;
}
if (win && turn == -1)
{
JOptionPane.showMessageDialog(null, "O Wins!!");
owins++;
}
if (win)
{
jButton3.setEnabled(false);
jButton4.setEnabled(false);
jButton5.setEnabled(false);
jButton6.setEnabled(false);
jButton7.setEnabled(false);
jButton8.setEnabled(false);
jButton9.setEnabled(false);
jButton10.setEnabled(false);
jButton11.setEnabled(false);
}
}

private void newGame()
{
jButton3.setEnabled(true);
jButton4.setEnabled(true);
jButton5.setEnabled(true);
jButton6.setEnabled(true);
jButton7.setEnabled(true);
jButton8.setEnabled(true);
jButton9.setEnabled(true);
jButton10.setEnabled(true);
jButton11.setEnabled(true);

jButton3.setText("");
jButton4.setText("");
jButton5.setText("");
jButton6.setText("");
jButton7.setText("");
jButton8.setText("");
jButton9.setText("");
jButton10.setText("");
jButton11.setText("");

jLabel2.setText("X- Wins: " + xwins);
jLabel3.setText("O- Wins: " + owins);

}

private void reset()
{
xwins = 0;
owins = 0;
newGame();
}

private void playCPU(int i)
{
if (i == 3)
{
if (jButton5.getText() == "") cpu5();
else if (jButton3.getText() == "") cpu3();
else if (jButton7.getText() == "") cpu7();
else if (jButton9.getText() == "") cpu9();
else if (jButton11.getText() == "") cpu11();
else if (jButton4.getText() == "") cpu4();
else if (jButton8.getText() == "") cpu8();
else if (jButton6.getText() == "") cpu6();
else if (jButton10.getText() == "") cpu10();
}
if (i == 4)
{
if (jButton7.getText() == "") cpu7();
else if (jButton10.getText() == "") cpu10();
else if (jButton5.getText() == "") cpu5();
else if (jButton9.getText() == "") cpu9();
else if (jButton11.getText() == "") cpu11();
else if (jButton3.getText() == "") cpu3();
else if (jButton8.getText() == "") cpu8();
else if (jButton6.getText() == "") cpu6();
else if (jButton4.getText() == "") cpu4();
}
if (i == 5)
{
if (jButton7.getText() == "") cpu7();
else if (jButton3.getText() == "") cpu3();
else if (jButton5.getText() == "") cpu5();
else if (jButton9.getText() == "") cpu9();
else if (jButton11.getText() == "") cpu11();
else if (jButton4.getText() == "") cpu4();
else if (jButton8.getText() == "") cpu8();
else if (jButton6.getText() == "") cpu6();
else if (jButton10.getText() == "") cpu10();
}
if (i == 6)
{
if (jButton9.getText() == "") cpu9();
else if (jButton8.getText() == "") cpu8();
else if (jButton5.getText() == "") cpu5();
else if (jButton7.getText() == "") cpu7();
else if (jButton11.getText() == "") cpu11();
else if (jButton4.getText() == "") cpu4();
else if (jButton3.getText() == "") cpu3();
else if (jButton6.getText() == "") cpu6();
else if (jButton10.getText() == "") cpu10();
}
if (i == 7)
{
if (jButton7.getText() == "") cpu7();
else if (jButton3.getText() == "") cpu3();
else if (jButton5.getText() == "") cpu5();
else if (jButton9.getText() == "") cpu9();
else if (jButton11.getText() == "") cpu11();
else if (jButton8.getText() == "") cpu8();
else if (jButton4.getText() == "") cpu4();
else if (jButton6.getText() == "") cpu6();
else if (jButton10.getText() == "") cpu10();
}
if (i == 8)
{
if (jButton7.getText() == "") cpu7();
else if (jButton6.getText() == "") cpu6();
else if (jButton5.getText() == "") cpu5();
else if (jButton11.getText() == "") cpu11();
else if (jButton9.getText() == "") cpu9();
else if (jButton4.getText() == "") cpu4();
else if (jButton8.getText() == "") cpu8();
else if (jButton3.getText() == "") cpu3();
else if (jButton10.getText() == "") cpu10();
}
if (i == 9)
{
if (jButton7.getText() == "") cpu7();
else if (jButton3.getText() == "") cpu3();
else if (jButton5.getText() == "") cpu5();
else if (jButton9.getText() == "") cpu9();
else if (jButton11.getText() == "") cpu11();
else if (jButton8.getText() == "") cpu8();
else if (jButton6.getText() == "") cpu6();
else if (jButton4.getText() == "") cpu4();
else if (jButton10.getText() == "") cpu10();
}
if (i == 10)
{
if (jButton7.getText() == "") cpu7();
else if (jButton4.getText() == "") cpu4();
else if (jButton5.getText() == "") cpu5();
else if (jButton9.getText() == "") cpu9();
else if (jButton11.getText() == "") cpu11();
else if (jButton3.getText() == "") cpu3();
else if (jButton8.getText() == "") cpu8();
else if (jButton6.getText() == "") cpu6();
else if (jButton10.getText() == "") cpu10();
}
if (i == 11)
{
if (jButton3.getText() == "") cpu3();
else if (jButton5.getText() == "") cpu5();
else if (jButton9.getText() == "") cpu9();
else if (jButton7.getText() == "") cpu7();
else if (jButton11.getText() == "") cpu11();
else if (jButton4.getText() == "") cpu4();
else if (jButton8.getText() == "") cpu8();
else if (jButton6.getText() == "") cpu6();
else if (jButton10.getText() == "") cpu10();
}

}

private void cpu3()
{
System.out.println("\
jButton3_actionPerformed(ActionEvent e) called.");
if (turn == 1)
{
jButton3.setText("X");
jLabel1.setText("Turn: O");
}
else if (turn == -1)
{
jButton3.setText("O");
jLabel1.setText("Turn: X");
}
jButton3.setEnabled(false);
checkWin();
turn *= -1;
}

private void cpu4()
{
System.out.println("\
jButton4_actionPerformed(ActionEvent e) called.");
if (turn == 1)
{
jButton4.setText("X");
jLabel1.setText("Turn: O");
}
else if (turn == -1)
{
jButton4.setText("O");
jLabel1.setText("Turn: X");
}
jButton4.setEnabled(false);
checkWin();
turn *= -1;
}

private void cpu5()
{
System.out.println("\
jButton5_actionPerformed(ActionEvent e) called.");
if (turn == 1)
{
jButton5.setText("X");
jLabel1.setText("Turn: O");
}
else if (turn == -1)
{
jButton5.setText("O");
jLabel1.setText("Turn: X");
}
jButton5.setEnabled(false);
checkWin();
turn *= -1;
}

private void cpu6()
{
System.out.println("\
jButton6_actionPerformed(ActionEvent e) called.");
if (turn == 1)
{
jButton6.setText("X");
jLabel1.setText("Turn: O");
}
else if (turn == -1)
{
jButton6.setText("O");
jLabel1.setText("Turn: X");
}
jButton6.setEnabled(false);
checkWin();
turn *= -1;
}

private void cpu7()
{
System.out.println("\
jButton7_actionPerformed(ActionEvent e) called.");
if (turn == 1)
{
jButton7.setText("X");
jLabel1.setText("Turn: O");
}
else if (turn == -1)
{
jButton7.setText("O");
jLabel1.setText("Turn: X");
}
jButton7.setEnabled(false);
checkWin();
turn *= -1;
}

private void cpu8()
{
System.out.println("\
jButton8_actionPerformed(ActionEvent e) called.");
if (turn == 1)
{
jButton8.setText("X");
jLabel1.setText("Turn: O");
}
else if (turn == -1)
{
jButton8.setText("O");
jLabel1.setText("Turn: X");
}
jButton8.setEnabled(false);
checkWin();
turn *= -1;
}

private void cpu9()
{
System.out.println("\
jButton9_actionPerformed(ActionEvent e) called.");
if (turn == 1)
{
jButton9.setText("X");
jLabel1.setText("Turn: O");
}
else if (turn == -1)
{
jButton9.setText("O");
jLabel1.setText("Turn: X");
}
jButton9.setEnabled(false);
checkWin();
turn *= -1;
}

private void cpu10()
{
System.out.println("\
jButton10_actionPerformed(ActionEvent e) called.");
if (turn == 1)
{
jButton10.setText("X");
jLabel1.setText("Turn: O");
}
else if (turn == -1)
{
jButton10.setText("O");
jLabel1.setText("Turn: X");
}
jButton10.setEnabled(false);
checkWin();
turn *= -1;
}

private void cpu11()
{
System.out.println("\
jButton11_actionPerformed(ActionEvent e) called.");
if (turn == 1)
{
jButton11.setText("X");
jLabel1.setText("Turn: O");
}
else if (turn == -1)
{
jButton11.setText("O");
jLabel1.setText("Turn: X");
}
jButton11.setEnabled(false);
checkWin();
turn *= -1;
}
 
public static void main(String[] args)
{
JFrame.setDefaultLookAndFeelDecorated(true);
JDialog.setDefaultLookAndFeelDecorated(true);
try
{
UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
}
catch (Exception ex)
{
System.out.println("Failed loading L&F: ");
System.out.println(ex);
}
new TicTacToe();
}
//= End of Testing =


}
doesn't even use backtracking... so simple

two weeks for this???

chatch15117 is offline  
post #143 of 306 Old 07-28-2010, 10:06 PM
Softwaring
 
xtascox's Avatar
 
Join Date: Jul 2007
Location: Philadelphia, PA
Posts: 1,592
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Liked: 53
Quote:
Originally Posted by chatch15117 View Post
I'm ready but I have it in java
I was referring to developing the server and making the clients interact with it so we can pit algorithm against algorithm.
xtascox is offline  
Sponsored Links
Advertisement
 
post #144 of 306 Old 07-28-2010, 11:32 PM
Where's my retired staff logo....
 
dangerousHobo's Avatar
 
Join Date: Dec 2005
Location: Los Angeles
Posts: 3,590
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Liked: 433
My first go at it in C++.
I'll do the AI tomorrow night, and maybe a Gtk gui if I have the time.

"UNIX was never designed to keep people from doing stupid things, because that policy would also keep them from doing clever things." - Doug Gwyn


"Beware of idiots working for Red Hat, for a single such obnoxious moron can *cough* up the wider Linux software ecosystem." - Alan Cox (Alan's new OS -> FUZIX OS)

dangerousHobo is offline  
post #145 of 306 Old 07-29-2010, 09:13 AM
1.7ghz
 
Midpipps's Avatar
 
Join Date: Jul 2008
Posts: 333
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Liked: 39
Quote:
Originally Posted by xtascox View Post
I'll work on something in my free time and post up the API along with the URI's.

Any chance we can make this a 2 week project?
I think we could push the Versus out to 2 weeks. To give us time to work out all the details and then run it. I think I will post another challenge next week but leave the Versus at 2 weeks that way if someone wants to take time on it then they can. I will hit you up on steam tonight to see what I can help with on the API and such. Might be worth it to make a sample class in a couple of other languages to hit your API.

check out the latest programming challenge New challenges posted every Wednesday


Chimp Challenge Participant 

Midpipps is offline  
post #146 of 306 Old 07-29-2010, 09:19 AM
Softwaring
 
xtascox's Avatar
 
Join Date: Jul 2007
Location: Philadelphia, PA
Posts: 1,592
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Liked: 53
Quote:
Originally Posted by Midpipps View Post
I think we could push the Versus out to 2 weeks. To give us time to work out all the details and then run it. I think I will post another challenge next week but leave the Versus at 2 weeks that way if someone wants to take time on it then they can. I will hit you up on steam tonight to see what I can help with on the API and such. Might be worth it to make a sample class in a couple of other languages to hit your API.
I probably won't be on until Sunday as I'm going to be out of town. I'll pm you my e-mail address and we can communicate on there until I get back.
xtascox is offline  
post #147 of 306 Old 07-29-2010, 09:34 AM
1.7ghz
 
Midpipps's Avatar
 
Join Date: Jul 2008
Posts: 333
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Liked: 39
Quote:
Originally Posted by chatch15117 View Post
I'm ready but I have it in java

Code:
snip for length
doesn't even use backtracking... so simple

two weeks for this???
I like it but I beat the computer every time

Quote:
Originally Posted by dangerousHobo View Post
My first go at it in C++.
I'll do the AI tomorrow night, and maybe a Gtk gui if I have the time.
this one was good too let see the AI

check out the latest programming challenge New challenges posted every Wednesday


Chimp Challenge Participant 

Midpipps is offline  
post #148 of 306 Old 07-29-2010, 08:23 PM
Where's my retired staff logo....
 
dangerousHobo's Avatar
 
Join Date: Dec 2005
Location: Los Angeles
Posts: 3,590
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Liked: 433
Quote:
Originally Posted by Midpipps View Post
this one was good too let see the AI
Thanks, but I decided not to write one, who ever goes first can always win, the game is just to simple to make writing an AI worth while. If we do another game though I'll do it. I miss doing this type of competitions, did may of them in my AI course a few years back.

"UNIX was never designed to keep people from doing stupid things, because that policy would also keep them from doing clever things." - Doug Gwyn


"Beware of idiots working for Red Hat, for a single such obnoxious moron can *cough* up the wider Linux software ecosystem." - Alan Cox (Alan's new OS -> FUZIX OS)

dangerousHobo is offline  
post #149 of 306 Old 07-30-2010, 06:12 PM
GameCack
 
GodofGrunts's Avatar
 
Join Date: Nov 2007
Location: Hamilton, Ohio
Posts: 4,616
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Liked: 254
Quote:
Originally Posted by dangerousHobo View Post
My first go at it in C++.
I'll do the AI tomorrow night, and maybe a Gtk gui if I have the time.
OMG YOU'RE BACK.

I missed you. :

Quote:
Originally Posted by MrDeodorant go_quote.gif
Oh, and the mayonnaise fanboys come out. Go back to your cave, troll. 2mm of mayonnaise is all anyone really needs. You don't have the ketchup bandwidth to support any more.

L2Sammich, noob. Besides, I'm running a Miracle Whip distro.

GodofGrunts is offline  
post #150 of 306 Old 07-30-2010, 10:23 PM
Softwaring
 
xtascox's Avatar
 
Join Date: Jul 2007
Location: Philadelphia, PA
Posts: 1,592
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Liked: 53
Quote:
Originally Posted by dangerousHobo View Post
Thanks, but I decided not to write one, who ever goes first can always win, the game is just to simple to make writing an AI worth while. If we do another game though I'll do it. I miss doing this type of competitions, did may of them in my AI course a few years back.
How about AI that works for a grid of size n?
xtascox is offline  
Closed Thread

Quick Reply

Thread Tools
Show Printable Version Show Printable Version
Email this Page Email this Page


Forum Jump: 

Posting Rules  
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off