# Someone change this code but make it stay the same

**URL:** https://discourse.processing.org/t/someone-change-this-code-but-make-it-stay-the-same/26026
**Category:** Coding Questions
**Created:** [December 7, 2020, 11:55pm UTC](https://discourse.processing.org/t/someone-change-this-code-but-make-it-stay-the-same/26026 "2020-12-07T23:55:29Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![Mohammed](https://avatars.discourse-cdn.com/v4/letter/m/13edae/32.png) [@Mohammed](https://discourse.processing.org/u/Mohammed)
#### Post date: [December 7, 2020, 11:55pm UTC](https://discourse.processing.org/t/someone-change-this-code-but-make-it-stay-the-same/26026/1 "2020-12-07T23:55:29Z")

</div>

> please format code with \</\> button \* [homework policy](https://discourse.processing.org/faq/#homework) \* [asking questions](https://discourse.processing.org/t/2147)

int radius = 12;  
int direction = 1;  
int direction2 = 0;

float x = 250;  
float y = 250;

void setup() {  
size(500, 500);  
ellipseMode(RADIUS);  
}

void draw() {  
background(255);  
fill (230, 230, 0);  
smooth ();  
noStroke();  
render();

}

void keyPressed() {  
if (key == CODED) {  
if (keyCode == LEFT) {  
x = x - 10;  
direction = -1;  
direction2 = 0;  
}  
else if (keyCode == RIGHT) {  
x = x + 10;  
direction = 1;  
direction2 = 0;  
}  
else if (keyCode == UP) {  
y = y - 10;  
direction = 0;  
direction2 = -1;  
}  
else if (keyCode == DOWN) {  
y = y + 10;  
direction = 0;  
direction2 = 1;  
}  
}  
}

void render() {  
for ( int i=-1; i \< 2; i++) {  
for ( int j=-1; j \< 2; j++) {  
pushMatrix();  
translate(x + (i \* width), y + (j\*height));  
if ( direction == -1) {  
rotate(PI);  
}  
if ( direction2 == 1) {  
rotate(HALF\_PI);  
}  
if ( direction2 == -1) {  
rotate( PI + HALF\_PI );  
}  
arc(0, 0, radius, radius, map((millis() 500), 0, 500, 0, 0.52), map((millis() 500), 0, 500, TWO\_PI, 5.76) );  
popMatrix();  
// mouth movement //  
}  
}  
}

---

<div class="post-metadata">

### Author: ![TfGuy44](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/tfguy44/32/41_2.png) [@TfGuy44](https://discourse.processing.org/u/TfGuy44)
#### Post date: [December 8, 2020, 1:43am UTC](https://discourse.processing.org/t/someone-change-this-code-but-make-it-stay-the-same/26026/2 "2020-12-08T01:43:49Z")

</div>

Hey, that looks familiar!

> **[College project help - PACMAN!! - Processing Forum](https://forum.processing.org/one/topic/college-project-help-pacman.html)**

How do you expect the code to change but also be the same? If it changes, wouldn’t it be different?

---

<div class="post-metadata">

### Author: ![TfGuy44](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/tfguy44/32/41_2.png) [@TfGuy44](https://discourse.processing.org/u/TfGuy44)
#### Post date: [December 8, 2020, 2:05am UTC](https://discourse.processing.org/t/someone-change-this-code-but-make-it-stay-the-same/26026/3 "2020-12-08T02:05:57Z")

</div>

```auto
static final int[] kcs={LEFT,RIGHT,UP,DOWN};float x=250,y=250;
static final int[] dxs={-1,1,0,0};static final int[] dys={0,0,-1,1};
static final float[] drs={PI,0,-HALF_PI,HALF_PI};int d=1,r=12;
void setup(){size(500,500);ellipseMode(RADIUS);noStroke();fill(230,230,0);}
void draw(){background(0);x+=dxs[d];y+=dys[d];translate(x,y);rotate(drs[d]);
arc(0,0,r,r,map((millis()%500),0,500,0,0.52),map((millis()%500),0,500,TWO_PI,5.76)
);}void keyPressed(){for(int i=0;i<4;i++){if(key==CODED&&keyCode==kcs[i]){d=i;}}}

```

There you go. It’s different, but the same. And better. Or worse? I can’t tell.

No one is sure what you want because you really didn’t tell us what you wanted.

---

<div class="post-metadata">

### Author: ![Mohammed](https://avatars.discourse-cdn.com/v4/letter/m/13edae/32.png) [@Mohammed](https://discourse.processing.org/u/Mohammed)
#### Post date: [December 8, 2020, 5:59pm UTC](https://discourse.processing.org/t/someone-change-this-code-but-make-it-stay-the-same/26026/4 "2020-12-08T17:59:34Z")

</div>

Hey can you make me a game which you have made the can be moved with arrows and has a game over please

---

<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: [December 8, 2020, 6:09pm UTC](https://discourse.processing.org/t/someone-change-this-code-but-make-it-stay-the-same/26026/5 "2020-12-08T18:09:44Z")

</div>

Yes I could - but I am not going to

Do your own homework 😞

---

<div class="post-metadata">

### Author: ![Mohammed](https://avatars.discourse-cdn.com/v4/letter/m/13edae/32.png) [@Mohammed](https://discourse.processing.org/u/Mohammed)
#### Post date: [December 8, 2020, 6:24pm UTC](https://discourse.processing.org/t/someone-change-this-code-but-make-it-stay-the-same/26026/6 "2020-12-08T18:24:57Z")

</div>

Please mate I can’t do it

---

<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: [December 8, 2020, 6:42pm UTC](https://discourse.processing.org/t/someone-change-this-code-but-make-it-stay-the-same/26026/7 "2020-12-08T18:42:26Z")

</div>

That’s tough but doesn’t explain why I should help you cheat through plagiarism.

Perhaps you should be more studious and try harder.

---

<div class="post-metadata">

### Author: ![TheGullible1](https://avatars.discourse-cdn.com/v4/letter/t/7bcc69/32.png) [@TheGullible1](https://discourse.processing.org/u/TheGullible1)
#### Post date: [December 8, 2020, 9:54pm UTC](https://discourse.processing.org/t/someone-change-this-code-but-make-it-stay-the-same/26026/8 "2020-12-08T21:54:52Z")

</div>

making other people do your homework is just dumb, how are you learning from this. You should try to do the homework yourself first and then we all can help you. without you not doing anything and expecting us to do everything for you; is ludicrous.

---

<div class="post-metadata">

### Author: ![Mohammed](https://avatars.discourse-cdn.com/v4/letter/m/13edae/32.png) [@Mohammed](https://discourse.processing.org/u/Mohammed)
#### Post date: [December 8, 2020, 10:34pm UTC](https://discourse.processing.org/t/someone-change-this-code-but-make-it-stay-the-same/26026/9 "2020-12-08T22:34:21Z")

</div>

Hi I’m sorry if I made it look that way but I’ve made my own game and just wanted to see how someone else has done it differently.  
I would honestly not cheat I am just doing this for fun sorry to made it have seem if I was cheating.

---

<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: [December 9, 2020, 9:30am UTC](https://discourse.processing.org/t/someone-change-this-code-but-make-it-stay-the-same/26026/10 "2020-12-09T09:30:54Z")

</div>

In your first post you present someone else’s code and ask for someone to modify it so its origin is masked.

When that didn’t work you asked for someone to write the program for you.

> [@Mohammed](#):
>
> Hey can you make me a game which you have made the can be moved with arrows and has a game over please

When challenged you said

> [@Mohammed](#):
>
> Please mate I can’t do it

Now you say that you have created a program but you want to see how someone else would do it differently.

> [@Mohammed](#):
>
> Hi I’m sorry if I made it look that way but I’ve made my own game and just wanted to see how someone else has done it differently.

You really expect me to believe that !!! - you must think I am an idiot.

Prove me wrong - post _ **your code** _ here and be prepared to answer detailed questions about it.

---

<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: [December 9, 2020, 10:43am UTC](https://discourse.processing.org/t/someone-change-this-code-but-make-it-stay-the-same/26026/11 "2020-12-09T10:43:50Z")

</div>

You can be that someone!

All the resources (tutorials, examples, references, books, etc.) you need are here:

> **[Processing.org](https://processing.org/)**

You should work through the tutorials and examples and start writing your own code.

Also look for “Coding Train” videos on YouTube.

`:)`
