Hello, and welcome to Outlook
Outlook is a truly modern email experience, and we're excited for you to check it out.
A modern interface: faster and cleaner
The simple, fluid and interactive design of Outlook makes it easy to use whether you're on a desktop, phone or tablet.
Learn more
Get an Outlook email address for your new inbox
You can get a new email address from Outlook. You don't have to worry about your contacts and previous emails, you'll keep them. And, you'll continue receiving messages sent to your Hotmail address.
Get new ID
Bring your inbox to life — Connect Facebook and Twitter
Connect and see your friends' Facebook updates and Tweets directly in your inbox. Your contacts' information is automatically in sync so you don't miss a thing.
Connect now
Tell us what you think of Outlook
We want to hear your opinion. Please submit your feedback via the Feedback link under the Options menu.
/* Code */
==============================================
Log: 2011-09-28 14:42:28
==============================================
Inverse Fourier transform. Done
Memory Usage #02 : 76 Mb
G:\Java-Lo-optimization-tool-Explore\images\PAT007.01.jpg
Input Image : 256 x 256 pixels
Starting FFT..
X-Spectrum Calculated
Y-Spectrum Calculated
Data set to SpectaPlot
Memory Usage #01 : 57 Mb
Inverse Fourier transform started...
Inverse Fourier transform. Done
Memory Usage #02 : 90 Mb
Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: 65536
at FFTool_M.SpectrumCalc.histogramY(SpectrumCalc.java:66)
at FFTool_M.DesktopApplication1View.spectrumPlot(DesktopApplication1View.java:856)
at FFTool_M.DesktopApplication1View.sampleSliderStateChanged(DesktopApplication1View.java:2725)
at FFTool_M.DesktopApplication1View.access$3200(DesktopApplication1View.java:30)
at FFTool_M.DesktopApplication1View$12.stateChanged(DesktopApplication1View.java:1341)
at javax.swing.JSlider.fireStateChanged(Unknown Source)
at javax.swing.JSlider$ModelListener.stateChanged(Unknown Source)
at javax.swing.DefaultBoundedRangeModel.fireStateChanged(Unknown Source)
at javax.swing.DefaultBoundedRangeModel.setRangeProperties(Unknown Source)
at javax.swing.DefaultBoundedRangeModel.setValue(Unknown Source)
at javax.swing.JSlider.setValue(Unknown Source)
at javax.swing.plaf.basic.BasicSliderUI$TrackListener.mouseDragged(Unknown Source)
at java.awt.Component.processMouseMotionEvent(Unknown Source)
at javax.swing.JComponent.processMouseMotionEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$000(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: 65536
at FFTool_M.SpectrumCalc.histogramY(SpectrumCalc.java:66)
at FFTool_M.DesktopApplication1View.spectrumPlot(DesktopApplication1View.java:856)
at FFTool_M.DesktopApplication1View.sampleSliderStateChanged(DesktopApplication1View.java:2725)
at FFTool_M.DesktopApplication1View.access$3200(DesktopApplication1View.java:30)
at FFTool_M.DesktopApplication1View$12.stateChanged(DesktopApplication1View.java:1341)
at javax.swing.JSlider.fireStateChanged(Unknown Source)
at javax.swing.JSlider$ModelListener.stateChanged(Unknown Source)
at javax.swing.DefaultBoundedRangeModel.fireStateChanged(Unknown Source)
at javax.swing.DefaultBoundedRangeModel.setRangeProperties(Unknown Source)
at javax.swing.DefaultBoundedRangeModel.setValueIsAdjusting(Unknown Source)
at javax.swing.JSlider.setValueIsAdjusting(Unknown Source)
at javax.swing.plaf.basic.BasicSliderUI$TrackListener.mouseReleased(Unknown Source)
at com.sun.java.swing.plaf.windows.WindowsSliderUI$WindowsTrackListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$000(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Starting FFT..
X-Spectrum Calculated
Y-Spectrum Calculated
Data set to SpectaPlot
Memory Usage #01 : 62 Mb
Inverse Fourier transform started...
Inverse Fourier transform. Done
Memory Usage #02 : 79 Mb
Inverse Fourier transform started...
Inverse Fourier transform. Done
Memory Usage #02 : 98 Mb
Inverse Fourier transform started...
Inverse Fourier transform. Done
Memory Usage #02 : 102 Mb
Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: 65536
at FFTool_M.SpectrumCalc.histogramY(SpectrumCalc.java:66)
at FFTool_M.DesktopApplication1View.spectrumPlot(DesktopApplication1View.java:856)
at FFTool_M.DesktopApplication1View.sampleSliderStateChanged(DesktopApplication1View.java:2725)
at FFTool_M.DesktopApplication1View.access$3200(DesktopApplication1View.java:30)
at FFTool_M.DesktopApplication1View$12.stateChanged(DesktopApplication1View.java:1341)
at javax.swing.JSlider.fireStateChanged(Unknown Source)
at javax.swing.JSlider$ModelListener.stateChanged(Unknown Source)
at javax.swing.DefaultBoundedRangeModel.fireStateChanged(Unknown Source)
at javax.swing.DefaultBoundedRangeModel.setRangeProperties(Unknown Source)
at javax.swing.DefaultBoundedRangeModel.setValueIsAdjusting(Unknown Source)
at javax.swing.JSlider.setValueIsAdjusting(Unknown Source)
at javax.swing.plaf.basic.BasicSliderUI$TrackListener.mouseDragged(Unknown Source)
at java.awt.Component.processMouseMotionEvent(Unknown Source)
at javax.swing.JComponent.processMouseMotionEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$000(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
/* END */
WHAT IS YOUR EARLIEST HUMAN MEMORY?
White ants in my preschool stairs ;)
This is a test post for <code> tag in normal html in tumblr
#include <windows.h> #include <stdio.h> #include <cstring> #define BUFSIZE 4096 int main(void) { CHAR chBuf[BUFSIZE]; DWORD dwRead, dwWritten; HANDLE hStdin, hStdout; BOOL bSuccess; hStdout = GetStdHandle(STD_OUTPUT_HANDLE); hStdin = GetStdHandle(STD_INPUT_HANDLE); if ( (hStdout == INVALID_HANDLE_VALUE) || (hStdin == INVALID_HANDLE_VALUE) ) ExitProcess(1); // Send something to this process's stdout using printf. printf("\n ** This is a message from the child process. ** \n"); // This simple algorithm uses the existence of the pipes to control execution. // It relies on the pipe buffers to ensure that no data is lost. // Larger applications would use more advanced process control. char *ch2="YES THIS IS ME"; char *ch1; //for (int i =0;i<5;++i) // for (;;) // { // // Read from standard input and stop on error or no data. // //bSuccess = ReadFile(hStdin, chBuf, BUFSIZE, &dwRead, NULL); // //if (! bSuccess || dwRead == 0) // // break; // //ch1 = &ch2[i]; // //CHAR ch2[10]="YES"; // // Write to standard output and stop on error. // bSuccess = WriteFile(hStdout, ch2, dwRead, &dwWritten, NULL); // //if (bSuccess) printf("\n ** This is a message from the child process. ** \n"); // if (! bSuccess) // break; // } fflush(stdout); return 0; }
The following is the test for glut (open GL) package installed in your libraries
#include <iostream> int main(int argc, char **argv) { std::cout << "All your bases are belong to us" << std::endl; return 0; int main(); }
class Voila { #include <windows.h> #include <stdio.h> #include <cstring> #define BUFSIZE 4096 int main(void) { CHAR chBuf[BUFSIZE]; DWORD dwRead, dwWritten; HANDLE hStdin, hStdout; BOOL bSuccess; hStdout = GetStdHandle(STD_OUTPUT_HANDLE); hStdin = GetStdHandle(STD_INPUT_HANDLE); if ( (hStdout == INVALID_HANDLE_VALUE) || (hStdin == INVALID_HANDLE_VALUE) ) ExitProcess(1); // Send something to this process's stdout using printf. printf("\n ** This is a message from the child process. ** \n"); // This simple algorithm uses the existence of the pipes to control execution. // It relies on the pipe buffers to ensure that no data is lost. // Larger applications would use more advanced process control. char *ch2="YES THIS IS ME"; char *ch1; //for (int i =0;i<5;++i) // for (;;) // { // // Read from standard input and stop on error or no data. // //bSuccess = ReadFile(hStdin, chBuf, BUFSIZE, &dwRead, NULL); // //if (! bSuccess || dwRead == 0) // // break; // //ch1 = &ch2[i]; // //CHAR ch2[10]="YES"; // // Write to standard output and stop on error. // bSuccess = WriteFile(hStdout, ch2, dwRead, &dwWritten, NULL); // //if (bSuccess) printf("\n ** This is a message from the child process. ** \n"); // if (! bSuccess) // break; // } fflush(stdout); return 0; }
class Voila { public: // Voila static const string VOILA = "Voila"; // will not interfere with embedded tags. }
More testing to be done on this CSS file
#include<stdio.h> #include<stdlib.h> //#include "analyse.h" //#include "format.h" //#include "guess.h" typedef struct _node { int i; int j; int box; int v[9]; int vcount; struct _node *next; }node;
node *head,*ptr; void possibility(int i,int j,node *p); typedef struct _most { int i; int j; int v[9]; int vcount; struct _most *next; }most; void delete_node(node *temp); void linklist(node *temp); int isthere(int v[],int num); void check_row(node *p); void checkcell(node *p); void end(); void mat_copy(int a); int execute2(); void guess(); void inverse_mat(); int prn_possibility(node *p); int col(int j,int count) ; int row(int i,int count) ; int cell(int box,int count); void initialize(int i,int j); void refresh(); void refresh2(); void prn_sudoku(); /****************************************************************/ int m[10][10],n[10][10],t_count=0,t2_count=0,t3_count=0; int true_flag=0, inv_count=0; /****************************************************************/ void sudoku_in( int mode) { if (mode){ m[1][1]=1;m[1][2]=8;m[1][3]=0;m[1][4]=7;m[1][5]=0;m[1][6]=4;m[1][7]=0;m[1][8]=3; m[1][9]=2;m[2][1]=0;m[2][2]=0;m[2][3]=0;m[2][4]=0;m[2][5]=3;m[2][6]=0;m[2][7]=0; m[2][8]=0;m[2][9]=0;m[3][1]=0;m[3][2]=2;m[3][3]=0;m[3][4]=0;m[3][5]=0;m[3][6]=0; m[3][7]=0;m[3][8]=8;m[3][9]=0;m[4][1]=0;m[4][2]=0;m[4][3]=5;m[4][4]=9;m[4][5]=0; m[4][6]=8;m[4][7]=2;m[4][8]=0;m[4][9]=0;m[5][1]=8;m[5][2]=0;m[5][3]=0;m[5][4]=0; m[5][5]=0;m[5][6]=0;m[5][7]=0;m[5][8]=0;m[5][9]=7;m[6][1]=0;m[6][2]=0;m[6][3]=4; m[6][4]=6;m[6][5]=0;m[6][6]=3;m[6][7]=9;m[6][8]=0;m[6][9]=0;m[7][1]=0;m[7][2]=5; m[7][3]=0;m[7][4]=0;m[7][5]=0;m[7][6]=0;m[7][7]=0;m[7][8]=1;m[7][9]=0;m[8][1]=0; m[8][2]=0;m[8][3]=0;m[8][4]=0;m[8][5]=8;m[8][6]=0;m[8][7]=0;m[8][8]=0;m[8][9]=0; m[9][1]=6;m[9][2]=7;m[9][3]=0;m[9][4]=3;m[9][5]=0;m[9][6]=1;m[9][7]=0;m[9][8]=9; m[9][9]=5; } else{ int i,j; printf("\n\t\tEnter the whole matrix sudoku"); for(i=1;i<10;++i) { printf("\n\t\tEnter %dth row",i); for(j=1;j<10;++j) { scanf("%d",&m[i][j]);} } } return; } int execute() { int a ; while(t_count!=-1) { refresh(); a=prn_possibility(head); linklist(head); refresh(); a=prn_possibility(head); while(a==1) { linklist(head);//prn_sudoku(); if(t_count==0) end(); refresh(); a=prn_possibility(head); } refresh(); check_row(head); if(t_count==0) end(); inverse_mat(); if(t2_count==t_count) { if(inv_count%2!=0) inverse_mat(); refresh2(); a=prn_possibility(head); checkcell(head); if(t_count==0) end(); if(t3_count==t_count) guess(); t3_count=t_count; } if(t_count==0) end(); t2_count=t_count; } return(1); } int introduction() { char a; printf(" ***************************************************************************\n"); printf(" SOLVING THE SUDOKU \n"); printf(" ***************************************************************************\n"); printf(" instructions:\n"); printf(" ---------------------------------------------------------------------------\n"); printf(" 1. you will have to provide the sudoku in the form of a\n"); printf(" matrix each of whose elements will be separated by a \n"); printf(" blank space.\n"); printf(" 2. the unfilled or blank positions of a sudoku will be \n"); printf(" denoted by a '0' zero.\n"); printf(" A sample sudoku is given below\n"); printf(" --------------------------------------------------------------------------\n"); printf(" 1 8 0 7 0 4 0 3 2 \n"); printf(" 0 0 0 0 3 0 0 0 0 \n"); printf(" 0 2 0 0 0 0 0 8 0 \n"); printf(" 0 0 5 9 0 8 2 0 0 \n"); printf(" 8 0 0 0 0 0 0 0 7 \n"); printf(" 0 0 4 6 0 3 9 0 0 \n"); printf(" 0 5 0 0 0 0 0 1 0 \n"); printf(" 0 0 0 0 8 0 0 0 0 \n"); printf(" 6 7 0 3 0 1 0 9 5 \n"); printf(" --------------------------------------------------------------------------\n"); printf(" Press enter to continue... \nq - quit 1 - to solve above sudoku\n>>"); a = getchar(); if (a=='q') exit(1); else if (a=='1') return 1; return 0; } int main( int argc, char *argv[]) { true_flag=1; head=(node*)malloc(sizeof(node)); printf("\n"); int x = introduction(); if (x==1) sudoku_in(1); // check arguments material: http://www.codingunit.com/c-tutorial-command-line-parameter-parsing else if ((argc > 1) && (argv[1][0] == '-')) { switch (argv[1][1]) { case '0': sudoku_in(0); break; case '1': sudoku_in(1); break; default: sudoku_in(0); break; } } else if (argc==1) sudoku_in(0); execute(); return(0); } //extern "C" int run_main( int a, int b) { //return (9); int x=0; true_flag=1; head=(node*)malloc(sizeof(node)); printf("\n"); //x = introduction(); //if (x==1) sudoku_in(1); // check arguments material: http://www.codingunit.com/c-tutorial-command-line-parameter-parsing execute(); return(0); } void delete_node(node *temp) { /*deletes node next to temp*/ node *local; local=temp->next->next; free(temp->next); temp->next=local; --t_count; return; } void linklist(node *temp) { while(temp->next->next!=NULL) { if(temp->next->vcount==1) { m[temp->next->i][temp->next->j]=temp->next->v[0]; delete_node(temp); } else temp=temp->next; } } int isthere(int v[],int num) { int i=0; while(v[i]!=0) { if(v[i]==num) return 1; if(v[i]>num) break; i++; } return 0; } void check_row(node *p) { node *temp,*store; int i,j,num ; int count; temp=p; while(temp->next->i!=10) { i=temp->next->i; num=1; while(num<=9) { p=temp;count=0; while(p->next->i<(i+1)) { if(isthere(p->next->v,num)==1) { count++; j=p->next->j;store=p; } p=p->next; } if(count==1) { m[i][j]=num; delete_node(store); } ++num; } while(temp->next->i<(i+1)) temp=temp->next; } } void checkcell(node *p) { node *temp,*store; int i1,j1,num,box; int count; temp=p; while(temp->next->i!=10) { box=temp->next->box; num=1; while(num<=9) { p=temp;count=0; while(p->next->box<(box+1)) { if(isthere(p->next->v,num)==1) { count++; i1=p->next->i; j1=p->next->j;store=p; } p=p->next; } if(count==1) { m[i1][j1]=num; delete_node(store); } ++num; } while(temp->next->box<(box+1)) temp=temp->next; } } void end() { int i,j; // testing only //return; printf("\n"); printf(" -----------------------------------------------------------------------\n"); printf(" The solution to your sudoku is : \n"); printf(" -----------------------------------------------------------------------"); for(i=1;i<=9;++i) { printf("\n "); for(j=1;j<=9;++j) { if(inv_count%2==0) printf("%2d",m[i][j]); else printf("%2d",m[j][i]); } } printf("\n ---------------------------------------------------------------------"); printf(" Total Count = %2d",t_count); printf("\n ---------------------------------------------------------------------"); exit(1); } int prn_possibility(node *p) { int i,count; count=0; while(p->next!=NULL) { i=0; while(p->next->v[i]!=0) { ++i; } if(p->next->vcount==1) count=1; p=p->next; } return(count); } void mat_copy(int a) { int i,j; for(i=1;i<10;++i) for(j=1;j<10;++j) { if(a==1) n[i][j]=m[i][j]; else m[i][j]=n[i][j]; } return; } void inverse_mat() { int n[10][10]; int i,j; for(i=1;i<10;++i) for(j=1;j<10;++j) n[j][i]=m[i][j]; for(i=1;i<10;++i) for(j=1;j<10;++j) m[i][j]=n[i][j]; inv_count++; return; } int execute2() { int a ; while(t_count!=-1) { refresh(); a=prn_possibility(head); linklist(head); refresh(); a=prn_possibility(head); while(a==1) { linklist(head); if(t_count==0) end(); refresh(); a=prn_possibility(head); } ptr=head; refresh(); check_row(head); if(t_count==0) end(); inverse_mat(); if(t2_count==t_count) { if(t_count<6) return(2) ; if(inv_count%2!=0) inverse_mat(); ptr=head; refresh2(); a=prn_possibility(head); checkcell(head); if(t_count==0) end(); if(t3_count==t_count) return(0); t3_count=t_count; } if(t_count==0) end(); t2_count=t_count; } return(1); } void guess() { node *p; most *stack,*temp; int i,j,value; mat_copy(1); temp=stack=(most*)malloc(sizeof(most)); refresh(); prn_possibility(head); p=head; for(i=2;i<=5;++i) { while(p->next->next!=NULL) { if(i==(p->next->vcount)) { stack->next=(most*)malloc(sizeof(most)); stack=stack->next; stack->i=p->next->i; stack->j=p->next->j; stack->vcount=p->next->vcount; for(j=0;j<=8;++j) stack->v[j]=p->next->v[j]; } p=p->next; } p=head; } stack->next=NULL; stack=temp; while(stack->next!=NULL) { j=stack->next->vcount; for(i=0;i<=j-1;++i) { m[stack->next->i][stack->next->j]=stack->next->v[i]; value=execute2(); if(value==1) end(); else if(value==2) { if(i==1 && stack->next->v[i+1]==0) { n[stack->next->i][stack->next->j]=stack->next->v[i-1]; } } else if(value==2){ if(i==0) n[stack->next->i][stack->next->j]=stack->next->v[i+1]; } mat_copy(2); } stack=stack->next; } } int col(int j,int count) { /*this func checks whether the j-th column has the no, count*/ int i; for(i=1;i<10;++i) if(m[i][j]==count) return 0; return(count); } int row(int i,int count) { /*this func checks for whether the i-th row has the no. count in if * if yes this count value is discarded by returning 0 value */ int j; for(j=1;j<10;++j) if(count==m[i][j]) return 0; return(count); } int cell(int box,int count) { /*this func checks whether the box has the value count*/ int i,j,a,b,x,y; if(box<=3) { a=1;x=3; b=3*(box-1)+1; y=3*box;} else if(box<=6) { a=4;x=6; b=3*(box-4)+1; y=3*(box-3);} else if(box<=9) { a=7;x=9; b=3*(box-7)+1; y=3*(box-6);} for(i=a;i<=x;i++) for(j=b;j<=y;j++) { if(m[i][j]==count) return(0); } return(count); } void possibility(int i,int j,node *p) { /* This func stores all the possible values of element [i,j]*/ int count=1; int v_cnt,temp; v_cnt=0; while(count<=9) { if(col(j,count)!=0) { if(row(i,count)!=0) { if(cell(p->next->box,count)!=0) { p->next->v[v_cnt]=count;v_cnt++; } } } count++; } temp=v_cnt; p->next->vcount=temp; for(;v_cnt<=9;v_cnt++) p->next->v[v_cnt]=0; p->next->vcount=temp; return; } void initialize(int i,int j) { /*this func initialises a linked list of the empty cells in the*/ /* sudoku and directs execution to possibilities */ if(true_flag==1) { ptr->next=(node*)malloc(sizeof(node)); ptr->next->i=i; ptr->next->j=j; if(i<=3&&j<=3) ptr->next->box=1; else if(i<=3&&j<=6) ptr->next->box=2; else if(i<=3&&j<=9) ptr->next->box=3; else if(i<=6&&j<=3) ptr->next->box=4; else if(i<=6&&j<=6) ptr->next->box=5; else if(i<=6&&j<=9) ptr->next->box=6; else if(i<=9&&j<=3) ptr->next->box=7; else if(i<=9&&j<=6) ptr->next->box=8; else ptr->next->box=9; } possibility(i,j,ptr); ptr=ptr->next; return; } void refresh() { int i,j; t_count=0; ptr=head; for(i=1;i<10;++i) for(j=1;j<10;++j) { if(m[i][j]==0) { t_count++ ;initialize(i,j);} } ptr->next=(node*)malloc(sizeof(node)); ptr->next->i=10; ptr->next->j=1; ptr->next->next=NULL; return ; } void refresh2() { int i,j,box,a,b,x,y; t_count=0; ptr=head; for(box=1;box<10;++box) { if(box<=3) { a=1;x=3; b=3*(box-1)+1; y=3*box;} else if(box<=6) { a=4;x=6; b=3*(box-4)+1; y=3*(box-3);} else if(box<=9) { a=7;x=9; b=3*(box-7)+1; y=3*(box-6);} for(i=a;i<=x;++i) for(j=b;j<=y;++j) { if(m[i][j]==0){ t_count++;initialize(i,j);} } } ptr->next=(node*)malloc(sizeof(node)); ptr->next->i=10; ptr->next->j=1; ptr->next->box=10; ptr->next->next=NULL; return; } void prn_sudoku() { int i,j; for(i=1;i<=9;++i) { for(j=1;j<=9;++j) { if(inv_count%2==0) ; else printf("%2d",m[j][i]); } } return ; }
This is our first "Hello World" C program we will write helloworld.c
#include <stdio.h> int main (){ char str[64]; printf ("Hello world \nPlease enter your name:"); scanf("%s",str); printf("Hello %s, Welcome to C Programming", str); return 0; }
Output for the above is:
home/usr> ./helloworld Hello World Please enter your name:Mark Hello Mark, Welcome to C Programming
Now that we will look into basic input output statements and syntax commonly used in C.
Input Methods:
More methods to find
home/usr> ./helloworld Hello World Please enter your name:Mark Hello Mark, Welcome to C Programming
Headerfiles are meant for those purpose
this was the worst thing in stdin inputs.