# Why do my X/O's not show in my tictactoe game

**URL:** <https://discourse.processing.org/t/why-do-my-x-os-not-show-in-my-tictactoe-game/8244>\
**Category:** Libraries\
**Created:** [February 9, 2019, 11:50am UTC](https://discourse.processing.org/t/why-do-my-x-os-not-show-in-my-tictactoe-game/8244 "2019-02-09T11:50:36Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![MQXO](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/mqxo/32/3613_2.png) [@MQXO](https://discourse.processing.org/u/MQXO)\
**Post date:** [February 9, 2019, 11:50am UTC](https://discourse.processing.org/t/why-do-my-x-os-not-show-in-my-tictactoe-game/8244/1 "2019-02-09T11:50:36Z")

</div>

hi, I was working on updating my code for my tictactoe, I’m only a beginner and thought this would be a good place to start, the game used to work, but when I added the minim library and set up a song to play in the background, all hell came loose. The version you have here is one where i disabled all elements of minim, whether it was enabled or disabled, it would still do 2 things, when I clicked, it would not produce X/O or print in the console and when it was enabled no song would play. The size of the canvas is the same as the XOB (XO board)

```auto
/*import ddf.minim.*;
import ddf.minim.analysis.*;
import ddf.minim.effects.*;
import ddf.minim.signals.*;
import ddf.minim.spi.*;
import ddf.minim.ugens.*;

import ddf.minim.*;
Minim minim;
AudioPlayer player;*/

PImage X;
PImage O;
PImage XOB;

boolean Xb = true;
boolean Ob = false; 

void setup() { 
 size(800,600);
 X = loadImage("X.png");
 O = loadImage("O.png");
 XOB = loadImage("XOB.png");
 image(XOB,0,0);
/* minim = new Minim(this);
 player = minim.loadFile("RetroVision.mp3", 1000);
 player.play();
 player.loop();*/
}

void mousePressed() {
  if (Xb == true) {image(X,mouseX,mouseY,120,120); Xb = false; Ob = true; println("X");}
else if (Ob == true) {image(O,mouseX,mouseY,120,120); Ob = false; Xb = true; println("O");}
}

void keyPressed() {
if (key == 'r' || key == 'R') {background(255); image(XOB,0,0);}
/*else if (player.isPlaying() && key == 'p' || key == 'P') {player.pause(); };
if (key == 'o') {player.play();}*/
}

```

please dont go too hard on me if it is obvious as I am not experienced in processing

---

<div class="post-metadata">

**Author:** ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)\
**Post date:** [February 9, 2019, 12:28pm UTC](https://discourse.processing.org/t/why-do-my-x-os-not-show-in-my-tictactoe-game/8244/2 "2019-02-09T12:28:03Z")

</div>

what happened with

```auto
void draw() {
  // ???
}

```

keyboard, mouse and minim need that i think.

---

<div class="post-metadata">

**Author:** ![MQXO](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/mqxo/32/3613_2.png) [@MQXO](https://discourse.processing.org/u/MQXO)\
**Post date:** [February 9, 2019, 5:09pm UTC](https://discourse.processing.org/t/why-do-my-x-os-not-show-in-my-tictactoe-game/8244/3 "2019-02-09T17:09:46Z")

</div>

nah i wasnt using void draw at all

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [February 9, 2019, 5:14pm UTC](https://discourse.processing.org/t/why-do-my-x-os-not-show-in-my-tictactoe-game/8244/4 "2019-02-09T17:14:55Z")

</div>

If you want an interactive sketch – including keyboard / mouse events, audio events, etc – then you need `draw()` – even if it is empty. You can confirm @kll’s advice by testing:

Does nothing:

```auto
//void draw() {
//}
void mouseMoved() {
  rect(mouseX, mouseY, 10, 10);
}

```

Does something:

```auto
void draw() {
}
void mouseMoved() {
  rect(mouseX, mouseY, 10, 10);
}

```

From the overview:

> A program written as a list of statements (like the previous examples) is called a _static_ sketch. In a static sketch, a series of functions are used to perform tasks or create a single image without any animation or interaction. Interactive programs are drawn as a series of frames, which you can create by adding functions titled `setup()` and `draw()` as shown in the code below. These are built-in functions that are called automatically. [Processing Overview / Processing.org](https://processing.org/tutorials/overview/)

---

<div class="post-metadata">

**Author:** ![MQXO](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/mqxo/32/3613_2.png) [@MQXO](https://discourse.processing.org/u/MQXO)\
**Post date:** [February 9, 2019, 7:21pm UTC](https://discourse.processing.org/t/why-do-my-x-os-not-show-in-my-tictactoe-game/8244/5 "2019-02-09T19:21:26Z")

</div>

Thank you, as a beginner I was not aware of this

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [February 9, 2019, 7:30pm UTC](https://discourse.processing.org/t/why-do-my-x-os-not-show-in-my-tictactoe-game/8244/6 "2019-02-09T19:30:01Z")

</div>

Glad it is helpful. Follow up in this thread if you have any more questions about your sketch in progress, and good luck!
