This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void | |
player_started_play | |
( ){ | |
int coordinates [ ] = null; | |
int machine_row_open_for_win = -1 ; | |
int machine_col_open_for_win = -1 ; | |
int player_row_open_for_win = -1 ; | |
int player_col_open_for_win = -1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void | |
machine_started_play | |
( ){ | |
int coordinates [ ] = null; | |
int machine_row_open_for_win = -1 ; | |
int machine_col_open_for_win = -1 ; | |
if (turn_count == 1 )//machine is starting | |
coordinates = get_random_free_corner ( ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
int | |
main | |
(int argc , char * argv [ ] ){ | |
char tmp_path [L_tmpnam + 1 ]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
/* tmpfile function demo program . */ | |
int | |
main | |
(int argc , char * argv [ ] ){ | |
FILE * tmp = tmpfile ( ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
/* A simple program demonstrating the | |
C standard library , rename function . | |
The rename function can rename files | |
and directories .*/ | |
int | |
main | |
(int argc , char * argv [ ] ){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
/* Program to remove files . | |
It can also remove empty directories | |
under linux , but directories | |
cannot be removed under windows .*/ | |
int | |
main (int argc , char * argv [ ] ){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
/* Copy a file one character at a time .*/ | |
int | |
main | |
(int argc , char * argv [ ] ){ | |
if (argc != 3 ){ | |
printf ("%s\n" , "Usage: fgp fom to" ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Redirecting the output of a for | |
# loop to a file . | |
$ for x in {1..10} ; do echo $x ; done > filesave | |
$ cat filesave | |
1 | |
2 | |
3 | |
4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ c=1 | |
$ echo $c | |
1 | |
$ for c in {1..9}; do echo -n $c; done | |
123456789 | |
# {1..9} will expand to 1 2 3 4 5 6 7 8 9 . | |
# The for loop will loop through these words , | |
# and echo will echo the words . -n is used |