# How to put a "\>" sign after "==" in an if statement

**URL:** https://discourse.processing.org/t/how-to-put-a-sign-after-in-an-if-statement/37313
**Category:** Beginners
**Created:** [June 3, 2022, 10:38pm UTC](https://discourse.processing.org/t/how-to-put-a-sign-after-in-an-if-statement/37313 "2022-06-03T22:38:15Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![mx.pq](https://avatars.discourse-cdn.com/v4/letter/m/41988e/32.png) [@mx.pq](https://discourse.processing.org/u/mx.pq)
#### Post date: [June 3, 2022, 10:38pm UTC](https://discourse.processing.org/t/how-to-put-a-sign-after-in-an-if-statement/37313/1 "2022-06-03T22:38:15Z")

</div>

Hi, im kind of new to processing and I am working on a starter fighting game and one of the things that I am using to make it so my character can hit the enemy is if statements. I want to type it out like \<  
\<  
if(knightX-monsterX == \>5) {  
reach = “true”;  
}

> 

But this isn’t possible so I was wondering if there are any work arounds or any way to do this.

Thanks

---

<div class="post-metadata">

### Author: ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)
#### Post date: [June 3, 2022, 11:30pm UTC](https://discourse.processing.org/t/how-to-put-a-sign-after-in-an-if-statement/37313/2 "2022-06-03T23:30:46Z")

</div>

Hello @mx.pq,

There are resources here to get you started:

> **[Welcome to Processing!](https://processing.org/)**
>
> Processing is a flexible software sketchbook and a language for learning how to code within the context of the visual arts. Since 2001, Processing has promoted software literacy within the visual arts…

Reference:  
[https://processing.org/reference#control](https://processing.org/reference#control)

`:)`

---

<div class="post-metadata">

### Author: ![Mikey83](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/mikey83/32/17956_2.png) [@Mikey83](https://discourse.processing.org/u/Mikey83)
#### Post date: [June 4, 2022, 1:57am UTC](https://discourse.processing.org/t/how-to-put-a-sign-after-in-an-if-statement/37313/3 "2022-06-04T01:57:36Z")

</div>

The way id do it is

```auto
if(knightX-monsterX >= 5){ // or <= 
   reach = true; //if reach is a boolean "true" if reach is a string
}
```

---

<div class="post-metadata">

### Author: ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)
#### Post date: [June 4, 2022, 5:08am UTC](https://discourse.processing.org/t/how-to-put-a-sign-after-in-an-if-statement/37313/4 "2022-06-04T05:08:15Z")

</div>

> [@mx.pq](#):
>
> But this isn’t possible…

There’s no operator `==>` in Java. It’s just `>=` instead:

> **[\>= (greater than or equal to) / Reference](https://processing.org/reference/greaterthanorequalto.html)**
>
> Tests if the value on the left is larger than the value on the right or if the values are equivalent.

> [@mx.pq](#):
>
> `reach = “true”;`

Also I believe you didn’t mean a [String](https://processing.org/reference/String.html) “true” literal but keyword `true` instead: `reach = true;`

> **[true / Reference](https://processing.org/reference/true.html)**
>
> Reserved word representing the logical value "true". Only variables of type boolean may be assigned the value true.

> [@mx.pq](#):
>
> … so my character can hit the enemy…

You’re gonna need to learn collision detection for it:

- [Collision Detection](http://JeffreyThompson.org/collision-detection/rect-rect.php)
