isnt rms 0.707ie sine of 45 degrees
Type: Posts; User: cooper1200
isnt rms 0.707ie sine of 45 degrees
because the condition above evaluates to true
so that condition isn't tested
there is a big difference between
if ( x == 1 )
do something
if ( x == 2 )
do something
if .......
Is it possible that as Salem said the first string isn't terminated so the first while loop is operating on both strings?? IE the second string is right after the first one in memory so effectively...
sorry you answered whilst i was posting my drivel and put it a lot more succinctly
what happens if you do printf("%p\n", y) then printf("%p\n", y[1]) are the results different?
i think the answer is that strings are effectively arrays so each character is stored at a separate...
what is this line saying
else if ( PossNum[Row][Column][Digit] != PossNum[Row][Column + 1][Digit] && PossNum[Row][Column][Digit] != PossNum[Row][Column + 2][Digit] )
i want it to evaluate...
what possible numbers do you get after running my code for row 6 column 7 and row 6 column 9 before passing it through locked numbers i have 2, 3, 4 and 6 for Column 7 and 3,4 and 6 for column 9.
...
i have the following possible values for column 7
row 1 = 1--4----9
row 2 = 1-------9
row 3 = ----5--89
row 4 = -2---6-8-
row 5 = --34-6--9
row 6 = -----6---
therefore row 6 column 7 must be...
ummm row 6 column 7 can only be a 6 same with column 9 this is why you got the wrong answer with my code
i was going to do something along the lines of
while (NumcellsSolved < 81 )
{
int x = NumcellsSolved;
NumcellsSolved += NakedSingles( PossibleNums, Solution );
...
this is the issue my locked numbers doesn't work with puzzle 1 just using locked numbers once after the while loop produces this
12-----8- --3-----9 123----89 --------- --3----8- ---------...
perhaps all this will be clearer with an example
1 - - 9 2 - - - -
5 2 4 - 1 7 - - 9
- - - - - - 2 7 1
- 5 - - - 8 1 - 2
- - - 1 - 2 - - -
4...
the for loop im trying to get out of is the digit one which is the inner most one
sorry your right it should be [code]printf("number of solved cells is %d\n", NumcellsSolved);[\code]
i know this doesn't work as i get 2 naked singles that are the same on row 5
the premises is that if i have 2 2's on the same row and in the same region then there cant be any other 2's in that...
here is the full program again as i changed some function names and edited main to include the new function
#include <stdio.h>
#include <stdlib.h>
void RemovePossNum(int, int, int, int...
if i have the following
for ( int i = 0; i < 5; i++){
if ( i == 3) break;
some code here
}
the for loop will break when i = 3 rather than when i = 5 and the following code wont...
Wow thank you.
There are still lots of rules to factor in. like pairs of possibles or triples etc etc
does the ifdef have to be in the same file as main or could i add a file and have lots of...
it would help i think if the hidden singles function starting on line 187 searched the regions as well like i do on line 153 for naked singles
it solved the first one but not the second. all my program does is look for naked singles (cells that have only one possible number) and hidden singles numbers that only appear once in a row or...
solved it kind of..... got the row an column to work just cant get region to work but as what i have solves it i guess there is no need
int HiddenSingles( int PossNum[][9][9], int Solved[][9] )...
i have changed the above code to this
#include <stdio.h>
#include <stdlib.h>
void RemovePossNum(int, int, int, int [][9][9] );
void GetRegion( int, int, int *, int * );
void...
ok after 24 hours i have managed to get it to find the "naked singles"
#include <stdio.h>
#include <stdlib.h>
void RemovePossNum(int, int, int, int [][9][9] );
void GetReigon( int, int, int...
im still trying to solve it just seem to be going round in circles