/* meteor.tc /* Meteor shower program, by T. A. Gibson, Nov. 1977. /* Demonstrates use of random and plot. /* implemented lrb - 12/3/7 /* added chide, cnormal - 12/6,9/7 /* changed screen dimensions to 50x80 - removed several functions /* which are now in the system library - 5/17/9 int speed star [ speed=2000;cls pl "Please enter a random number between 0 and 100 ";seed=last=gn int k,stars,shoots ps "How many fixed stars do your want? ";stars=gn ps "How many shooting stars do you want? ";shoots=gn cls;chide /* fill screen with fixed stars while (++kbig) break /* large shooting stars, aka cruisers, erase nearby fixed stars if (big>3) [ plot k-big,start+1+delta*(k-big),0 pause speed plot k-big,start-1+delta*(k-big),0 pause speed ] ] ] /* positions cursor at row r, col c if on screen and returns 0 /* just returns 1 if off screen int R,C plot int r,c,onoff [ R=50;C=80 if ((r>=1)*(r<=R)*(c>=1)*(c<=C)==0) return 1 MC 27,1 /* ESC MC 91,1 /* left bracket pos r;MC ';',1;pos c MC 'H',1 if (onoff) MC '*',1;else MC ' ',1 return 0 ] /* helper function for plot pos int rc [ if (rc>9) [ MC rc/10+48,1;rc=rc%10 ] MC rc+48,1 ] pause int k [ int l;while (++l