Discussion about math, puzzles, games and fun. Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ ¹ ² ³ °
 

You are not logged in. #26 20111001 20:47:42
Re: Another programming problem!!!Hi; In mathematics, you don't understand things. You just get used to them. I have the result, but I do not yet know how to get it. All physicists, and a good many quite respectable mathematicians are contemptuous about proof. #27 20111001 20:49:31
Re: Another programming problem!!!yes,but it takes so long! The limit operator is just an excuse for doing something you know you can't. “It's the subject that nobody knows anything about that we can all talk about!” ― Richard Feynman “Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment #28 20111001 20:54:42
Re: Another programming problem!!!Hi anonimnystefy; In mathematics, you don't understand things. You just get used to them. I have the result, but I do not yet know how to get it. All physicists, and a good many quite respectable mathematicians are contemptuous about proof. #29 20111001 21:24:47
Re: Another programming problem!!!but,do you know why the program won't go to the next line? The limit operator is just an excuse for doing something you know you can't. “It's the subject that nobody knows anything about that we can all talk about!” ― Richard Feynman “Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment #30 20111001 21:29:48
Re: Another programming problem!!!Hi; In mathematics, you don't understand things. You just get used to them. I have the result, but I do not yet know how to get it. All physicists, and a good many quite respectable mathematicians are contemptuous about proof. #31 20111001 21:35:57
Re: Another programming problem!!!checked the loops,seem okay. The limit operator is just an excuse for doing something you know you can't. “It's the subject that nobody knows anything about that we can all talk about!” ― Richard Feynman “Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment #32 20111001 21:40:58
Re: Another programming problem!!!Just a term. A recursive program is one that calls itself. You must make sure you have a base case so that the recursion stops, else it will exhaust all your memory, crash or go on forever. In mathematics, you don't understand things. You just get used to them. I have the result, but I do not yet know how to get it. All physicists, and a good many quite respectable mathematicians are contemptuous about proof. #33 20111001 21:48:08
Re: Another programming problem!!!well do you think it is correct? The limit operator is just an excuse for doing something you know you can't. “It's the subject that nobody knows anything about that we can all talk about!” ― Richard Feynman “Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment #34 20111001 21:54:32
Re: Another programming problem!!!There is definitely an error somewhere. But you will not make much progress just by looking at it. That can help clean up syntax errors but the compiler usually spots them. In mathematics, you don't understand things. You just get used to them. I have the result, but I do not yet know how to get it. All physicists, and a good many quite respectable mathematicians are contemptuous about proof. #35 20111001 21:56:57
Re: Another programming problem!!!input routine? The limit operator is just an excuse for doing something you know you can't. “It's the subject that nobody knows anything about that we can all talk about!” ― Richard Feynman “Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment #36 20111001 21:59:02
Re: Another programming problem!!!Yes, the one that accepts your sudoku problem. In mathematics, you don't understand things. You just get used to them. I have the result, but I do not yet know how to get it. All physicists, and a good many quite respectable mathematicians are contemptuous about proof. #37 20111001 22:01:36
Re: Another programming problem!!!it looks good. The limit operator is just an excuse for doing something you know you can't. “It's the subject that nobody knows anything about that we can all talk about!” ― Richard Feynman “Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment #38 20111001 22:03:20
Re: Another programming problem!!!Not good enough! Put a print or display statement at the end of it to make sure it has the correct structure. In mathematics, you don't understand things. You just get used to them. I have the result, but I do not yet know how to get it. All physicists, and a good many quite respectable mathematicians are contemptuous about proof. #39 20111001 22:21:46
Re: Another programming problem!!!did it.it loaded. The limit operator is just an excuse for doing something you know you can't. “It's the subject that nobody knows anything about that we can all talk about!” ― Richard Feynman “Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment #40 20111001 22:24:45
Re: Another programming problem!!!Which variables represent your row and columns? In mathematics, you don't understand things. You just get used to them. I have the result, but I do not yet know how to get it. All physicists, and a good many quite respectable mathematicians are contemptuous about proof. #41 20111001 22:26:22
Re: Another programming problem!!!i use a twodimensional array for the values and variables i and j to run through them. The limit operator is just an excuse for doing something you know you can't. “It's the subject that nobody knows anything about that we can all talk about!” ― Richard Feynman “Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment #42 20111001 22:28:18
Re: Another programming problem!!!Are i and j cycling through 1 and 9? Put a display statement inside those loops and then run a test sudoku. In mathematics, you don't understand things. You just get used to them. I have the result, but I do not yet know how to get it. All physicists, and a good many quite respectable mathematicians are contemptuous about proof. #43 20111001 22:39:03
Re: Another programming problem!!!i inputted a sudoku and it looks like it is calculating because i cannot type anything and nothing happens when i press enter,but could it mean anything else? The limit operator is just an excuse for doing something you know you can't. “It's the subject that nobody knows anything about that we can all talk about!” ― Richard Feynman “Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment #44 20111001 22:40:15
Re: Another programming problem!!!Did you put output statements to see what i and j are doing? In mathematics, you don't understand things. You just get used to them. I have the result, but I do not yet know how to get it. All physicists, and a good many quite respectable mathematicians are contemptuous about proof. #45 20111001 22:41:59
Re: Another programming problem!!!oh that's what you meant! The limit operator is just an excuse for doing something you know you can't. “It's the subject that nobody knows anything about that we can all talk about!” ― Richard Feynman “Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment #46 20111001 22:43:01
Re: Another programming problem!!!Yes, or open up the debugger and see what is happening there. In mathematics, you don't understand things. You just get used to them. I have the result, but I do not yet know how to get it. All physicists, and a good many quite respectable mathematicians are contemptuous about proof. #47 20111006 05:19:42
Re: Another programming problem!!!help me! The limit operator is just an excuse for doing something you know you can't. “It's the subject that nobody knows anything about that we can all talk about!” ― Richard Feynman “Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment #48 20111006 06:13:15
Re: Another programming problem!!!Hi anonimnystefy; In mathematics, you don't understand things. You just get used to them. I have the result, but I do not yet know how to get it. All physicists, and a good many quite respectable mathematicians are contemptuous about proof. #49 20111006 06:28:49
Re: Another programming problem!!!well it's still the same problem but this time thanks to my friend i found an infinite lup in one of the procedures.it's named 'kolona': Code:program Sudoku_solver; {$mode objfpc}{$H+} uses {$IFDEF UNIX}{$IFDEF UseCThreads} cthreads, {$ENDIF}{$ENDIF} Classes { you can add units after this }; {$IFDEF WINDOWS}{$R Sudoku.rc}{$ENDIF} const max=9; type niz=array[1..max] of integer; matrica=array[1..max] of niz; var a:matrica; i,j,k:integer; ok:boolean; function red(a:matrica;i1,j1:integer):boolean; var j:integer; b:boolean; begin b:=true; j:=0; while (j<=max) and (b=true) do begin j:=j+1; if j<>j1 then if a[i1][j]=a[i1][j1] then b:=false; end; red:=b; end; function vrsta(a:matrica;i1,j1:integer):boolean; var i:integer; b:boolean; begin b:=true; i:=0; while(i<=max) and(b=true) do begin i:=i+1; if i<>i1 then if a[i][j1]=a[i1][j1] then b:=false; end; vrsta:=b; end; function kvadrat(a:matrica;i1,j1:integer):boolean; var i,j,k,l:integer; b:boolean; begin b:=true; case i1 of 1,2,3: begin k:=0; i:=3 end; 4,5,6: begin k:=3; i:=6; end; 7,8,9: begin k:=6; i:=9; end; end; case j1 of 1,2,3: begin l:=0; j:=3 end; 4,5,6: begin l:=3; j:=6; end; 7,8,9: begin l:=6; j:=9; end; end; while (k<=i) do begin k:=k+1; while (l<=j) do begin l:=l+1; if (k<>i1) and (l<>j1) then if a[k][l]=a[i1][j1] then b:=false; end; end; kvadrat:=b; end; function poz(a:matrica;i,j:integer):boolean; begin poz:=red(a,i,j) and vrsta(a,i,j) and kvadrat(a,i,j); end; procedure sudoku(var a:matrica;n,i1,j1:integer;var ok:boolean); var i,j,k:integer; b:boolean; begin i:=i1; j:=j1; a[i][j]:=n; ok:=false; if poz(a,i,j) then begin ok:=true; i:=0; j:=0; b:=true; while (b=true) and (i<=max) do begin i:=i+1; while (b=true) and (j<=max) do begin j:=j+1; writeln(i); writeln(j); if a[i][j]=0 then b:=false; end; end; if b=false then begin k:=0; ok:=false; while (k<=9) and not ok do begin k:=k+1; sudoku(a,k,i,j,ok); end; end; end; end; begin writeln('Enter Sudoku: '); for i:=1 to 9 do begin for j:=1 to 9 do read(a[i][j]); readln; end; for i:=1 to 9 do begin for j:=1 to 9 do write(a[i][j],' '); writeln; end; k:=0; ok:=false; while (k<=9) and not ok do begin k:=k+1; sudoku(a,k,1,1,ok); end; if ok then begin writeln('Resenje je: '); for i:=1 to 9 do begin for j:=1 to 9 do write(a[i][j],' '); writeln; end; end else writeln('Sudoku cannot be solved!!!'); readln; end. The limit operator is just an excuse for doing something you know you can't. “It's the subject that nobody knows anything about that we can all talk about!” ― Richard Feynman “Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment #50 20111006 06:30:44
Re: Another programming problem!!!Hi; In mathematics, you don't understand things. You just get used to them. I have the result, but I do not yet know how to get it. All physicists, and a good many quite respectable mathematicians are contemptuous about proof. 