Im in the process of finishing my File Editor so have a look and tell me what you think of it at the specified e-mail (see readme.txt).Thanx...
Im in the process of finishing my File Editor so have a look and tell me what you think of it at the specified e-mail (see readme.txt).Thanx...
#1 The indentation looks lousy, especially if your screen is a little narrow. What's wrong wiith just four spaces?
#2 system("cls")... that's a bad idea.
#3#4Code:31| cin >> selection;#5Code:44| if (!a_file.is_open())#6 There is no way I get to read my file before I blindly edit it.Code:90| else (a_file.good());
#7 It's buggy, even in option 1 it will enter an infinite loop. See #4.
#8 You don't have the permissions to create this folder on my computer.
...Code:ofstream c_file("D:\\LW_INFO\\LUF.txt");
...
#99 I can't enter newlines into my file?! What is this?!
...
...
Code:#include <stdio.h> void J(char*a){int f,i=0,c='1';for(;a[i]!='0';++i)if(i==81){ puts(a);return;}for(;c<='9';++c){for(f=0;f<9;++f)if(a[i-i%27+i%9 /3*3+f/3*9+f%3]==c||a[i%9+f*9]==c||a[i-i%9+f]==c)goto e;a[i]=c;J(a);a[i] ='0';e:;}}int main(int c,char**v){int t=0;if(c>1){for(;v[1][ t];++t);if(t==81){J(v[1]);return 0;}}puts("sudoku [0-9]{81}");return 1;}
A limit on the max file size is probably a fine idea too. You don't want to let user's write documents large enough to fill their hard drives.
I suggest you reexamine your evaluation of the criticism that was given to your code. It was good criticism.
Originally Posted by brewbuck:
Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.
Some of it yes but the rest is just taking the mic. out of me.
If you can't take it, don't ask for it.
Also, don't ask on a public forum for people to reply to your personal email. That is rude.
Originally Posted by brewbuck:
Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.
>I want constructive critism not just nit picking!
My my, aren't we rude after asking volunteers for their opinions. How about you try being a little more grateful that someone bothered to point out places your code could be improved?
My best code is written with the delete key.
I feel like Simon Cowell right now
Disclaimer:
***If you don't want us to criticize your code, please do not post it here. Thank you.***
By the way, you didn't even read my above post in it's entireity. I put in a line of correct code, flagged as incorrect. Did you notice it?
Last edited by jafet; 06-07-2006 at 09:28 PM.
Code:#include <stdio.h> void J(char*a){int f,i=0,c='1';for(;a[i]!='0';++i)if(i==81){ puts(a);return;}for(;c<='9';++c){for(f=0;f<9;++f)if(a[i-i%27+i%9 /3*3+f/3*9+f%3]==c||a[i%9+f*9]==c||a[i-i%9+f]==c)goto e;a[i]=c;J(a);a[i] ='0';e:;}}int main(int c,char**v){int t=0;if(c>1){for(;v[1][ t];++t);if(t==81){J(v[1]);return 0;}}puts("sudoku [0-9]{81}");return 1;}
Sorry i took the wrong way but i am apoligizing for any hurt i may have caused anyone on the day!
P.S I took a break and have only just started changing it but you'll be pleased to know that i changed the system("cls"); thingy!
Last edited by L_U_K_E; 06-14-2006 at 02:13 PM.
... you didn't hurt us, it seemed like the other way round though
Code:#include <stdio.h> void J(char*a){int f,i=0,c='1';for(;a[i]!='0';++i)if(i==81){ puts(a);return;}for(;c<='9';++c){for(f=0;f<9;++f)if(a[i-i%27+i%9 /3*3+f/3*9+f%3]==c||a[i%9+f*9]==c||a[i-i%9+f]==c)goto e;a[i]=c;J(a);a[i] ='0';e:;}}int main(int c,char**v){int t=0;if(c>1){for(;v[1][ t];++t);if(t==81){J(v[1]);return 0;}}puts("sudoku [0-9]{81}");return 1;}
Hah i often take things very personaly(lol)!
By the way would you recommend i change:
toCode:ofstream b_file("D:\\LW_INFO\\LUF.txt");
As some people only have the C:\ drive and others may have other names for a second or even third hard drive or flash drive!SO tell me wat you think plz.Thanx.Code:ofstream b_file("C:\\LW_INFO\\LUF.txt");
P.s I have also added a caution message about the folders i use in the prog and what they are used for and tell them not to use my prog if they dont like this idea!
Last edited by L_U_K_E; 06-15-2006 at 09:29 AM.
I'd recommend leaving the drive letter out period, unless you store a LW_INFO folder on a CD or something. Every OS that I know of understands relative filepaths.
Does anyone know why this piece of code doesn't work:
Code:string ver; ofstream version_file("version.txt"); getline(version_file,ver); cout<<ver; cin.get();