From: Steffen Nurpmeso <steffen@sdaoden.eu>
To: tuhs@tuhs.org
Subject: Re: [TUHS] Space Travel, was New: The Earliest UNIX Code
Date: Fri, 18 Oct 2019 20:36:10 +0200 [thread overview]
Message-ID: <20191018183610.diq_a%steffen@sdaoden.eu> (raw)
In-Reply-To: <201910181152.x9IBq95P001809@coolidge.cs.Dartmouth.EDU>
[-- Attachment #1: Type: text/plain, Size: 2011 bytes --]
Doug McIlroy wrote in <201910181152.x9IBq95P001809@coolidge.cs.Dartmouth\
.EDU>:
|> 10-36-55.pdf user-mode programs: pool game
|
|This game, written by ken, used the Graphic 2. One of its
|earliest tests--random starting positions and velocities on
|a frictionless table with no collision detection--produced
|a mesmerizing result. This was saved in a program called
|"weird1", which was carried across to the PDP11.
|
|Weird1 was a spectacular accidental demonstration of structure
|in pseudo-random numbers. After several minutes the dots
|representing pool balls would evanescently form short local
|alignments. Thereafter from time to time ever-larger alignments
|would materialize. Finally in a grand climax all the balls
|converged to a single point.
|
|It was stunning to watch perfect order emerge from apparent
|chaos. One of my fondest hopes is to see weird1 revived.
Not about random orders chaos, no, quite the opposite, but the
IOCCC context 2012 was won by endoh1, a fluid simulator using
"Smoothed-particle hydrodynamics (SPH)", and the "marching
squares" algorithm to render particles. If the defaults for
gravity (1 -> 0), pressure (4 -> 1) and viscosity (8 -> 2) are
changed entertaining effects can be seen.
It is like swirling, not self-organizing order out of chaos, but
i wanted to post it nonetheless because of some properties of the
code, for example the IOCCC Makefile introduces "make love", may
also echo "You are not expected to understand this", and what else
can be expected. The xxx.txt is an input file i made for this
post, the competition ones are neat (a fountain, for example), but
for normal gravity etc.
$ make endoh1_color
$ ./endoh1_color < xxx.txt
And spend some time.
|Doug
--End of <201910181152.x9IBq95P001809@coolidge.cs.Dartmouth.EDU>
--steffen
|
|Der Kragenbaer, The moon bear,
|der holt sich munter he cheerfully and one by one
|einen nach dem anderen runter wa.ks himself off
|(By Robert Gernhardt)
[-- Attachment #2: endoh1_color.c --]
[-- Type: text/x-csrc, Size: 2275 bytes --]
# include<stdio.h>// .IOCCC Fluid- #
# include <unistd.h> //2012 _Sim!_ #
# include<complex.h> //|||| ,____. |||||| #
# define c y+=( x=ctanh( -cabs/* #
# */(4[t ]-=20) /2+9)* 3+3)*// #
# define f(p,e) for(p/* #
# */=a;e ,p<r;p +=5)/// #
# define z(e,i) f(p,p/* #
## */[i]=e)f(q,w=cabs (d=*p- *q)/2- 1)if(0 <(x=1- w))p[i]+=w*/// ##
double complex a [ 97687] ,*p,*q ,*r=a, w=0,d; char b[97687]=/* ##
## */"GO\x1b[2J\x1b[" "1;1H" ,*o=b, *t;int x,y,j; void h(int e){/** ##
## */for( t=b;b+ 24045> (t+=12 );c 6, sprintf (t,/** ##
## */"%c" "[48%" "c5;%" "03dm" "%c",3 *9,e,c 36,e/* ##
## */?(t- b)%960 ?(15-t [11])[ "\x23" "/\\_" "\\"/* ##
## */"||" ",//|" ".-`' "]:10: 0)) y= 0020,c 01;}/* ##
## */void g( int i){7[t +=i]|= x/=2;* t+=y=p [2];/* ##
## */}int main() {for(;( x=getc (stdin ))>0;)w =10</* ##
## */x?32 <x?4[* r++=w,r]=w+1,*r= r[5]=x ==35,r+=9:0,w-I/* ##
## */:(x= w+02); for(;;puts(o),o =b+6){ z(p[1]*9,2)w;z/* ##
## */(G,3 )(d*(3 -p[2]-q[2])*P +p[4]* V-q[4]*V )/p/* ##
#### ####
###############################################################################
**###########################################################################*/
[2];h(0 );f(p,* p+= p[4]+=p [3]/10*!p
[1] )(t =b+ 16+ (x= *p* I)* 12+ 960
*(y =*p /2) ,x= 0<= x&& 79> x&&
0<= y&& 23> y?x =16 ,g( 0),g(12),
g(+ 948 ),g (12 ),0 :0) ;h( 59) ;;;
usleep( 12321); }return 0;} /*IOCCC '12 **/
[-- Attachment #3: Makefile --]
[-- Type: text/plain, Size: 4048 bytes --]
#!/usr/bin/env make
#
# 2012 makefile
#
# This work by Landon Curt Noll, Simon Cooper, and Leonid A. Broukhis
# is licensed under:
#
# Creative Commons Attribution-ShareAlike 3.0 Unported License.
#
# See: http://creativecommons.org/licenses/by-sa/3.0/
################
# tool locations
################
#
SHELL= /bin/bash
CP= cp
CPP= cpp
GUNZIP= gunzip
LD= ld
MAKE= make
RM= rm
SED= sed
TAR= tar
TRUE= true
# Set X11_LIBDIR to the directory where the X11 library resides
#
X11_LIBDIR= /usr/X11R6/lib
# Set X11_INCLUDEDIR to the directory where the X11 include files reside
#
X11_INCDIR= /usr/X11R6/include
# Compiler warnings
#
#CWARN=
#CWARN= -Wall -W
CWARN= -Wall -W -pedantic
# compiler standard
#
#CSTD=
#CSTD= -ansi
CSTD= -std=c99
# compiler bit architecture
#
# Some entries require 32-bitness:
# ARCH= -m32
#
# Some entries require 64-bitess:
# ARCH= -m64
#
# By default we assume nothing:
#
ARCH=
# optimization
#
# Most compiles will safely use -O2. Some can use only -O1 or -O.
# A few compilers have broken optimizers or this entry make break
# under those buggy optimizers and thus you may not want anything.
#
#OPT=
#OPT= -O
#OPT= -O1
OPT= -O2
#OPT= -O3
# Libraries needed to build
#
LIBS= -lm
# default flags for ANSI C compilation
#
CFLAGS= ${CWARN} ${CSTD} ${ARCH} ${OPT}
# ANSI compiler
#
# Set CC to the name of your ANSI compiler.
#
# Some entries seem to need gcc. If you have gcc, set
# both CC and MAY_NEED_GCC to gcc.
#
# If you do not have gcc, set CC to the name of your ANSI compiler, and
# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just :
# to disable such programs.
#
CC= cc
#CC=clang
MAY_NEED_GCC= gcc
##############################
# Special flags for this entry
##############################
#
ENTRY= endoh1
DATA= column.txt column2.txt column3.txt corners.txt dripping-pan.txt \
evaporation.txt flat.txt fountain.txt funnel.txt funnel2.txt \
funnel3.txt leidenfrost.txt logo.txt pour-out.txt tanada.txt
ALT_OBJ= endoh1_color.o
ALT_ENTRY= endoh1_color
# The factor of gravity
#
G=0
# The factor of pressure
#
P=1
# The factor of viscosity
#
V=2
#################
# build the entry
#################
#
all: ${ENTRY} ${DATA}
@${TRUE}
${ENTRY}: ${ENTRY}.c
${CC} ${CFLAGS} -DG=$G -DP=$P -DV=$P $< -o $@ ${LIBS}
# alternative executable
#
alt: ${ALT_ENTRY}
@${TRUE}
endoh1_deobfuscate: endoh1_deobfuscate.c
${CC} ${CFLAGS} -DG=$G -DP=$P -DV=$P $< -o $@ ${LIBS}
endoh1_color: endoh1_color.c
${CC} ${CFLAGS} -DG=$G -DP=$P -DV=$P $< -o $@ ${LIBS}
# data files
#
data: ${DATA}
@${TRUE}
###############
# utility rules
###############
#
everything: all alt
clean:
${RM} -f ${ENTRY}.o ${ALT_OBJ}
clobber: clean
${RM} -f ${ENTRY} ${ALT_ENTRY}
nuke: clobber
@${TRUE}
dist_clean: nuke
@${TRUE}
install:
@echo "Surely you're joking Mr. Feynman!"
@${TRUE}
# backwards compatibility
#
build: all
@${TRUE}
##################
# 133t hacker rulz
##################
#
love:
@echo 'not war?'
@${TRUE}
haste:
$(MAKE) waste
@${TRUE}
waste:
@echo 'waste'
@${TRUE}
easter_egg:
@echo you expected to mis-understand this $${RANDOM} magic
@echo chongo '<was here>' "/\\oo/\\"
@echo Readers shall be disallowed from not being unable to partly misunderstand this partocular final echo.
# Understand the history of "I Am the Walrus" and
# and in particular John Lennon's remarks on that
# song and you might be confused about these next
# rules in a different way. :-)
#
supernova: nuke
@-if [ -r .code_anal ]; then \
${RM} -f .code_anal_v3; \
else \
echo "You are not expected to understand this"; \
fi
@${TRUE}
deep_magic:
@-if [ -r .code_anal ]; then \
ccode_analysis --deep_magic 1c2c85c7a02c55d1add91967eca491d53c101dc1 --FNV1a_hash 256-bit "${ENTRY}"; \
else \
echo "Understand different"; \
fi
@${TRUE}
magic: deep_magic
@-if [ -r .code_anal ]; then \
ccode_analysis --mode 21701 --level 23209 --FNV1a_hash 256-bit "${ENTRY}"; \
else \
echo "These aren't the droids you're looking for Mr. Spock!"; \
fi
@${TRUE}
[-- Attachment #4: xxx.txt --]
[-- Type: text/plain, Size: 1844 bytes --]
@
###############################################################################
# xxxxxxxxxxxxxxxxxxxxxxxxxxxx #
# xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx #
# #
# #
# #
# #
# xxxxxxxxxxxxxxxxxxxxxx #
# xxxxxxxxxxxxxxxxxxxxxx #
# xxxxxxxxxxxxxxxxxxxxxx #
# #
# #
# #
# #
# #
# #
# #
# @@@@@@@@@@@@@@@@@@@@@@ #
# @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@ #
# @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@ #
# #
###############################################################################
next prev parent reply other threads:[~2019-10-18 18:36 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-18 11:52 Doug McIlroy
2019-10-18 18:36 ` Steffen Nurpmeso [this message]
2019-10-18 20:19 ` SPC
2019-10-18 22:04 ` Ken Thompson via TUHS
2019-10-18 23:20 ` Arthur Krewat
2019-10-19 0:57 ` G. Branden Robinson
2019-10-19 1:11 ` Arthur Krewat
2019-10-29 2:18 ` Lawrence Stewart
2019-10-26 15:10 ` Lars Brinkhoff
-- strict thread matches above, loose matches on Subject: below --
2019-10-19 14:40 Doug McIlroy
2019-10-19 18:32 ` Abhinav Rajagopalan
2019-10-19 18:44 ` Abhinav Rajagopalan
2019-10-19 19:19 ` Clem Cole
2019-10-19 19:50 ` Henry Bent
2019-10-19 20:24 ` Arthur Krewat
2019-10-19 13:13 Doug McIlroy
2019-10-17 19:21 [TUHS] New: The Earliest UNIX Code - From the Collection of the Software History Center, Computer History Museum Lyle Bickley
2019-10-17 20:44 ` [TUHS] Space Travel, was New: The Earliest UNIX Code Warren Toomey
2019-10-17 22:39 ` Warner Losh
2019-10-17 22:51 ` Warren Toomey
2019-10-18 5:59 ` Lars Brinkhoff
2019-10-18 9:30 ` SPC
2019-10-18 17:36 ` Nemo
2019-10-18 3:01 ` Warren Toomey
2019-10-18 5:07 ` Lars Brinkhoff
2019-10-18 5:10 ` Lars Brinkhoff
2019-10-18 13:37 ` Warner Losh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191018183610.diq_a%steffen@sdaoden.eu \
--to=steffen@sdaoden.eu \
--cc=tuhs@tuhs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).