Galaxy: Miscelanious program From: saschreu@cs.vu.nl (Schreuder SA) Date: Wed, 11 Nov 1992 13:14:48 +0000 I wrote a program to calculate when a ship is safe. The usage is: SAFE shield-strength size It is based on KILLPROB by Russell Wallace. Sjoerd Schreuder, "Zwagonian" in Galaxy 7 ---- START SAFE.c ---- #include <stdio.h> #include <stdlib.h> #include <math.h> main (int argc,char **argv) { double weapons,shields,size,ShiStr; if (argc != 3) { printf ("Program to calculate probability of one Galaxy ship killing another\n" "by Sjoerd Schreuder 11 November 1992\n" "Usage: SAFE shield-strength size\n" "This program is in the public domain\n"); return 1; } shields = atof (argv[1]); size = atof (argv[2]); ShiStr = (shields / pow (size,1.0/3.0) * pow (30.0,1.0/3.0)); printf("Safe against %.2lf, no chance against %.2lf, 50/50 against %.2lf\n", ShiStr /4, ShiStr * 4, ShiStr); return 0; } Up