# Multiple keys

**URL:** <https://forum.kirupa.com/t/multiple-keys/228334>\
**Category:** Uncategorized\
**Created:** [June 7, 2007, 12:12am UTC](https://forum.kirupa.com/t/multiple-keys/228334 "2007-06-07T00:12:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hansol](https://avatars.discourse-cdn.com/v4/letter/h/958977/32.png) [@Hansol](https://forum.kirupa.com/u/Hansol)\
**Post date:** [June 7, 2007, 12:12am UTC](https://forum.kirupa.com/t/multiple-keys/228334/1 "2007-06-07T00:12:00Z")

</div>

I have an array like  
mypattern = [0,0,0,0];  
and basically mypattern[0][0] = a, mypattern[0][1] = s and so on, its the keys a,s,d,f. So say i the array was [1,0,1,0] that means a and d would have to be down and your score would go up and the array would change. but how can i do that without having along script, heres what i tried:

```auto
if (mypattern[0][0] == 1 && Key.isDown(keys[0])) {
            score += 100;
            addblock([random(2), random(2), random(2), random(2)]);
        } else if (mypattern[0][0] !== 1 && Key.isDown(keys[3])) {
            score -= 100;
        }
        if (mypattern[0][1] == 1 && Key.isDown(keys[1])) {
            score += 100;
            addblock([random(2), random(2), random(2), random(2)]);
        } else if (mypattern[0][1] !== 1 && Key.isDown(keys[3])) {
            score -= 100;
        }
        if (mypattern[0][2] == 1 && Key.isDown(keys[2])) {
            score += 100;
            addblock([random(2), random(2), random(2), random(2)]);
        } else if (mypattern[0][2] !== 1 && Key.isDown(keys[3])) {
            score -= 100;
        }
        if (mypattern[0][3] == 1 && Key.isDown(keys[3])) {
            score += 100;
            addblock([random(2), random(2), random(2), random(2)]);
        } else if (mypattern[0][3] !== 1 && Key.isDown(keys[3])) {
            score -= 100;
        }

```

and the keys is the ASCII i # of the keys so i wouldnt have to input each one.
