# Making 4 on the row game

**URL:** <https://forum.kirupa.com/t/making-4-on-the-row-game/177483>\
**Category:** Uncategorized\
**Created:** [February 2, 2006, 9:50am UTC](https://forum.kirupa.com/t/making-4-on-the-row-game/177483 "2006-02-02T09:50:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![manga](https://avatars.discourse-cdn.com/v4/letter/m/6bbea6/32.png) [@manga](https://forum.kirupa.com/u/manga)\
**Post date:** [February 2, 2006, 9:50am UTC](https://forum.kirupa.com/t/making-4-on-the-row-game/177483/1 "2006-02-02T09:50:32Z")

</div>

hey all,

just a quick question… i made a game 4 on the row…

that has a array(🙂 that contains all possible winning matches…

but… that is the easy way…

i made a once a game tictac… (you know with the X and 0)  
i defines every element from:

1, 2, 4,  
8, 16, 32,  
64,128, 256

arWin=[7,13,146,292,448,84,273,56,73];

/\*  
1, 2, 4,  
8, 16, 32,  
64,128, 256  
\*/  
function setList(){  
forms=document.game;  
ar=[];  
Count=0;  
status=0;  
for(x=1;x\<10;x++){  
if(forms[“vlak”+x].checked==true){  
ar[ar.length]=forms[“vlak”+x].value;  
Count+=Math.abs(forms[“vlak”+x].value);  
status=Count;  
}  
}  
for(i=0;i\<arWin.length;i++){

if((Count & arWin\*) == arWin\*){  
alert(arWin\*)  
}  
}  
}

this makes a simple tictactoe game but i want to make a 4 on a row…  
but i have errors because he gives me a winnar while i dont have a winning e combination… any ideas for a gameengine ?

4 on a row has 7 x 6 rows
