linux build

This commit is contained in:
David Lee 2024-07-04 09:40:33 -07:00
parent 2329ed370e
commit 1f9b81740a
6 changed files with 12 additions and 77 deletions

12
Microsoft C v203/m.sh Normal file
View File

@ -0,0 +1,12 @@
str=$(tr '[a-z]' '[A-Z]' <<< $1)
rm $str.OBJ 2>/dev/null
rm $str.MAP 2>/dev/null
rm $str.EXE 2>/dev/null
ntvdm -r:. -u mc1 $str
ntvdm -r:. -u mc2 $str
ntvdm -r:. -u link $str + cs + gettm,, $str.map, mcs
rm $str.OBJ 2>/dev/null
rm $str.MAP 2>/dev/null

View File

@ -1,31 +0,0 @@
#include <stdio.h>
#define unsigned
typedef unsigned long uint32_t;
int main()
{
uint32_t limit = 40;
uint32_t prev2 = 1;
uint32_t prev1 = 1;
uint32_t next, i, last_shown = 0;
printf( "should tend towards 1.61803398874989484820458683436563811772030\n" );
for ( i = 1; i <= limit; i++ )
{
next = prev1 + prev2;
prev2 = prev1;
prev1 = next;
if ( i == ( last_shown + 5 ) )
{
last_shown = i;
printf( " at %2lu iterations: %lf\n", i, (double) prev1 / (double) prev2 );
}
}
printf( "done\n" );
return 0;
}

View File

@ -1,46 +0,0 @@
#include <stdio.h>
#define HIGH_MARK 500 /* 2800 */
static long r[HIGH_MARK + 1];
int main() {
long i, k, c;
long b, d;
long iter;
int iterations = 1;
for ( iter = 0; iter < iterations; iter++ ) {
c = 0;
for (i = 0; i < HIGH_MARK; i++) {
r[i] = 2000;
}
for (k = HIGH_MARK; k > 0; k -= 14) {
d = 0;
i = k;
for (;;) {
d += r[i] * 10000;
b = 2 * i - 1;
r[i] = d % b;
d /= b;
i--;
if (i == 0) break;
d *= i;
}
if ( iter == ( iterations - 1 ) )
{
printf( "%.4d", c + d / 10000 );
fflush( stdout );
}
c = d % 10000;
}
}
printf( "\n" );
return 0;
}