Home » Archimedes archive » Acorn User » AU 1994-12.adf » !C_C » C/Kate1
C/Kate1
This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.
Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.
Tape/disk: | Home » Archimedes archive » Acorn User » AU 1994-12.adf » !C_C |
Filename: | C/Kate1 |
Read OK: | ✔ |
File size: | 0E17 bytes |
Load address: | 0000 |
Exec address: | 0000 |
File contents
/* Kate 1: the first fragment of the grand photo-cataloguing program. */ /* Include header files to define functions for I/O and string handling. */ #include <stdio.h> #include <string.h> /* Main program. */ main() { int exposure[40]; /* Initislise all the variables. */ int aperture[40][2]; char place[40][100]; int i,max_frames; /* i is a generic loop variable. */ float datum; /* datum is a 'dummy' floating point variable. */ printf("Please enter the number of frames on the film.\n"); printf("(Up to forty.)\n"); /* The scanf() function reads values in from the keyboard. The first */ /* function argument is a formatting string; the second */ /* argument gives the _address_ of the datum to be read in (hence */ /* it is prefixed by an ampersand. The maximum number of frames is */ /* checked to make sure that it is a sensible number. */ scanf("%d",&max_frames); if (max_frames > 40) max_frames = 40; if (max_frames < 1) max_frames = 1; printf("You will now be asked to enter exposure, aperture and\n"); printf("location data for each frame on the film.\n"); printf("If the exposure is less than one second, it should be\n"); printf("entered as minus the reciprocal of the exposure. For\n"); printf("instance, an exposure of a thirtieth of a second should\n"); printf("be entered as \"-30\".\n"); printf("All locations should be shorter than 100 characters long.\n"); /* The program now goes through a loop. The loop starts from zero. This */ /* is deliberate, and is because most films actually start from frame */ /* zero, unless you get over-enthusiastic while loading the film. */ for (i=0; i<max_frames; i++) { printf("Please enter the exposure of frame %d.\n",i); scanf("%d",&exposure[i]); printf("Please enter the aperture setting for frame %d.\n",i); /* The aperture is read as a floating point number, and the integer and */ /* the first decimal place parts of the number are held in elements one */ /* and two of the array. */ scanf("%f",&datum); aperture[i][1] = (int)datum; aperture[i][2] = (datum - aperture[i][1]) * 10; printf("Please enter the loction for frame %d.\n",i); /* The program reads an extra character to rid the input buffer of the */ /* extra newline character which will be sitting in it at this point. */ getchar(); /* The gets() function reads a line of text from the keyboard into a */ /* string. It takes as an argument a pointer to the string. This could */ /* be written '&place[i][0]', since that is where we want the string */ /* to go, but this is just a pointer to element zero of the array and */ /* so can also be written 'place[i]'. If you have a C compiler, you can */ /* of course check this. */ gets(place[i]); } /* The next loop prints out all the values that we have just input. */ for (i=0; i<max_frames; i++) { printf("Exposure %d was taken at %s\n",i,place[i]); if (exposure[i] > 0) { printf("with an exposure of %d ",exposure[i]); } else { printf("with an exposure of 1/%d ",-exposure[i]); } printf("and an aperture of %d.%d.\n\n",aperture[i][1],aperture[i][2]); } /* Since main() is technically a function, we should return zero from */ /* it to reassure the machine that everything has gone well. Don't */ /* worry about this for the moment. */ return 0; }
00000000 2f 2a 20 4b 61 74 65 20 31 3a 20 74 68 65 20 66 |/* Kate 1: the f| 00000010 69 72 73 74 20 66 72 61 67 6d 65 6e 74 20 6f 66 |irst fragment of| 00000020 20 74 68 65 20 67 72 61 6e 64 20 70 68 6f 74 6f | the grand photo| 00000030 2d 63 61 74 61 6c 6f 67 75 69 6e 67 20 70 72 6f |-cataloguing pro| 00000040 67 72 61 6d 2e 20 20 20 20 2a 2f 0a 0a 2f 2a 20 |gram. */../* | 00000050 49 6e 63 6c 75 64 65 20 68 65 61 64 65 72 20 66 |Include header f| 00000060 69 6c 65 73 20 74 6f 20 64 65 66 69 6e 65 20 66 |iles to define f| 00000070 75 6e 63 74 69 6f 6e 73 20 66 6f 72 20 49 2f 4f |unctions for I/O| 00000080 20 61 6e 64 20 73 74 72 69 6e 67 20 68 61 6e 64 | and string hand| 00000090 6c 69 6e 67 2e 20 2a 2f 0a 23 69 6e 63 6c 75 64 |ling. */.#includ| 000000a0 65 20 3c 73 74 64 69 6f 2e 68 3e 0a 23 69 6e 63 |e <stdio.h>.#inc| 000000b0 6c 75 64 65 20 3c 73 74 72 69 6e 67 2e 68 3e 0a |lude <string.h>.| 000000c0 0a 2f 2a 20 4d 61 69 6e 20 70 72 6f 67 72 61 6d |./* Main program| 000000d0 2e 20 2a 2f 0a 6d 61 69 6e 28 29 0a 7b 20 69 6e |. */.main().{ in| 000000e0 74 20 65 78 70 6f 73 75 72 65 5b 34 30 5d 3b 20 |t exposure[40]; | 000000f0 20 20 20 2f 2a 20 49 6e 69 74 69 73 6c 69 73 65 | /* Initislise| 00000100 20 61 6c 6c 20 74 68 65 20 76 61 72 69 61 62 6c | all the variabl| 00000110 65 73 2e 20 20 20 20 20 20 20 20 20 20 20 20 20 |es. | 00000120 20 20 20 20 20 2a 2f 0a 20 20 69 6e 74 20 61 70 | */. int ap| 00000130 65 72 74 75 72 65 5b 34 30 5d 5b 32 5d 3b 0a 20 |erture[40][2];. | 00000140 20 63 68 61 72 20 70 6c 61 63 65 5b 34 30 5d 5b | char place[40][| 00000150 31 30 30 5d 3b 0a 20 20 69 6e 74 20 69 2c 6d 61 |100];. int i,ma| 00000160 78 5f 66 72 61 6d 65 73 3b 20 20 20 20 2f 2a 20 |x_frames; /* | 00000170 69 20 69 73 20 61 20 67 65 6e 65 72 69 63 20 6c |i is a generic l| 00000180 6f 6f 70 20 76 61 72 69 61 62 6c 65 2e 20 20 20 |oop variable. | 00000190 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2a | *| 000001a0 2f 0a 20 20 66 6c 6f 61 74 20 64 61 74 75 6d 3b |/. float datum;| 000001b0 20 20 20 20 20 20 20 20 20 2f 2a 20 64 61 74 75 | /* datu| 000001c0 6d 20 69 73 20 61 20 27 64 75 6d 6d 79 27 20 66 |m is a 'dummy' f| 000001d0 6c 6f 61 74 69 6e 67 20 70 6f 69 6e 74 20 76 61 |loating point va| 000001e0 72 69 61 62 6c 65 2e 20 20 20 20 2a 2f 0a 0a 20 |riable. */.. | 000001f0 20 70 72 69 6e 74 66 28 22 50 6c 65 61 73 65 20 | printf("Please | 00000200 65 6e 74 65 72 20 74 68 65 20 6e 75 6d 62 65 72 |enter the number| 00000210 20 6f 66 20 66 72 61 6d 65 73 20 6f 6e 20 74 68 | of frames on th| 00000220 65 20 66 69 6c 6d 2e 5c 6e 22 29 3b 0a 20 20 70 |e film.\n");. p| 00000230 72 69 6e 74 66 28 22 28 55 70 20 74 6f 20 66 6f |rintf("(Up to fo| 00000240 72 74 79 2e 29 5c 6e 22 29 3b 0a 0a 2f 2a 20 54 |rty.)\n");../* T| 00000250 68 65 20 73 63 61 6e 66 28 29 20 66 75 6e 63 74 |he scanf() funct| 00000260 69 6f 6e 20 72 65 61 64 73 20 76 61 6c 75 65 73 |ion reads values| 00000270 20 69 6e 20 66 72 6f 6d 20 74 68 65 20 6b 65 79 | in from the key| 00000280 62 6f 61 72 64 2e 20 54 68 65 20 66 69 72 73 74 |board. The first| 00000290 20 20 20 20 20 2a 2f 0a 2f 2a 20 66 75 6e 63 74 | */./* funct| 000002a0 69 6f 6e 20 61 72 67 75 6d 65 6e 74 20 69 73 20 |ion argument is | 000002b0 61 20 66 6f 72 6d 61 74 74 69 6e 67 20 73 74 72 |a formatting str| 000002c0 69 6e 67 3b 20 74 68 65 20 73 65 63 6f 6e 64 20 |ing; the second | 000002d0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 000002e0 20 2a 2f 0a 2f 2a 20 61 72 67 75 6d 65 6e 74 20 | */./* argument | 000002f0 67 69 76 65 73 20 74 68 65 20 5f 61 64 64 72 65 |gives the _addre| 00000300 73 73 5f 20 6f 66 20 74 68 65 20 64 61 74 75 6d |ss_ of the datum| 00000310 20 74 6f 20 62 65 20 72 65 61 64 20 69 6e 20 28 | to be read in (| 00000320 68 65 6e 63 65 20 20 20 20 20 20 20 20 2a 2f 0a |hence */.| 00000330 2f 2a 20 69 74 20 69 73 20 70 72 65 66 69 78 65 |/* it is prefixe| 00000340 64 20 62 79 20 61 6e 20 61 6d 70 65 72 73 61 6e |d by an ampersan| 00000350 64 2e 20 54 68 65 20 6d 61 78 69 6d 75 6d 20 6e |d. The maximum n| 00000360 75 6d 62 65 72 20 6f 66 20 66 72 61 6d 65 73 20 |umber of frames | 00000370 69 73 20 20 20 20 20 20 20 2a 2f 0a 2f 2a 20 63 |is */./* c| 00000380 68 65 63 6b 65 64 20 74 6f 20 6d 61 6b 65 20 73 |hecked to make s| 00000390 75 72 65 20 74 68 61 74 20 69 74 20 69 73 20 61 |ure that it is a| 000003a0 20 73 65 6e 73 69 62 6c 65 20 6e 75 6d 62 65 72 | sensible number| 000003b0 2e 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |. | 000003c0 20 20 20 20 20 2a 2f 0a 0a 20 20 73 63 61 6e 66 | */.. scanf| 000003d0 28 22 25 64 22 2c 26 6d 61 78 5f 66 72 61 6d 65 |("%d",&max_frame| 000003e0 73 29 3b 0a 20 20 69 66 20 28 6d 61 78 5f 66 72 |s);. if (max_fr| 000003f0 61 6d 65 73 20 3e 20 34 30 29 20 6d 61 78 5f 66 |ames > 40) max_f| 00000400 72 61 6d 65 73 20 3d 20 34 30 3b 0a 20 20 69 66 |rames = 40;. if| 00000410 20 28 6d 61 78 5f 66 72 61 6d 65 73 20 3c 20 20 | (max_frames < | 00000420 31 29 20 6d 61 78 5f 66 72 61 6d 65 73 20 3d 20 |1) max_frames = | 00000430 31 3b 0a 0a 20 20 70 72 69 6e 74 66 28 22 59 6f |1;.. printf("Yo| 00000440 75 20 77 69 6c 6c 20 6e 6f 77 20 62 65 20 61 73 |u will now be as| 00000450 6b 65 64 20 74 6f 20 65 6e 74 65 72 20 65 78 70 |ked to enter exp| 00000460 6f 73 75 72 65 2c 20 61 70 65 72 74 75 72 65 20 |osure, aperture | 00000470 61 6e 64 5c 6e 22 29 3b 0a 20 20 70 72 69 6e 74 |and\n");. print| 00000480 66 28 22 6c 6f 63 61 74 69 6f 6e 20 64 61 74 61 |f("location data| 00000490 20 66 6f 72 20 65 61 63 68 20 66 72 61 6d 65 20 | for each frame | 000004a0 6f 6e 20 74 68 65 20 66 69 6c 6d 2e 5c 6e 22 29 |on the film.\n")| 000004b0 3b 0a 20 20 70 72 69 6e 74 66 28 22 49 66 20 74 |;. printf("If t| 000004c0 68 65 20 65 78 70 6f 73 75 72 65 20 69 73 20 6c |he exposure is l| 000004d0 65 73 73 20 74 68 61 6e 20 6f 6e 65 20 73 65 63 |ess than one sec| 000004e0 6f 6e 64 2c 20 69 74 20 73 68 6f 75 6c 64 20 62 |ond, it should b| 000004f0 65 5c 6e 22 29 3b 0a 20 20 70 72 69 6e 74 66 28 |e\n");. printf(| 00000500 22 65 6e 74 65 72 65 64 20 61 73 20 6d 69 6e 75 |"entered as minu| 00000510 73 20 74 68 65 20 72 65 63 69 70 72 6f 63 61 6c |s the reciprocal| 00000520 20 6f 66 20 74 68 65 20 65 78 70 6f 73 75 72 65 | of the exposure| 00000530 2e 20 46 6f 72 5c 6e 22 29 3b 0a 20 20 70 72 69 |. For\n");. pri| 00000540 6e 74 66 28 22 69 6e 73 74 61 6e 63 65 2c 20 61 |ntf("instance, a| 00000550 6e 20 65 78 70 6f 73 75 72 65 20 6f 66 20 61 20 |n exposure of a | 00000560 74 68 69 72 74 69 65 74 68 20 6f 66 20 61 20 73 |thirtieth of a s| 00000570 65 63 6f 6e 64 20 73 68 6f 75 6c 64 5c 6e 22 29 |econd should\n")| 00000580 3b 0a 20 20 70 72 69 6e 74 66 28 22 62 65 20 65 |;. printf("be e| 00000590 6e 74 65 72 65 64 20 61 73 20 5c 22 2d 33 30 5c |ntered as \"-30\| 000005a0 22 2e 5c 6e 22 29 3b 0a 20 20 70 72 69 6e 74 66 |".\n");. printf| 000005b0 28 22 41 6c 6c 20 6c 6f 63 61 74 69 6f 6e 73 20 |("All locations | 000005c0 73 68 6f 75 6c 64 20 62 65 20 73 68 6f 72 74 65 |should be shorte| 000005d0 72 20 74 68 61 6e 20 31 30 30 20 63 68 61 72 61 |r than 100 chara| 000005e0 63 74 65 72 73 20 6c 6f 6e 67 2e 5c 6e 22 29 3b |cters long.\n");| 000005f0 0a 0a 2f 2a 20 54 68 65 20 70 72 6f 67 72 61 6d |../* The program| 00000600 20 6e 6f 77 20 67 6f 65 73 20 74 68 72 6f 75 67 | now goes throug| 00000610 68 20 61 20 6c 6f 6f 70 2e 20 54 68 65 20 6c 6f |h a loop. The lo| 00000620 6f 70 20 73 74 61 72 74 73 20 66 72 6f 6d 20 7a |op starts from z| 00000630 65 72 6f 2e 20 54 68 69 73 20 20 2a 2f 0a 2f 2a |ero. This */./*| 00000640 20 69 73 20 64 65 6c 69 62 65 72 61 74 65 2c 20 | is deliberate, | 00000650 61 6e 64 20 69 73 20 62 65 63 61 75 73 65 20 6d |and is because m| 00000660 6f 73 74 20 66 69 6c 6d 73 20 61 63 74 75 61 6c |ost films actual| 00000670 6c 79 20 73 74 61 72 74 20 66 72 6f 6d 20 66 72 |ly start from fr| 00000680 61 6d 65 20 20 20 20 2a 2f 0a 2f 2a 20 7a 65 72 |ame */./* zer| 00000690 6f 2c 20 75 6e 6c 65 73 73 20 79 6f 75 20 67 65 |o, unless you ge| 000006a0 74 20 6f 76 65 72 2d 65 6e 74 68 75 73 69 61 73 |t over-enthusias| 000006b0 74 69 63 20 77 68 69 6c 65 20 6c 6f 61 64 69 6e |tic while loadin| 000006c0 67 20 74 68 65 20 66 69 6c 6d 2e 20 20 20 20 20 |g the film. | 000006d0 20 20 20 2a 2f 0a 0a 20 20 66 6f 72 20 28 69 3d | */.. for (i=| 000006e0 30 3b 20 69 3c 6d 61 78 5f 66 72 61 6d 65 73 3b |0; i<max_frames;| 000006f0 20 69 2b 2b 29 0a 20 20 7b 20 70 72 69 6e 74 66 | i++). { printf| 00000700 28 22 50 6c 65 61 73 65 20 65 6e 74 65 72 20 74 |("Please enter t| 00000710 68 65 20 65 78 70 6f 73 75 72 65 20 6f 66 20 66 |he exposure of f| 00000720 72 61 6d 65 20 25 64 2e 5c 6e 22 2c 69 29 3b 0a |rame %d.\n",i);.| 00000730 20 20 20 20 73 63 61 6e 66 28 22 25 64 22 2c 26 | scanf("%d",&| 00000740 65 78 70 6f 73 75 72 65 5b 69 5d 29 3b 0a 20 20 |exposure[i]);. | 00000750 20 20 70 72 69 6e 74 66 28 22 50 6c 65 61 73 65 | printf("Please| 00000760 20 65 6e 74 65 72 20 74 68 65 20 61 70 65 72 74 | enter the apert| 00000770 75 72 65 20 73 65 74 74 69 6e 67 20 66 6f 72 20 |ure setting for | 00000780 66 72 61 6d 65 20 25 64 2e 5c 6e 22 2c 69 29 3b |frame %d.\n",i);| 00000790 0a 2f 2a 20 54 68 65 20 61 70 65 72 74 75 72 65 |./* The aperture| 000007a0 20 69 73 20 72 65 61 64 20 61 73 20 61 20 66 6c | is read as a fl| 000007b0 6f 61 74 69 6e 67 20 70 6f 69 6e 74 20 6e 75 6d |oating point num| 000007c0 62 65 72 2c 20 61 6e 64 20 74 68 65 20 69 6e 74 |ber, and the int| 000007d0 65 67 65 72 20 61 6e 64 20 20 2a 2f 0a 2f 2a 20 |eger and */./* | 000007e0 74 68 65 20 66 69 72 73 74 20 64 65 63 69 6d 61 |the first decima| 000007f0 6c 20 70 6c 61 63 65 20 70 61 72 74 73 20 6f 66 |l place parts of| 00000800 20 74 68 65 20 6e 75 6d 62 65 72 20 61 72 65 20 | the number are | 00000810 68 65 6c 64 20 69 6e 20 65 6c 65 6d 65 6e 74 73 |held in elements| 00000820 20 6f 6e 65 20 20 2a 2f 0a 2f 2a 20 61 6e 64 20 | one */./* and | 00000830 74 77 6f 20 6f 66 20 74 68 65 20 61 72 72 61 79 |two of the array| 00000840 2e 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |. | 00000850 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 00000870 20 20 2a 2f 0a 20 20 20 20 73 63 61 6e 66 28 22 | */. scanf("| 00000880 25 66 22 2c 26 64 61 74 75 6d 29 3b 0a 20 20 20 |%f",&datum);. | 00000890 20 61 70 65 72 74 75 72 65 5b 69 5d 5b 31 5d 20 | aperture[i][1] | 000008a0 3d 20 28 69 6e 74 29 64 61 74 75 6d 3b 0a 20 20 |= (int)datum;. | 000008b0 20 20 61 70 65 72 74 75 72 65 5b 69 5d 5b 32 5d | aperture[i][2]| 000008c0 20 3d 20 28 64 61 74 75 6d 20 2d 20 61 70 65 72 | = (datum - aper| 000008d0 74 75 72 65 5b 69 5d 5b 31 5d 29 20 2a 20 31 30 |ture[i][1]) * 10| 000008e0 3b 0a 20 20 20 20 70 72 69 6e 74 66 28 22 50 6c |;. printf("Pl| 000008f0 65 61 73 65 20 65 6e 74 65 72 20 74 68 65 20 6c |ease enter the l| 00000900 6f 63 74 69 6f 6e 20 66 6f 72 20 66 72 61 6d 65 |oction for frame| 00000910 20 25 64 2e 5c 6e 22 2c 69 29 3b 0a 2f 2a 20 54 | %d.\n",i);./* T| 00000920 68 65 20 70 72 6f 67 72 61 6d 20 72 65 61 64 73 |he program reads| 00000930 20 61 6e 20 65 78 74 72 61 20 63 68 61 72 61 63 | an extra charac| 00000940 74 65 72 20 74 6f 20 72 69 64 20 74 68 65 20 69 |ter to rid the i| 00000950 6e 70 75 74 20 62 75 66 66 65 72 20 6f 66 20 74 |nput buffer of t| 00000960 68 65 20 20 20 2a 2f 0a 2f 2a 20 65 78 74 72 61 |he */./* extra| 00000970 20 6e 65 77 6c 69 6e 65 20 63 68 61 72 61 63 74 | newline charact| 00000980 65 72 20 77 68 69 63 68 20 77 69 6c 6c 20 62 65 |er which will be| 00000990 20 73 69 74 74 69 6e 67 20 69 6e 20 69 74 20 61 | sitting in it a| 000009a0 74 20 74 68 69 73 20 70 6f 69 6e 74 2e 20 20 20 |t this point. | 000009b0 20 2a 2f 0a 20 20 20 20 67 65 74 63 68 61 72 28 | */. getchar(| 000009c0 29 3b 0a 2f 2a 20 54 68 65 20 67 65 74 73 28 29 |);./* The gets()| 000009d0 20 66 75 6e 63 74 69 6f 6e 20 72 65 61 64 73 20 | function reads | 000009e0 61 20 6c 69 6e 65 20 6f 66 20 74 65 78 74 20 66 |a line of text f| 000009f0 72 6f 6d 20 74 68 65 20 6b 65 79 62 6f 61 72 64 |rom the keyboard| 00000a00 20 69 6e 74 6f 20 61 20 20 20 20 20 2a 2f 0a 2f | into a */./| 00000a10 2a 20 73 74 72 69 6e 67 2e 20 49 74 20 74 61 6b |* string. It tak| 00000a20 65 73 20 61 73 20 61 6e 20 61 72 67 75 6d 65 6e |es as an argumen| 00000a30 74 20 61 20 70 6f 69 6e 74 65 72 20 74 6f 20 74 |t a pointer to t| 00000a40 68 65 20 73 74 72 69 6e 67 2e 20 54 68 69 73 20 |he string. This | 00000a50 63 6f 75 6c 64 20 20 20 2a 2f 0a 2f 2a 20 62 65 |could */./* be| 00000a60 20 77 72 69 74 74 65 6e 20 27 26 70 6c 61 63 65 | written '&place| 00000a70 5b 69 5d 5b 30 5d 27 2c 20 73 69 6e 63 65 20 74 |[i][0]', since t| 00000a80 68 61 74 20 69 73 20 77 68 65 72 65 20 77 65 20 |hat is where we | 00000a90 77 61 6e 74 20 74 68 65 20 73 74 72 69 6e 67 20 |want the string | 00000aa0 20 20 20 20 2a 2f 0a 2f 2a 20 74 6f 20 67 6f 2c | */./* to go,| 00000ab0 20 62 75 74 20 74 68 69 73 20 69 73 20 6a 75 73 | but this is jus| 00000ac0 74 20 61 20 70 6f 69 6e 74 65 72 20 74 6f 20 65 |t a pointer to e| 00000ad0 6c 65 6d 65 6e 74 20 7a 65 72 6f 20 6f 66 20 74 |lement zero of t| 00000ae0 68 65 20 61 72 72 61 79 20 61 6e 64 20 20 20 20 |he array and | 00000af0 2a 2f 0a 2f 2a 20 73 6f 20 63 61 6e 20 61 6c 73 |*/./* so can als| 00000b00 6f 20 62 65 20 77 72 69 74 74 65 6e 20 27 70 6c |o be written 'pl| 00000b10 61 63 65 5b 69 5d 27 2e 20 49 66 20 79 6f 75 20 |ace[i]'. If you | 00000b20 68 61 76 65 20 61 20 43 20 63 6f 6d 70 69 6c 65 |have a C compile| 00000b30 72 2c 20 79 6f 75 20 63 61 6e 20 20 2a 2f 0a 2f |r, you can */./| 00000b40 2a 20 6f 66 20 63 6f 75 72 73 65 20 63 68 65 63 |* of course chec| 00000b50 6b 20 74 68 69 73 2e 20 20 20 20 20 20 20 20 20 |k this. | 00000b60 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 00000b80 20 20 20 20 20 20 20 20 2a 2f 0a 20 20 20 20 67 | */. g| 00000b90 65 74 73 28 70 6c 61 63 65 5b 69 5d 29 3b 0a 20 |ets(place[i]);. | 00000ba0 20 7d 0a 0a 2f 2a 20 54 68 65 20 6e 65 78 74 20 | }../* The next | 00000bb0 6c 6f 6f 70 20 70 72 69 6e 74 73 20 6f 75 74 20 |loop prints out | 00000bc0 61 6c 6c 20 74 68 65 20 76 61 6c 75 65 73 20 74 |all the values t| 00000bd0 68 61 74 20 77 65 20 68 61 76 65 20 6a 75 73 74 |hat we have just| 00000be0 20 69 6e 70 75 74 2e 20 20 20 20 20 20 2a 2f 0a | input. */.| 00000bf0 20 20 66 6f 72 20 28 69 3d 30 3b 20 69 3c 6d 61 | for (i=0; i<ma| 00000c00 78 5f 66 72 61 6d 65 73 3b 20 69 2b 2b 29 0a 20 |x_frames; i++). | 00000c10 20 7b 20 70 72 69 6e 74 66 28 22 45 78 70 6f 73 | { printf("Expos| 00000c20 75 72 65 20 25 64 20 77 61 73 20 74 61 6b 65 6e |ure %d was taken| 00000c30 20 61 74 20 25 73 5c 6e 22 2c 69 2c 70 6c 61 63 | at %s\n",i,plac| 00000c40 65 5b 69 5d 29 3b 0a 20 20 20 20 69 66 20 28 65 |e[i]);. if (e| 00000c50 78 70 6f 73 75 72 65 5b 69 5d 20 3e 20 30 29 0a |xposure[i] > 0).| 00000c60 20 20 20 20 7b 20 70 72 69 6e 74 66 28 22 77 69 | { printf("wi| 00000c70 74 68 20 61 6e 20 65 78 70 6f 73 75 72 65 20 6f |th an exposure o| 00000c80 66 20 25 64 20 22 2c 65 78 70 6f 73 75 72 65 5b |f %d ",exposure[| 00000c90 69 5d 29 3b 20 7d 20 65 6c 73 65 0a 20 20 20 20 |i]); } else. | 00000ca0 7b 20 70 72 69 6e 74 66 28 22 77 69 74 68 20 61 |{ printf("with a| 00000cb0 6e 20 65 78 70 6f 73 75 72 65 20 6f 66 20 31 2f |n exposure of 1/| 00000cc0 25 64 20 22 2c 2d 65 78 70 6f 73 75 72 65 5b 69 |%d ",-exposure[i| 00000cd0 5d 29 3b 20 7d 0a 20 20 20 20 70 72 69 6e 74 66 |]); }. printf| 00000ce0 28 22 61 6e 64 20 61 6e 20 61 70 65 72 74 75 72 |("and an apertur| 00000cf0 65 20 6f 66 20 25 64 2e 25 64 2e 5c 6e 5c 6e 22 |e of %d.%d.\n\n"| 00000d00 2c 61 70 65 72 74 75 72 65 5b 69 5d 5b 31 5d 2c |,aperture[i][1],| 00000d10 61 70 65 72 74 75 72 65 5b 69 5d 5b 32 5d 29 3b |aperture[i][2]);| 00000d20 0a 20 20 7d 0a 2f 2a 20 53 69 6e 63 65 20 6d 61 |. }./* Since ma| 00000d30 69 6e 28 29 20 69 73 20 74 65 63 68 6e 69 63 61 |in() is technica| 00000d40 6c 6c 79 20 61 20 66 75 6e 63 74 69 6f 6e 2c 20 |lly a function, | 00000d50 77 65 20 73 68 6f 75 6c 64 20 72 65 74 75 72 6e |we should return| 00000d60 20 7a 65 72 6f 20 66 72 6f 6d 20 20 20 20 2a 2f | zero from */| 00000d70 0a 2f 2a 20 69 74 20 74 6f 20 72 65 61 73 73 75 |./* it to reassu| 00000d80 72 65 20 74 68 65 20 6d 61 63 68 69 6e 65 20 74 |re the machine t| 00000d90 68 61 74 20 65 76 65 72 79 74 68 69 6e 67 20 68 |hat everything h| 00000da0 61 73 20 67 6f 6e 65 20 77 65 6c 6c 2e 20 44 6f |as gone well. Do| 00000db0 6e 27 74 20 20 20 20 20 20 20 2a 2f 0a 2f 2a 20 |n't */./* | 00000dc0 77 6f 72 72 79 20 61 62 6f 75 74 20 74 68 69 73 |worry about this| 00000dd0 20 66 6f 72 20 74 68 65 20 6d 6f 6d 65 6e 74 2e | for the moment.| 00000de0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 00000e00 20 20 20 20 20 20 2a 2f 0a 20 20 72 65 74 75 72 | */. retur| 00000e10 6e 20 30 3b 0a 7d 0a |n 0;.}.| 00000e17