# Just i want to show my dart board

**URL:** <https://discourse.processing.org/t/just-i-want-to-show-my-dart-board/16964>\
**Category:** Gallery\
**Created:** [January 8, 2020, 7:08pm UTC](https://discourse.processing.org/t/just-i-want-to-show-my-dart-board/16964 "2020-01-08T19:08:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pisigor](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/pisigor/32/3650_2.png) [@pisigor](https://discourse.processing.org/u/pisigor)\
**Post date:** [January 8, 2020, 7:08pm UTC](https://discourse.processing.org/t/just-i-want-to-show-my-dart-board/16964/1 "2020-01-08T19:08:53Z")

</div>

hi i am new.making it is give me enjoy and maybe someone wants to see it

 ![Ekran Görüntüsü - 2020-01-08 22-07-05](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/a/a46943b3f73ac5ae2840ce25156d146009be3519.png)

```auto
int a=18;
int x,y,de;
boolean c1,c2,c3,c4;
int d1,d2,d3;
boolean d1de,d2de,d3te;
void setup(){
  size(500,500);
  d1=100;
  d2=200;
  d3=300;
}
void draw(){
  background(135);
  translate(250,250);
  line(0,-250,0,250);
  line(-250,0,250,0);
  fill(255);
ellipse(0,0,400,400);
  smooth();
  for(int i=0;i<20;i++){
 pushMatrix();
 rotate(radians(a*i));
 line(0,0,0,200);
 rotate(radians(5));
 fill(0);
 textSize(20);
 text(i+1,0,-180);
 popMatrix();
  }
  noFill();
  ellipse(0,0,d1,d1);
  ellipse(0,0,d2,d2);
  ellipse(0,0,d3,d3); 
  fill(255,0,0);
  ellipse(0,0,20,20);
  fill(0,0,255);
  for(int i=1;i<5;i++){
    text(i,0,(-i*50)+20);}

if( in(d3) ) {
    d3te = true;
   if(in(d2)){
    d2de=true;
    d3te=false;
    if(in(d1)){
    d2de=false;
    d3te=false;
    d1de=true;
  }}}
else {
    d1de=d2de=d3te=false;
  }

if (x<width/2){
  if(y>height/2){
  c3=true; c1=c2=c4=false;
  }else{
  c4=true; c1=c2=c3=false;}
}else {
  if(y>height/2){
  c2=true ; c1=c3=c4=false;
  }else{
  c1=true; c3=c2=c4=false;
}}
  

fill(255);
rect(140,-220,90,50);
fill(0);
textSize(20);
text("dilim:",145,-200); //pie
text("halka:",145,-180); //circle
if(in(400)){
  if(c1){text(ceyrek1(),200,-200);}
  else if(c2){text(ceyrek2(),200,-200);}
  else if(c3){text(ceyrek3(),200,-200);}
  else if(c4){text(ceyrek4(),200,-200);}
if(d3te){
  text("3",205,-180);}
else if(d2de){
  text("2",205,-180);}
else if(d1de){
  text("1",205,-180);}
else {
  text("4",205,-180);}
  if(in(20)){
    fill(255,0,0);
    rect(140,-220,90,50);
    fill(0);
    text("MERKEZ",145,-190); //center
  }
   }
    }

 void mousePressed(){
  x=mouseX;
  y=mouseY;}

int ceyrek1(){
  for(int s=5;s<10;s++){
      if(y-250>tan(radians(a*s))*(x-250)){
     de=s;}}
    return(de-4);}

int ceyrek2(){
  for(int s=0;s<5;s++){
      if(y-250>tan(radians(a*s))*(x-250)){
     de=s;}}
    return(de+6);}

int ceyrek3(){
  for(int s=5;s<10;s++){
      if(y-250<tan(radians(a*s))*(x-250)){
     de=s;}}
    return(de+6);}

int ceyrek4(){
  for(int s=0;s<5;s++){
      if(y-250<tan(radians(a*s))*(x-250)){
     de=s;}}
    return(de+16);}
    
boolean in(int diameter) {
  float disX = 250-x;
  float disY = 250-y;
  if(sqrt(sq(disX) + sq(disY)) < diameter/2 ) {
    return true;
  } else {return false;
  }}

```

---

<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:** [January 9, 2020, 2:36am UTC](https://discourse.processing.org/t/just-i-want-to-show-my-dart-board/16964/2 "2020-01-09T02:36:55Z")

</div>

thank you for show your project and share code, but

please format your code posting by pasting it into the

```auto
</> code button

```

of the editor header menu ( context name: Preformatted text )  
it looks like  
```  
type or paste code here  
```

also can use the ``` manually above and below your code.

thank you.

* * *
