/* meteor.tc /* Meteor shower program, by T. A. Gibson, Nov. 1977. /* Demonstrates use of random and plot. /* implemented lrb - 12/3/2007 /* added chide, cnormal - 12/6,9/2007 int speed /* main program star [ speed=2000 /* set speed cls /* clear screen 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 /* hide text cursor /* fill screen with fixed stars while ((k=k+1)big) 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=24;C=80 if ((r>=1)*(r<=R)*(c>=1)*(c<=C)==0) return 1 MC '\'-1-'@',1 /* left bracket = backslash - 1 MC '\'-1,1 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 ] /* clear screen cls [ MC '\'-1-'@',1 MC '\'-1,1 MC '2',1 MC 'J',1 ] /* pause k units pause int k [ int l;while ((l=l+1)