Can you assist me with canceling my cc subscription
can you assist me with canceling my cc subscription?
I'm confused. You suggest that all that is needed is to go to Cancel Your Membership or Subscription Creative Cloud. It doesn't work that simply.
I have attempted to cancel many times and I am sent to Customer Service where it is impossible to contact anyone for assistance.
I have wanted to change the date that my payment was made. I called in mid February and it was explained that all I needed to do was cancel my account then subscribe once again on the date I want my payment withdrawn. The gentleman I spoke with told me on account of my cancel-resubscribe" I would not be charged the penalty for canceling before the end of my one year contract.
When I have attempted to speak with someone once again today I have found it impossible to find a number I can call.
I understand that I need to be on the Adobe CC to take care of this, but I have been there all morning with no success.
I DID note that it appears I have an account with the payment date I am trying to change. If I were to open an account today, todays date would be my payment date. I don't know what else to do and can not figure out how I was able to contact someone last month.
Similar Messages
-
HT5312 Can you assist me with my forgotten security questions answers ?
Can you help me retrieve my security questions ?
Alternatives for Help Resetting Security Questions and/or Rescue Mail
1. If you have a valid rescue email address, then use this procedure:
Rescue email address and how to reset Apple ID security questions.
2. Fill out and submit this form. Select the topic, Account Security. You must
have a Rescue Email to use this option.
3. This is the only option if you do not already have a valid Rescue Email.
These are telephone numbers for contacting Apple Support in your country.
Apple ID- Contacting Apple for help with Apple ID account security. Select
the appropriate country and call. Ask to speak to the Account Security Team.
Note: If you have already forgotten your security questions, then you cannot
set up a rescue email address in order to reset them. You must set up
the rescue email address beforehand.
Your Apple ID: Manage My Apple ID.
Apple ID- All about Apple ID security questions. -
Where are the settings to merge data (calendar and contacts) when syncing phone to pc?
Hello Mary,
It is definitely inconvenient when your contacts are not syning over correctly. If you are using iTunes to sync Outlook to your iPhone, I recommend the following article to troubleshoot the issue:
iPhone, iPad, iPod touch: Troubleshooting contact and calendar syncing via USB on Windows
http://support.apple.com/kb/HT1692
Thank you for using Apple Support Communities.
Best,
Sheila M. -
Last night, I upgraded to the news Thunderbird version 31. When I try to send a signed message, I get the error written in the subject line and my message arrives without the electronic signature.
Can you assist me with this problem that I did not have before upgrading?
Thank you
CeciliaHa! You hit the jackpot! I do have Enigmail 1.6. Will download 1.7 and the latest of Thunderbird again.
Thank you for your support.
Regards,
Cecilia -
Can you assist me with locating where several hundred of songs were purchased on an older computer and are not showing as purchases on this new one?
Copy them from yoru old computer (or the most recent backup of that computer) to your new computer.
-
When i try to download 'Get album artwork' I receive error alert with (-609) I have tried to download the artwork on the advanced tab, but still no success. My computer runs Windows 7 and the alert appears in my itunes which on my computer.Can you assist?
Perhaps try the "Error -609" section in the Specific Conditions and Alert Messages: (Mac OS X / Windows) section of the following document:
iTunes: Advanced iTunes Store troubleshooting -
My ipod is disabled and the message requests to try again in 223004 minutes. I think it might have something to do with the date being set wrong before it went into disabled mode. Can you assist in enabling.
You'll need to connect it to the iTunes library you normally sync it with and restore it. If iTunes asks you for this passcode before it will let you proceed, connect the iPod to iTunes in recovery mode instead using the instructions in this Apple support document.
iOS: Unable to update or restore
B-rock -
HT201269 Good evening. Need to sync computer music with Iphone. Can you assist?
Would like to sync saved music on Dell laptop to IPhone. Can you assist.
iTunes: Syncing media content to iOS devices and iPod - http://support.apple.com/kb/HT1351 - detailed example: https://discussions.apple.com/message/18860187
-
I am unable to complete Synching with my IPhone 4S as it tells me reason is that Apps are unable to be determined on my phone however all of them Purchased from I Tunes. Can someone assist me with a Solution
You can't merge accounts. But you can check your purchase history:
iTunes Store & Mac App Store: Seeing your purchase history and order numbers
http://support.apple.com/kb/HT2727
Also, what may seem stupid to you... may be a protection of privacy to others. -
I have a licensed copy of Adobe Acrobat X Pro for Windows. I recently switched over to MAC OS and would like to move my Adobe X Pro over but the CD will not work for Mac OS? Can anyone assist me with this conversion?
Best,
James.you cannot use your pc license to install on a mac. you would need a separate license (and serial number) for that.
adobe allows platform swaps, but only with the latest (xi) version, Order product | Platform, language swap
your option to use acrobat on a mac are to upgrade to acrobat pro xi and change platforms, use a windows emulator (parallels/boot camp etc) on your mac or swap with a third party. -
Good morning, I am having difficulty syncing my iPhone, iPad and Macbook calendar. Can you assist me?
Well now that we are all correct ... I am having the same problem (s)
My ipad 2 will not sync with icloud calendars.
iCloud on iPad shows:
correct iCloud account
Contacts and Calendars are turned on
1.8 gig avaialable in free icloud starage
iCloud backup turned on
my last iCloud back up was finished just minutes ago
go to ipad calendar app and only show one calendar ... Birthdays, which I have NO IDEA where that cam from.
The is a PLUS in the upper right, it is greyed out and no functional
I see Calendars as a "menu" item at the bottom of the screen, but can only edit my birthday calendar.
I see no way to add icloud calendars to my ipad calendars and everything seems to be set up.
Please help -
I am trying to synch my iPhone to my new MacBook Pro but I am told that I am only allowed 5 devices for synching. Unfortunately I am up to 6 because one of my computer's died from a hard drive disease. So I am actually only wanting to synch with 5 devices. Can you assist? Thank you.
I am using OS10.8.2Thanks snozdop for your help but there is a problem. With deauthorising the instruction says "Also, make sure you deauthorize your computer before you upgrade your RAM, hard disk or other system components, or reinstall Windows. If you do not deauthorize your computer before you upgrade these components, one computer may use multiple authorizations." I did not / could not deauthorise before upgrading from my broken hard drive. Thus I remain unsure how to proceed.
-
Can you assist me in reinstalling acrobat 8?
Can you assist me in re-installing acrobat 8?
Acrobat 8 is not supported on windows 7 but you can give it a try ... Please See the system requirements for Acrobat 8 :
Adobe Acrobat 8 Pro on Windows
Acrobat 8 Pro on Windows has the following system requirements:
Intel Pentium III processor or equivalent
Microsoft Windows 2000 with Service Pack 4; Windows Server 2003 (32-bit or 64-bit editions) with Service Pack 1; Windows XP Professional, Home, Tablet PC, or 64-bit Editions with Service Pack 2; or Windows Vista Home Basic, Home Premium, Ultimate, Business, or Enterprise (32-bit or 64-bit editions)
Microsoft Internet Explorer 6 or 7
256 MB of RAM (512 MB recommended)
860 MB of available hard-disk space; cache for optional installation files (recommended) requires an additional 460 MB of available hard-disk space
1,024 x 768 screen resolution
CD-ROM drive, if installing from a CD
Internet or phone connection required for product activation -
Hello, we have both Creative Cloud membership and Creative Cloud for team. Can you help me with the difference and if i need to have both? We have 9 employees that are using it. Just not sure if i'm paying for something i don't need.
Thank youPlease refer to Creative Cloud Help | Creative Cloud / Common Questions
CC is for retail use with 20 GB of storage space, CCT is where number of seats are purchased & assigned by one program admin where each seat gets 100GB of storage space.
You can not have both the CC & team in one account as it will only provide you added storage space of 120 GB but you can activate the CC any of them or either of them twice as CC is based on Adobe ID.
Regards
Rajshree -
Can you help me with mouse pressed method please?
hi
can you help me with my problem please, player label doesn't show up in the applet and the draw string method it doesn't draw any strings like X or O for the game I don't know what is the problem maybe it is with MousePressed method which is in Board class. I tried to write the code of the location many times I'm not sure if the problem comes from there.
there is no error in my code, but it doesn't work.
this is class Board which has the mouseListener
class Board extends JPanel implements MouseListener, MouseMotionListener
private JLabel playerlabel;
private boolean play;
private boolean start;
private int turn;
private Square squares[][];
private Player myplayer[][];
public Board()
setBackground( Color.WHITE );
playerlabel = new JLabel( "X player first" );
//playerlabel.setLayout(null);
// playerlabel.setLocation(500,500);
add( playerlabel );
play = true;
turn = 1;
squares = new Square[3][3];
myplayer = new Player[3][3];
int x = 40;
int y = 40;
for (int i=0; i<3; i++){
x = 40;
for (int j=0; j<3; j++){
Square s = new Square( x,y );
squares[i][j] = s;
x +=50;
y +=50;
this.addMouseListener(this);
this.addMouseMotionListener(this);
public void mouseClicked( MouseEvent event ){}
public void mouseMoved( MouseEvent event ){}
public void mouseEntered( MouseEvent event ){}
public void mouseExited( MouseEvent event ){}
public void mousePressed( MouseEvent event )
{int xPos = event.getX();
int yPos = event.getY();
if(play && turn ==1){
for (int i=0; i<3; i++){
for (int j=0; j<3; j++){
int x = squares[i][j].getX();
int y = squares[i][j].getY();
if(xPos> x && xPos<x+40&& yPos> y && yPos<y+40){
if( squares[i][j].getOccupied() ==0 ){
String ptext;
ptext = "X";
Player p = new Player(x, y,ptext);
myplayer[i][j] = p;
squares[i][j].setOccupied(1);
playerlabel.setText( "O Player Turn" );
turn = 2;
repaint();
Win();
else{
turn = 2;
playerlabel.setText( "O Player Turn" );
repaint();
if ( play && turn ==2 )
for (int i=0; i<3; i++){
for (int j=0; j<3; j++){
int x = squares[i][j].getX();
int y = squares[i][j].getY();
if(xPos> x && xPos<x+40&& yPos> y && yPos<y+40){
if( squares[i][j].getOccupied() ==0 ){
String ptext;
ptext = "O";
Player p = new Player(x, y,ptext);
myplayer[i][j] = p;
squares[i][j].setOccupied(2);
playerlabel.setText( "X Player Turn" );
turn = 1;
repaint();
Win();
else{
turn = 1;
playerlabel.setText( "X Player Turn" );
repaint();
public void mouseReleased( MouseEvent event )
public void mouseDragged( MouseEvent event )
public void Win(){
if(squares[0][0].getOccupied() == squares[0][1].getOccupied() &&squares[0][1].getOccupied()==squares[0][2].getOccupied() &&squares[0][2].getOccupied() == 1)
{playerlabel.setText("Player 1 X WON THE GAME!");
play =false; }
else if (squares[1][0].getOccupied() == squares[1][1].getOccupied() &&squares[1][1].getOccupied()==squares[1][2].getOccupied() &&squares[1][2].getOccupied() == 1)
{playerlabel.setText("Player 1 X WON THE GAME!");
play =false; }
else if(squares[2][0].getOccupied() == squares[2][1].getOccupied() &&squares[2][1].getOccupied()==squares[2][2].getOccupied() &&squares[2][2].getOccupied() == 1)
{playerlabel.setText("Player 1 X WON THE GAME!");
play =false; }
if(squares[0][0].getOccupied() == squares[0][1].getOccupied() &&squares[0][1].getOccupied()==squares[0][2].getOccupied() &&squares[0][2].getOccupied() == 2)
{playerlabel.setText("Player 2 O WON THE GAME!");
play =false; }
else if (squares[1][0].getOccupied() == squares[1][1].getOccupied() &&squares[1][1].getOccupied()==squares[1][2].getOccupied() &&squares[1][2].getOccupied() == 2)
{playerlabel.setText("Player 2 O WON THE GAME!");
play =false; }
else if(squares[2][0].getOccupied() == squares[2][1].getOccupied() &&squares[2][1].getOccupied()==squares[2][2].getOccupied() &&squares[2][2].getOccupied() == 2)
{playerlabel.setText("Player 2 O WON THE GAME!");
play =false; }
//Vertically win
if (squares[0][0].getOccupied() == squares[1][0].getOccupied() &&squares[1][0].getOccupied()==squares[2][0].getOccupied() &&squares[2][0].getOccupied() == 1)
{playerlabel.setText("Player 1 X WON THE GAME!");
play =false; }
else if (squares[0][1].getOccupied() == squares[1][1].getOccupied() &&squares[1][1].getOccupied()==squares[2][1].getOccupied() &&squares[2][1].getOccupied() == 1)
{playerlabel.setText("Player 1 X WON THE GAME!");
play =false; }
else if(squares[0][2].getOccupied() == squares[1][2].getOccupied() &&squares[1][2].getOccupied()==squares[2][2].getOccupied() &&squares[2][2].getOccupied() == 1)
{playerlabel.setText("Player 1 X WON THE GAME!");
play =false; }
if (squares[0][0].getOccupied() == squares[1][0].getOccupied() &&squares[1][0].getOccupied()==squares[2][0].getOccupied() &&squares[2][0].getOccupied() == 2)
{playerlabel.setText("Player 2 O WON THE GAME!");
play =false; }
else if (squares[0][1].getOccupied() == squares[1][1].getOccupied() &&squares[1][1].getOccupied()==squares[2][1].getOccupied() &&squares[2][1].getOccupied() == 2)
{playerlabel.setText("Player 2 O WON THE GAME!");
play =false; }
else if(squares[0][2].getOccupied() == squares[1][2].getOccupied() &&squares[1][2].getOccupied()==squares[2][2].getOccupied() &&squares[2][2].getOccupied() == 2)
{playerlabel.setText("Player 2 O WON THE GAME!");
play =false; }
//Diagonal win
if (squares[0][0].getOccupied() == squares[1][1].getOccupied() &&squares[1][1].getOccupied()==squares[2][2].getOccupied() &&squares[2][2].getOccupied() == 1)
{playerlabel.setText("Player 1 X WON THE GAME!");
play =false; }
else if (squares[0][2].getOccupied() == squares[1][1].getOccupied() &&squares[1][1].getOccupied()==squares[2][0].getOccupied() &&squares[2][0].getOccupied() == 1)
{playerlabel.setText("Player 1 X WON THE GAME!");
play =false; }
if (squares[0][0].getOccupied() == squares[1][1].getOccupied() &&squares[1][1].getOccupied()==squares[2][2].getOccupied() &&squares[2][2].getOccupied() == 2)
{playerlabel.setText("Player 2 O WON THE GAME!");
play =false; }
else if (squares[0][2].getOccupied() == squares[1][1].getOccupied() &&squares[1][1].getOccupied()==squares[2][0].getOccupied() &&squares[2][0].getOccupied() == 2)
{playerlabel.setText("Player 2 O WON THE GAME!");
play =false; }
}//end win
public void setTurn(int t)
turn = t;
playerlabel.setText( "X Player Plays First" );
public void paintComponent( Graphics g )
super.paintComponent( g );
this.setBackground( Color.WHITE );
for (int i=0; i<3; i++){
for (int j=0; j<3; j++){
g.setColor( Color.BLACK );
g.drawRect( squares[i][j].getX(), squares[i][j].getY(), 50, 50 );
for (int i=0; i<3; i++){
for (int j=0; j<3; j++){
myplayer[i][j].draw(g);
//End of paintComponent
}and this is the whole code of my program.
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.util.*;
class Player{
private int xCoordinate;
private int yCoordinate;
private String playerText;
public Player(int x, int y, String t)
playerText = t;
xCoordinate = x;
yCoordinate = y;
public void draw(Graphics g)
g.drawString(playerText, xCoordinate, yCoordinate);
public void SetText(String t)
{ playerText = t;
}//end player
class Square
private int x;
private int y;
private int occupied;
public Square(int x1, int y1)
x = x1;
y= y1;
occupied = 0;
public void setX(int x1)
x = x1;
public int getX()
return x;
public void setY(int y1)
y = y1;
public int getY()
return y;
public void setOccupied(int o)
occupied = o;
public int getOccupied()
return occupied;
public class TicTac extends JApplet implements ActionListener
{ private JPanel panel;
private JButton newgame;
private Board B;
public void init()
B = new Board();
add( B, BorderLayout.CENTER );
panel = new JPanel();
newgame = new JButton( "New Game" );
panel.add( newgame);
add( panel, BorderLayout.SOUTH );
newgame.addActionListener(this);
public void actionPerformed( ActionEvent ev)
{ Object source = ev.getSource();
if (source == newgame)
{remove(B);
repaint();
B = new Board();
add( B, BorderLayout.CENTER );
B.setTurn(1);
repaint();
validate();
}//end class TicTac
class Board extends JPanel implements MouseListener, MouseMotionListener
private JLabel playerlabel;
private boolean play;
private boolean start;
private int turn;
private Square squares[][];
private Player myplayer[][];
public Board()
setBackground( Color.WHITE );
playerlabel = new JLabel( "X player first" );
//playerlabel.setLayout(null);
// playerlabel.setLocation(500,500);
add( playerlabel );
play = true;
turn = 1;
squares = new Square[3][3];
myplayer = new Player[3][3];
int x = 40;
int y = 40;
for (int i=0; i<3; i++){
x = 40;
for (int j=0; j<3; j++){
Square s = new Square( x,y );
squares[i][j] = s;
x +=50;
y +=50;
this.addMouseListener(this);
this.addMouseMotionListener(this);
public void mouseClicked( MouseEvent event ){}
public void mouseMoved( MouseEvent event ){}
public void mouseEntered( MouseEvent event ){}
public void mouseExited( MouseEvent event ){}
public void mousePressed( MouseEvent event )
{int xPos = event.getX();
int yPos = event.getY();
if(play && turn ==1){
for (int i=0; i<3; i++){
for (int j=0; j<3; j++){
int x = squares[i][j].getX();
int y = squares[i][j].getY();
if(xPos> x && xPos<x+40&& yPos> y && yPos<y+40){
if( squares[i][j].getOccupied() ==0 ){
String ptext;
ptext = "X";
Player p = new Player(x, y,ptext);
myplayer[i][j] = p;
squares[i][j].setOccupied(1);
playerlabel.setText( "O Player Turn" );
turn = 2;
repaint();
Win();
else{
turn = 2;
playerlabel.setText( "O Player Turn" );
repaint();
if ( play && turn ==2 )
for (int i=0; i<3; i++){
for (int j=0; j<3; j++){
int x = squares[i][j].getX();
int y = squares[i][j].getY();
if(xPos> x && xPos<x+40&& yPos> y && yPos<y+40){
if( squares[i][j].getOccupied() ==0 ){
String ptext;
ptext = "O";
Player p = new Player(x, y,ptext);
myplayer[i][j] = p;
squares[i][j].setOccupied(2);
playerlabel.setText( "X Player Turn" );
turn = 1;
repaint();
Win();
else{
turn = 1;
playerlabel.setText( "X Player Turn" );
repaint();
public void mouseReleased( MouseEvent event )
public void mouseDragged( MouseEvent event )
public void Win(){
if(squares[0][0].getOccupied() == squares[0][1].getOccupied() &&squares[0][1].getOccupied()==squares[0][2].getOccupied() &&squares[0][2].getOccupied() == 1)
{playerlabel.setText("Player 1 X WON THE GAME!");
play =false; }
else if (squares[1][0].getOccupied() == squares[1][1].getOccupied() &&squares[1][1].getOccupied()==squares[1][2].getOccupied() &&squares[1][2].getOccupied() == 1)
{playerlabel.setText("Player 1 X WON THE GAME!");
play =false; }
else if(squares[2][0].getOccupied() == squares[2][1].getOccupied() &&squares[2][1].getOccupied()==squares[2][2].getOccupied() &&squares[2][2].getOccupied() == 1)
{playerlabel.setText("Player 1 X WON THE GAME!");
play =false; }
if(squares[0][0].getOccupied() == squares[0][1].getOccupied() &&squares[0][1].getOccupied()==squares[0][2].getOccupied() &&squares[0][2].getOccupied() == 2)
{playerlabel.setText("Player 2 O WON THE GAME!");
play =false; }
else if (squares[1][0].getOccupied() == squares[1][1].getOccupied() &&squares[1][1].getOccupied()==squares[1][2].getOccupied() &&squares[1][2].getOccupied() == 2)
{playerlabel.setText("Player 2 O WON THE GAME!");
play =false; }
else if(squares[2][0].getOccupied() == squares[2][1].getOccupied() &&squares[2][1].getOccupied()==squares[2][2].getOccupied() &&squares[2][2].getOccupied() == 2)
{playerlabel.setText("Player 2 O WON THE GAME!");
play =false; }
//Vertically win
if (squares[0][0].getOccupied() == squares[1][0].getOccupied() &&squares[1][0].getOccupied()==squares[2][0].getOccupied() &&squares[2][0].getOccupied() == 1)
{playerlabel.setText("Player 1 X WON THE GAME!");
play =false; }
else if (squares[0][1].getOccupied() == squares[1][1].getOccupied() &&squares[1][1].getOccupied()==squares[2][1].getOccupied() &&squares[2][1].getOccupied() == 1)
{playerlabel.setText("Player 1 X WON THE GAME!");
play =false; }
else if(squares[0][2].getOccupied() == squares[1][2].getOccupied() &&squares[1][2].getOccupied()==squares[2][2].getOccupied() &&squares[2][2].getOccupied() == 1)
{playerlabel.setText("Player 1 X WON THE GAME!");
play =false; }
if (squares[0][0].getOccupied() == squares[1][0].getOccupied() &&squares[1][0].getOccupied()==squares[2][0].getOccupied() &&squares[2][0].getOccupied() == 2)
{playerlabel.setText("Player 2 O WON THE GAME!");
play =false; }
else if (squares[0][1].getOccupied() == squares[1][1].getOccupied() &&squares[1][1].getOccupied()==squares[2][1].getOccupied() &&squares[2][1].getOccupied() == 2)
{playerlabel.setText("Player 2 O WON THE GAME!");
play =false; }
else if(squares[0][2].getOccupied() == squares[1][2].getOccupied() &&squares[1][2].getOccupied()==squares[2][2].getOccupied() &&squares[2][2].getOccupied() == 2)
{playerlabel.setText("Player 2 O WON THE GAME!");
play =false; }
//Diagonal win
if (squares[0][0].getOccupied() == squares[1][1].getOccupied() &&squares[1][1].getOccupied()==squares[2][2].getOccupied() &&squares[2][2].getOccupied() == 1)
{playerlabel.setText("Player 1 X WON THE GAME!");
play =false; }
else if (squares[0][2].getOccupied() == squares[1][1].getOccupied() &&squares[1][1].getOccupied()==squares[2][0].getOccupied() &&squares[2][0].getOccupied() == 1)
{playerlabel.setText("Player 1 X WON THE GAME!");
play =false; }
if (squares[0][0].getOccupied() == squares[1][1].getOccupied() &&squares[1][1].getOccupied()==squares[2][2].getOccupied() &&squares[2][2].getOccupied() == 2)
{playerlabel.setText("Player 2 O WON THE GAME!");
play =false; }
else if (squares[0][2].getOccupied() == squares[1][1].getOccupied() &&squares[1][1].getOccupied()==squares[2][0].getOccupied() &&squares[2][0].getOccupied() == 2)
{playerlabel.setText("Player 2 O WON THE GAME!");
play =false; }
}//end win
public void setTurn(int t)
turn = t;
playerlabel.setText( "X Player Plays First" );
public void paintComponent( Graphics g )
super.paintComponent( g );
this.setBackground( Color.WHITE );
for (int i=0; i<3; i++){
for (int j=0; j<3; j++){
g.setColor( Color.BLACK );
g.drawRect( squares[i][j].getX(), squares[i][j].getY(), 50, 50 );
for (int i=0; i<3; i++){
for (int j=0; j<3; j++){
myplayer[i][j].draw(g);
//End of paintComponent
Edited by: mshadows on May 18, 2008 7:53 AMI was playing with this a little bit and came up with this game model, something that I'm sure can be improved upon greatly:
TttXO.java
an enum to encapsulate X vs O. I could use a boolean here since it has 2 states, but this seems more intuitive to me
package dy08.m05.ttt;
* tic tac toe encapsulation of X vs O
* @author Pete
public enum TttXO
X, O
}TttCell.java
encapsulates an individual cell in the tictactoe grid.
package dy08.m05.ttt;
* Tic Tac Toe Game cell
* can be occupied or not
* can hold TttXO X or O or null
* @author Pete
public class TttCell
private boolean occupied = false;
private TttXO xo = null;
public TttCell()
* sets a Square for either x or o
* @param TttXO
* @return true if successful, false if already occupied
public boolean setXO(TttXO xo)
if (occupied)
return false;
else
occupied = true;
this.xo = xo;
return true;
public void reset()
occupied = false;
xo = null;
public boolean isOccupied()
return occupied;
public TttXO getXO()
return xo;
// used to test and debug the class
public String toString()
if (occupied)
return xo.toString();
else
return "-";
package dy08.m05.ttt;
* Tic Tac Toe game model
* @author Pete
public class TttGameModel
private TttCell[][] cellGrid = new TttCell[3][3];
private boolean xTurn = true;
private boolean win = false;
public TttGameModel()
for (int i = 0; i < cellGrid.length; i++)
for (int j = 0; j < cellGrid.length; j++)
cellGrid[i][j] = new TttCell();
public void reset()
xTurn = true;
win = false;
for (int i = 0; i < cellGrid.length; i++)
for (int j = 0; j < cellGrid[i].length; j++)
cellGrid[i][j].reset();
public boolean isXTurn()
return xTurn;
public boolean isWin()
return win;
* @param row
* @param col
* @return true if valid move, false if game already over or cell occupied
public boolean takeTurn(int col, int row)
TttXO currentXO = TttXO.O;
TttCell cell = cellGrid[row][col];
if (win)
return false;
if (cell.isOccupied())
return false;
if (xTurn)
currentXO = TttXO.X;
cell.setXO(currentXO);
win = checkWin(col, row, currentXO);
xTurn = !xTurn; // toggle xturn
return true;
public boolean checkWin(int col, int row, TttXO xo)
boolean win = false;
// first rows and columns
boolean temp = true;
for (int i = 0; i < 3; i++)
temp &= cellGrid[row][i].getXO() == xo;
win |= temp;
temp = true;
for (int i = 0; i < 3; i++)
temp &= cellGrid[i][col].getXO() == xo;
win |= temp;
if (row == col) // if slash diagonal
temp = true;
for (int i = 0; i < 3; i++)
temp &= cellGrid[i][i].getXO() == xo;
win |= temp;
if (row + col == 2) // if backslash diagonal
temp = true;
for (int i = 0; i < 3; i++)
temp &= cellGrid[i][2 - i].getXO() == xo;
win |= temp;
return win;
// used to test and debug the class
public String toString()
StringBuilder sb = new StringBuilder();
for (int i = 0; i < cellGrid.length; i++)
for (int j = 0; j < cellGrid[i].length; j++)
sb.append(cellGrid[i][j] + " ");
sb.append("\n");
if (win)
sb.append("win! Game over");
else
sb.append("No winner yet");
return sb.toString();
// test the class
public static void main(String[] args)
TttGameModel model = new TttGameModel();
checkMove(model, 0, 0);
checkMove(model, 1, 0);
checkMove(model, 1, 1);
checkMove(model, 2, 0);
checkMove(model, 1, 0); // bad move
checkMove(model, 2, 2);
// to test the class
private static void checkMove(TttGameModel model, int i, int j)
System.out.println("OK move: " + model.takeTurn(i, j));
System.out.println(model + "\n");
Maybe you are looking for
-
What are the infotypes required for maintaining benefits....
Hi Please help ... What are the ingotypes required for maintaing benefits....
-
Handling Events in CMSDK webapplication
Hi frns, I am handling events(create Directory,delete directory, move Folder,upload document etc.)and forward it(that a folder had been created,a file had been deleted etc.)to all the users who are currently logged on webapplication. To do that I hav
-
Hi !!! Someone knows what's the bapi that i can use as alternative by the transaction FB70 ( Customer Invoice ). Best Regards !!!
-
When I underline something in e-mail, it does not show up when I send the e-mail out. Why? How do I get it to work?
-
i recebtly bought an app (FIFA 12) now every time i play a match after the match it does not save an just goes to the home page without warning and i have to start all over again and no i did not press the home button. plz help