Note that there are some explanatory texts on larger screens.

plurals
  1. POCheck if an array can be put in another array
    primarykey
    data
    text
    <p>I am working on a PHP script to create an arduino "Tetris Clock". I would like to generate a sequence of blocks tetris to display a number.</p> <p>My number array (example with "0") : (formated for display)</p> <pre><code>1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 0 0 1 1 1 1 0 0 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 </code></pre> <p>Where :</p> <pre><code>1 = must be filled 0 = empty 2 = informed (after check if block can be put) </code></pre> <p>Now I have tetris block array, like that :</p> <pre><code>0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 </code></pre> <p>OR</p> <pre><code>1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 </code></pre> <p>and I want to check if I can <strong>put my tetris block in number array</strong>.</p> <p>eg. : after placing the first block I would get the following array : (it's a "T" block)</p> <pre><code>1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 0 0 1 1 1 1 0 0 1 1 1 1 0 0 1 1 1 2 1 1 1 1 2 2 2 1 1 1 </code></pre> <p>At first I tried cutting tables in rows and columns to see if it corresponds with my block and I made ​​many changes without success.</p> <p>You can see my two test scripts : <a href="http://pastebin.com/znnmvT4g" rel="nofollow">http://pastebin.com/znnmvT4g</a> and <a href="http://pastebin.com/D9h51Xw3" rel="nofollow">http://pastebin.com/D9h51Xw3</a></p> <p>I will keep the historical additions to use backtracking in case of error or failure to resolve the number.</p> <p>I would therefore firstly check if my blocka rray can be added to my number array.</p> <p>Thank you for your ideas !</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload