Jump to content

bitwise operator


duytin

Recommended Posts

Dear All,

 

I want to make a bitwise function but I don't know how to make it.

Suggest that I want to make function my_bitwise($a,$b). I want the result as:

Bits that are set in $a but not $b, and not vice versa.

For example: $a=1010 ; $b=1100

I want result my_bitwise($a,$b)=0010.

Pls hepl me!

Thks in advance!

Link to comment
Share on other sites

Hi boo_lolly,

 

I'm trying to make a program this solve the Sudoku. In this programe, I use the array :

array(pow(2,1),pow(2,2),pow(2,3),pow(2,4),pow(2,5),pow(2,6),pow(2,7),pow(2,8),pow(2,9))

many times in the program. So, I want to make a constant (not a variable!) represent this array. ::)

Link to comment
Share on other sites

Hi boo_lolly,

 

I'm trying to make a program this solve the Sudoku. In this programe, I use the array :

array(pow(2,1),pow(2,2),pow(2,3),pow(2,4),pow(2,5),pow(2,6),pow(2,7),pow(2,8),pow(2,9))

many times in the program. So, I want to make a constant (not a variable!) represent this array. ::)

Link to comment
Share on other sites

Hi All,

 

I want to get an array of data from the input of the user, for example: X11= 1, X12=5, ....,X99=6. I can make with an input apart but I don't know how to make with an array X[j]! :-[

Pls help me! :'(

Link to comment
Share on other sites

For example, I want to write a PHP scrip which will:

1. Display an "0" 9X9 sudoku (default value 0 for all 81 squares).

2. The user will input some data in some squares, for example: square(1,1)=1, square(2,3)=5...

3. Transfer all 81 values of the Sudoku in an array, for example:

    for ($i=1;$i<=9;$i++)

 

Link to comment
Share on other sites

For example, I want to write a PHP scrip which will:

1. Display an "0" 9X9 sudoku (default value 0 for all 81 squares).

2. The user will input some data in some squares, for example: square(1,1)=1, square(2,3)=5...

3. Transfer all 81 values of the Sudoku in an array, for example:

    for ($i=1;$i<=9;$i++)

    {  for ($j=1;$j<=9;$j++)

        {  Sudoku[$i][$j]=square($i,$j);

        }

    }

4. After that, I will write a program to solve the Sudoku.

Link to comment
Share on other sites

the form

<form method='post'>
<?php
for ($r=0; $r<9; $r++) {
    for ($c=0; $c<9; $c++) {
        echo "<input type='text' name='sudoku[$r][$c]' size='3' value='' />";
    }
    echo '<br>';
}
echo "<input type='submit' name='action' value='Submit'>";
?>
</form>

 

Process with

 

$sudoku = $_POST['sudoku'];

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.