# How am I wrong with this

**URL:** <https://discourse.processing.org/t/how-am-i-wrong-with-this/48083>\
**Category:** Processing\
**Created:** [March 11, 2026, 2:29pm UTC](https://discourse.processing.org/t/how-am-i-wrong-with-this/48083 "2026-03-11T14:29:56Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![cancelbutton](https://avatars.discourse-cdn.com/v4/letter/c/df705f/32.png) [@cancelbutton](https://discourse.processing.org/u/cancelbutton)\
**Post date:** [March 11, 2026, 2:29pm UTC](https://discourse.processing.org/t/how-am-i-wrong-with-this/48083/1 "2026-03-11T14:29:56Z")

</div>

![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/6/d/6de0e6f314e8ee5a98647237df47cc6579c61243.png)

---

<div class="post-metadata">

**Author:** ![quark](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/quark/32/26_2.png) [@quark](https://discourse.processing.org/u/quark)\
**Post date:** [March 11, 2026, 3:12pm UTC](https://discourse.processing.org/t/how-am-i-wrong-with-this/48083/2 "2026-03-11T15:12:44Z")

</div>

Welcome to the forum 😄

It appears to be an issue with Processing rather than your code.

Processing objects to the variable name `open` it also doesn’t like `opens` but I got it to accept `shut` so you could simply use  
`boolean shut = true;`

The door would be open if `shut = false` and you could test this with

```auto
if(!shut){
    // door is open code
}

```

---

<div class="post-metadata">

**Author:** ![quark](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/quark/32/26_2.png) [@quark](https://discourse.processing.org/u/quark)\
**Post date:** [March 11, 2026, 3:29pm UTC](https://discourse.processing.org/t/how-am-i-wrong-with-this/48083/3 "2026-03-11T15:29:09Z")

</div>

Update to last post:

It is definitely a Processing issue as your code is acceptable to Java. I suspect it is being incorrectly being flagged by the pre-processor as early versions of Processing used to have a function (over 10 years ago) called `open` but was replaced by `launch`.

---

<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:** [March 11, 2026, 4:04pm UTC](https://discourse.processing.org/t/how-am-i-wrong-with-this/48083/4 "2026-03-11T16:04:13Z")

</div>

> [@quark](#):
>
> as early versions of Processing used to have a function (over 10 years ago) called `open` but was replaced by `launch`.

> <https://github.com/processing/processing/blob/master/core/src/processing/core/PApplet.java#L3440-L3443>

---

<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:** [March 11, 2026, 4:05pm UTC](https://discourse.processing.org/t/how-am-i-wrong-with-this/48083/5 "2026-03-11T16:05:47Z")

</div>

> [@quark](#):
>
> … it also doesn’t like `opens` but I got it to accept `shut`…

How about?

- `boolean isOpen = false;`
- `if (isOpen) return;`

---

<div class="post-metadata">

**Author:** ![quark](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/quark/32/26_2.png) [@quark](https://discourse.processing.org/u/quark)\
**Post date:** [March 11, 2026, 4:31pm UTC](https://discourse.processing.org/t/how-am-i-wrong-with-this/48083/6 "2026-03-11T16:31:02Z")

</div>

Since you asked there is nothing wrong with using `isOpen` but since it is an attribute of the class `Door` I would prefer to reserve `isOpen` to be a method to interrogate the door state, open or shut. Since Processing doen’t want us to use `open` I envision the class structure to be something like

```auto
class Door{

  boolean shut = true;
   
  void tryOpen(Player p){
    if(!shut) return;
    if(lockType == LOCK_WIRE && p.hasWire) shut = false;
    if(lockType == KEY_CARDE && p.hasKeycard) shut = false;
  }
  
  boolean isOpen() {
    return !shut;
  }

}

```

I should point out this is my preference and is not a criticism of using `isOpen`.

I know I can be a little pedantic when it comes to syntax and semantics 😇 and the OP can choose either approach or something else to avoid the Processing bug. 😀

---

<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:** [March 16, 2026, 4:36pm UTC](https://discourse.processing.org/t/how-am-i-wrong-with-this/48083/7 "2026-03-16T16:36:39Z")

</div>

> [@quark](#):
>
> I know I can be a little pedantic when it comes to syntax and semantics

What you call _pedantic_ is really precision! _Never change._

In coding and technical work, precision and correctness matter because small differences in syntax and semantics can change meaning and behavior.

`:)`
