pft..teacher who?
Type: Posts; User: Jumgle
pft..teacher who?
Perform a random binary test that passes with the given probability. If the test passes, then set x=probability * x .
So for ex: if you have set of 10 numbers, half of them will give a binary...
can you check if this is correct?
void random(double probability)
{
int i,a[RAND_MAX],n=-1,r,c,x;
for(i=0;i<RAND_MAX;i++)
{
n++;
a[i]=random()%RAND_MAX;
...
I'm stuck on this problem: Perform a random binary test that passes with the given probability. If the test passes, then set x=probability * x.
I know how to generate a random number using rand()...
Actually, i want to store info about different types of gird kind of like a board say if i want to implement a chess board with current state of the board, next state of the board etc. and store that...
/*fill a m x n grid with 0 or 1 */
I'm trying to return a pointer to the cell on the grid but I'm not getting the correct output..please help me figure out what I'm doing wrong.
typedef enum
{
...