release winning entries of IOCCC28 under the year 2024
Congratulations to: * 2024/anders - Prize in sound coding - layered music generator * 2024/burton - Prize in pentagrammatology - wordle hard mode solver * 2024/cable1 - Prize in bot talk - LLM inference engine * 2024/cable2 - Prize in murky waters - salmon recipe * 2024/carlini - Prize in perfect timing - Intel 4004 emulation * 2024/codemeow - Prize in tray planting - bonsai generator * 2024/endoh1 - Prize in patient pointillism - slow ray tracer in CPP * 2024/endoh2 - Prize in solid body physics - rotating rigid body simulation * 2024/ferguson1 - Prize in diabolical logistics - Oregon trail pact with the devil * 2024/ferguson2 - Prize in yil-tas - Navajo code talker translator * 2024/howe - Nice accent eh-ward - mini vi * 2024/kramer - Prize in linguistic arithmetic - natural language numerical calculator * 2024/kurdyukov1 - Prize in phased periodicity - phase of the Moon * 2024/kurdyukov2 - Prize in art restoration - JPEG artifact removal * 2024/kurdyukov3 - Prize in virtual quietus - gaming VM and doom * 2024/kurdyukov4 - Prize in embiggening - encode without literals * 2024/maffiodo - Prize in creative interpretation - Jav\*script interpreter * 2024/mills - Prize in ℤ₃ - Infocom v3 story interpreter * 2024/stedolan - Best one liner - icon from MD5 * 2024/straadt - Prize in imitative rebooting - OpenRISC CPU and Linux * 2024/tmarrec - Prize in cyclonic coding - 3D tornado simulation * 2024/tompng - Prize in quasi bijection - vortex encryptor decryptor * 2024/weaver - Sur prize - rickroll Ran `make update` to perform the above. new file: 2024/burton/.entry.json
This commit is contained in:
1 parent
10512e6c79
commit
09750f8899
443 files changed
+182938
-231
No files matched your search
@@ -0,0 +1,105 @@
|
||||
{
|
||||
"no_comment" : "mandatory comment: because comments were removed from the original JSON spec",
|
||||
"entry_JSON_format_version" : "1.2 2024-09-25",
|
||||
"award" : "Prize in cyclonic coding",
|
||||
"year" : 2024,
|
||||
"dir" : "tmarrec",
|
||||
"entry_id" : "2024_tmarrec",
|
||||
"title" : "tornado",
|
||||
"abstract" : "3D tornado simulation",
|
||||
"author_set" : [
|
||||
{
|
||||
"author_handle" : "Tristan_Marrec"
|
||||
}
|
||||
],
|
||||
"manifest" : [
|
||||
{
|
||||
"file_path" : "prog.c",
|
||||
"inventory_order" : 20,
|
||||
"OK_to_edit" : true,
|
||||
"display_as" : "c",
|
||||
"display_via_github" : true,
|
||||
"entry_text" : "entry source code"
|
||||
},
|
||||
{
|
||||
"file_path" : "Makefile",
|
||||
"inventory_order" : 30,
|
||||
"OK_to_edit" : true,
|
||||
"display_as" : "makefile",
|
||||
"display_via_github" : true,
|
||||
"entry_text" : "entry Makefile"
|
||||
},
|
||||
{
|
||||
"file_path" : "prog.alt.c",
|
||||
"inventory_order" : 40,
|
||||
"OK_to_edit" : true,
|
||||
"display_as" : "c",
|
||||
"display_via_github" : true,
|
||||
"entry_text" : "alternate source code"
|
||||
},
|
||||
{
|
||||
"file_path" : "prog.orig.c",
|
||||
"inventory_order" : 50,
|
||||
"OK_to_edit" : false,
|
||||
"display_as" : "c",
|
||||
"display_via_github" : true,
|
||||
"entry_text" : "original source code"
|
||||
},
|
||||
{
|
||||
"file_path" : "try.sh",
|
||||
"inventory_order" : 100,
|
||||
"OK_to_edit" : true,
|
||||
"display_as" : "shellscript",
|
||||
"display_via_github" : true,
|
||||
"entry_text" : "script to try entry"
|
||||
},
|
||||
{
|
||||
"file_path" : "2024_tmarrec.tar.bz2",
|
||||
"inventory_order" : 1415926535,
|
||||
"OK_to_edit" : false,
|
||||
"display_as" : "tbz2",
|
||||
"display_via_github" : false,
|
||||
"entry_text" : "download entry tarball"
|
||||
},
|
||||
{
|
||||
"file_path" : ".entry.json",
|
||||
"inventory_order" : 4000000000,
|
||||
"OK_to_edit" : true,
|
||||
"display_as" : "json",
|
||||
"display_via_github" : true,
|
||||
"entry_text" : "entry summary and manifest in JSON"
|
||||
},
|
||||
{
|
||||
"file_path" : ".gitignore",
|
||||
"inventory_order" : 4000000000,
|
||||
"OK_to_edit" : true,
|
||||
"display_as" : "gitignore",
|
||||
"display_via_github" : true,
|
||||
"entry_text" : "list of files that should not be committed under git"
|
||||
},
|
||||
{
|
||||
"file_path" : ".path",
|
||||
"inventory_order" : 4000000000,
|
||||
"OK_to_edit" : false,
|
||||
"display_as" : "path",
|
||||
"display_via_github" : false,
|
||||
"entry_text" : "directory path from top level directory"
|
||||
},
|
||||
{
|
||||
"file_path" : "README.md",
|
||||
"inventory_order" : 4000000000,
|
||||
"OK_to_edit" : true,
|
||||
"display_as" : "markdown",
|
||||
"display_via_github" : true,
|
||||
"entry_text" : "markdown source for this web page"
|
||||
},
|
||||
{
|
||||
"file_path" : "index.html",
|
||||
"inventory_order" : 4294967295,
|
||||
"OK_to_edit" : false,
|
||||
"display_as" : "html",
|
||||
"display_via_github" : false,
|
||||
"entry_text" : "this web page"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
#
|
||||
# sort with: ../../bin/sgi.sh
|
||||
*~
|
||||
*.dSYM
|
||||
*.o
|
||||
.DS_Store
|
||||
.*.swp
|
||||
@@ -0,0 +1 @@
|
||||
2024/tmarrec
|
||||
Binary file not shown.
@@ -0,0 +1,213 @@
|
||||
#!/usr/bin/env make
|
||||
#
|
||||
# 2024/tmarrec
|
||||
|
||||
#############################
|
||||
# shell used by this Makefile
|
||||
#############################
|
||||
|
||||
SHELL= bash
|
||||
|
||||
|
||||
#######################
|
||||
# common tool locations
|
||||
#######################
|
||||
|
||||
include ../../var.mk
|
||||
|
||||
|
||||
#####################
|
||||
# C compiler settings
|
||||
#####################
|
||||
|
||||
# Common C compiler warnings to silence
|
||||
#
|
||||
# Example: CSILENCE= -Wno-poison-system-directories
|
||||
#
|
||||
CSILENCE= -Wno-strict-prototypes -Wno-parentheses -Wno-strict-aliasing
|
||||
|
||||
# Attempt to silence unknown warning options
|
||||
#
|
||||
CUNKNOWN= -Wno-unknown-warning-option
|
||||
|
||||
# Common C compiler warning flags
|
||||
#
|
||||
# NOTE: The addition of -pedantic to CWARN is a challenge that
|
||||
# You may wish to avoid if it proves too problematic.
|
||||
# There is NO penalty for removing -pedantic from CWARN.
|
||||
#
|
||||
CWARN= -Wall -Wextra -pedantic ${CSILENCE} ${CUNKNOWN}
|
||||
|
||||
# Compiler standard
|
||||
#
|
||||
CSTD= -std=gnu17
|
||||
|
||||
# Compiler bit architecture
|
||||
#
|
||||
# Example for 32-bitness: ARCH= -m32
|
||||
# Example for 64-bitness: ARCH= -m64
|
||||
#
|
||||
# NOTE: Normally one should NOT specify a specific architecture.
|
||||
#
|
||||
ARCH=
|
||||
|
||||
# Defines that are needed to compile
|
||||
#
|
||||
# Example: -Dfoo -Dbar=baz
|
||||
#
|
||||
CDEFINE=
|
||||
|
||||
# Include files that are needed to compile
|
||||
#
|
||||
# Example: CINCLUDE= -include stdio.h
|
||||
#
|
||||
CINCLUDE=-include stdio.h
|
||||
|
||||
# Other flags to pass to the C compiler
|
||||
#
|
||||
# Example: COTHER= -fno-math-errno
|
||||
#
|
||||
COTHER= -ffast-math -DQ='fputs("\033[H",stdout);'
|
||||
|
||||
# Optimization
|
||||
#
|
||||
# NOTE: Feel free to change the level of compiler optimization.
|
||||
# The "-O3" is just a friendly default you might wish to try.
|
||||
#
|
||||
# Example: OPT= -O0 -g
|
||||
#
|
||||
OPT= -O3
|
||||
|
||||
# Default flags for ANSI C compilation
|
||||
#
|
||||
CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${COTHER} ${OPT}
|
||||
|
||||
# Libraries needed to build
|
||||
#
|
||||
# Example: LDFLAGS= -lncurses -lm
|
||||
#
|
||||
LDFLAGS=
|
||||
|
||||
# C compiler to use
|
||||
#
|
||||
# NOTE: The IOCCC Judges recommend you leave CC as just "cc"
|
||||
# and NOT set it to clang, or gcc, or something else
|
||||
# unless you have a STRONG reason to do so.
|
||||
#
|
||||
# Setting CC to something other than "cc" makes your
|
||||
# code less portable to those who do not have your
|
||||
# particular C compiler. **hint**
|
||||
#
|
||||
# If you want to test your code with a particular C compiler,
|
||||
# use the make command line. For example:
|
||||
#
|
||||
# make all CC=clang
|
||||
# make all CC=gcc
|
||||
#
|
||||
CC= cc
|
||||
|
||||
# Compiler add-ons or replacements for clang only
|
||||
#
|
||||
ifeq "$(findstring $(CLANG),${CC})" "$(CLANG)"
|
||||
#
|
||||
# NOTE: This code is only invoked when CC is "clang"
|
||||
# such as when you use the make command line:
|
||||
#
|
||||
# make all CC=clang
|
||||
#
|
||||
CSILENCE+= -Wno-comma -Wno-declaration-after-statement -Wno-double-promotion \
|
||||
-Wno-float-conversion -Wno-implicit-float-conversion \
|
||||
-Wno-implicit-int-conversion -Wno-missing-prototypes \
|
||||
-Wno-missing-variable-declarations -Wno-poison-system-directories \
|
||||
-Wno-shadow -Wno-strict-prototypes -Wno-unsafe-buffer-usage
|
||||
#
|
||||
CWARN+= -Weverything
|
||||
#
|
||||
endif
|
||||
|
||||
# Specific add-ons or replacements for gcc only
|
||||
#
|
||||
ifeq "$(findstring $(GCC),${CC})" "$(GCC)"
|
||||
#
|
||||
# NOTE: This code is only invoked when CC is "gcc"
|
||||
# such as when you use the make command line:
|
||||
#
|
||||
# make all CC=gcc
|
||||
#
|
||||
CSILENCE+=
|
||||
#
|
||||
CWARN+=
|
||||
#
|
||||
endif
|
||||
|
||||
|
||||
###########################################
|
||||
# Special Makefile variables for this entry
|
||||
###########################################
|
||||
|
||||
ENTRY= prog
|
||||
PROG= ${ENTRY}
|
||||
#
|
||||
OBJ= ${PROG}.o
|
||||
TARGET= ${PROG}
|
||||
#
|
||||
ALT_OBJ= ${PROG}.alt.o
|
||||
ALT_TARGET= ${PROG}.alt
|
||||
|
||||
# list any data files supplied with your submission
|
||||
#
|
||||
# Example: DATA= curds whey
|
||||
#
|
||||
DATA=
|
||||
|
||||
|
||||
#################
|
||||
# build the entry
|
||||
#################
|
||||
|
||||
all: data ${TARGET}
|
||||
@${TRUE}
|
||||
|
||||
.PHONY: all alt data everything clean clobber
|
||||
|
||||
# how to compile
|
||||
#
|
||||
${PROG}: ${PROG}.c
|
||||
${CC} ${CFLAGS} ${PROG}.c -o $@ ${LDFLAGS}
|
||||
|
||||
# alternative executable
|
||||
#
|
||||
alt: data ${ALT_TARGET}
|
||||
@${TRUE}
|
||||
|
||||
${PROG}.alt: ${PROG}.alt.c
|
||||
${CC} ${CFLAGS} ${PROG}.alt.c -o $@ ${LDFLAGS}
|
||||
|
||||
# data files
|
||||
#
|
||||
data: ${DATA}
|
||||
@${TRUE}
|
||||
|
||||
# both all and alt
|
||||
#
|
||||
everything: all alt
|
||||
@${TRUE}
|
||||
|
||||
|
||||
###############
|
||||
# utility rules
|
||||
###############
|
||||
#
|
||||
clean:
|
||||
${RM} -f ${OBJ} ${ALT_OBJ}
|
||||
|
||||
clobber: clean
|
||||
${RM} -f ${TARGET} ${ALT_TARGET}
|
||||
${RM} -rf *.dSYM
|
||||
|
||||
|
||||
######################################
|
||||
# optional include of 1337 hacker rulz
|
||||
######################################
|
||||
|
||||
-include 1337.mk ../1337.mk ../../1337.mk
|
||||
@@ -0,0 +1,87 @@
|
||||
## To build:
|
||||
|
||||
``` <!---sh-->
|
||||
make all
|
||||
```
|
||||
|
||||
|
||||
## To use:
|
||||
|
||||
``` <!---sh-->
|
||||
clear; ./prog
|
||||
```
|
||||
|
||||
|
||||
## Try:
|
||||
|
||||
``` <!---sh-->
|
||||
./try.sh
|
||||
```
|
||||
|
||||
|
||||
## Alternate code:
|
||||
|
||||
The original submitted entry was flickering when executed. This alternate
|
||||
code implements the original level of flickering.
|
||||
|
||||
The original submitted entry was flickering when executed. We added code to stop that.
|
||||
After adding this to the compile line:
|
||||
|
||||
```
|
||||
-DQ='fputs("\033[H",stdout);'
|
||||
```
|
||||
|
||||
We changed the source as follows:
|
||||
|
||||
``` <!---sh-->
|
||||
make diff_alt_prog
|
||||
```
|
||||
|
||||
|
||||
### Alternate build:
|
||||
|
||||
``` <!---sh-->
|
||||
make alt
|
||||
```
|
||||
|
||||
|
||||
### Alternate use:
|
||||
|
||||
``` <!---sh-->
|
||||
./prog.alt
|
||||
```
|
||||
|
||||
|
||||
## Judges' remarks:
|
||||
|
||||
This prize in **cyclonic coding** will certainly twist your perspective on C code.
|
||||
|
||||
This is not your garden variety tempest in a teapot. It's a tornado in a window!
|
||||
|
||||
|
||||
## Author's remarks:
|
||||
|
||||
|
||||
### 3D fluid simulation
|
||||
|
||||
```
|
||||
advection=semi-lagrangian scheme
|
||||
projection=pressure solver with neumann boundary condition
|
||||
linear solver=gauss-seidel relaxation
|
||||
rendering=ray marching
|
||||
```
|
||||
|
||||
|
||||
<!--
|
||||
|
||||
Copyright © 1984-2025 by Landon Curt Noll and Leonid A. Broukhis. All Rights Reserved.
|
||||
|
||||
You are free to share and adapt this file under the terms of this license:
|
||||
|
||||
Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
|
||||
|
||||
For more information, see:
|
||||
|
||||
https://creativecommons.org/licenses/by-sa/4.0/
|
||||
|
||||
-->
|
||||
@@ -0,0 +1,620 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<!-- START: two lines up starts content from: inc/top.default.html -->
|
||||
|
||||
<!-- END: this line ends content from: inc/top.default.html -->
|
||||
<!-- START: this line starts content from: inc/head.default.html -->
|
||||
|
||||
<head>
|
||||
<link rel="stylesheet" href="../../ioccc.css">
|
||||
<link href="https://fonts.googleapis.com/css2?family=Outfit:wght@100..900&display=swap" rel="stylesheet">
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||
<title>2024/tmarrec - Prize in cyclonic coding</title>
|
||||
<link rel="icon" type="image/x-icon" href="../../favicon.ico">
|
||||
<meta name="description" content="2024 IOCCC entry tmarrec - Prize in cyclonic coding">
|
||||
<meta name="keywords" content="IOCCC, 2024, IOCCC 2024, IOCCC entry, tmarrec, Prize in cyclonic coding">
|
||||
</head>
|
||||
|
||||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
|
||||
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
|
||||
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
|
||||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
|
||||
<!-- END: this line ends content from: inc/head.default.html -->
|
||||
|
||||
<!-- -->
|
||||
<!-- This web page was formed via the tool: bin/readme2index.sh -->
|
||||
<!-- The content of main section of this web page came from: 2024/tmarrec/README.md -->
|
||||
<!-- -->
|
||||
|
||||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<!-- !!! Do not modify this web page, instead modify the file: 2024/tmarrec/README.md !!! -->
|
||||
<!-- !!! Do not modify this web page, instead modify the file: 2024/tmarrec/README.md !!! -->
|
||||
<!-- !!! Do not modify this web page, instead modify the file: 2024/tmarrec/README.md !!! -->
|
||||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
|
||||
<!-- Markdown content was converted into HTML via the tool: bin/md2html.sh -->
|
||||
|
||||
<!-- START: this line starts content from: inc/body.default.html -->
|
||||
|
||||
<body>
|
||||
|
||||
<!-- END: this line ends content from: inc/body.default.html -->
|
||||
<!-- START: this line starts content from: inc/topbar.default.html -->
|
||||
|
||||
<div class="theader">
|
||||
<nav class="topbar">
|
||||
<div class="container">
|
||||
<div class="logo">
|
||||
<a href="../../index.html" class="logo-link">
|
||||
IOCCC
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="topbar-items">
|
||||
<div class="item">
|
||||
<span class="item-header">
|
||||
Entries
|
||||
</span>
|
||||
|
||||
<div class="sub-item">
|
||||
|
||||
<div class="outfit-font">
|
||||
<a href="../../years.html" class="sub-item-link">
|
||||
Winning entries
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="outfit-font">
|
||||
<a href="../../authors.html" class="sub-item-link">
|
||||
Winning authors
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="outfit-font">
|
||||
<a href="../../location.html" class="sub-item-link">
|
||||
Location of authors
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="outfit-font">
|
||||
<a href="../../bugs.html" class="sub-item-link">
|
||||
Bugs and (mis)features
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="outfit-font">
|
||||
<a href="../../faq.html#fix_an_entry" class="sub-item-link">
|
||||
Fixing entries
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="outfit-font">
|
||||
<a href="../../faq.html#fix_author" class="sub-item-link">
|
||||
Updating author info
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="item">
|
||||
<span class="item-header">
|
||||
Status
|
||||
</span>
|
||||
|
||||
<div class="sub-item">
|
||||
|
||||
<div class="outfit-font">
|
||||
<a href="../../news.html" class="sub-item-link">
|
||||
News
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="outfit-font">
|
||||
<a href="../../status.html" class="sub-item-link">
|
||||
Contest status
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="outfit-font">
|
||||
<a href="../../next/rules.html" class="sub-item-link">
|
||||
IOCCC rules
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="outfit-font">
|
||||
<a href="../../next/guidelines.html" class="sub-item-link">
|
||||
IOCCC guidelines
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="outfit-font">
|
||||
<a href="../../markdown.html" class="sub-item-link">
|
||||
Markdown guidelines
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="outfit-font">
|
||||
<a href="../../SECURITY.html" class="sub-item-link">
|
||||
Security policy
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="item">
|
||||
<span class="item-header">
|
||||
FAQ
|
||||
</span>
|
||||
|
||||
<div class="sub-item">
|
||||
|
||||
<div class="outfit-font">
|
||||
<a href="../../faq.html" class="sub-item-link">
|
||||
Frequently asked questions
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="outfit-font">
|
||||
<a href="../../quick-start.html#enter" class="sub-item-link">
|
||||
Enter the IOCCC
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="outfit-font">
|
||||
<a href="../../faq.html#compiling" class="sub-item-link">
|
||||
Compiling entries
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="outfit-font">
|
||||
<a href="../../faq.html#running_entries" class="sub-item-link">
|
||||
Running entries
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="outfit-font">
|
||||
<a href="../../faq.html#help" class="sub-item-link">
|
||||
How to help
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="item">
|
||||
<span class="item-header">
|
||||
About
|
||||
</span>
|
||||
|
||||
<div class="sub-item">
|
||||
|
||||
<div class="outfit-font">
|
||||
<a href="../../index.html" class="sub-item-link">
|
||||
Home page
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="outfit-font">
|
||||
<a href="../../social.html" class="sub-item-link">
|
||||
IOCCC social media
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="outfit-font">
|
||||
<a href="../../about.html" class="sub-item-link">
|
||||
About the IOCCC
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="outfit-font">
|
||||
<a href="../../judges.html" class="sub-item-link">
|
||||
The judges
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="outfit-font">
|
||||
<a href="../../thanks-for-help.html" class="sub-item-link">
|
||||
Thanks for the help
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="outfit-font">
|
||||
<a href="../../contact.html" class="sub-item-link">
|
||||
Contact us
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<div class="header-mobile-menu">
|
||||
<noscript>
|
||||
<a href="../../nojs-menu.html" class="topbar-js-label">
|
||||
Please Enable JavaScript
|
||||
</a>
|
||||
</noscript>
|
||||
|
||||
<button id="header-open-menu-button" class="topbar-mobile-menu">
|
||||
<img
|
||||
src="../../png/hamburger-icon-open.png"
|
||||
alt="hamburger style menu icon - open state"
|
||||
width=48
|
||||
height=48>
|
||||
</button>
|
||||
|
||||
<button id="header-close-menu-button" class="hide-content">
|
||||
<img
|
||||
src="../../png/hamburger-icon-closed.png"
|
||||
alt="hamburger style menu icon - closed state"
|
||||
width=48
|
||||
height=48>
|
||||
</button>
|
||||
|
||||
<div id="mobile-menu-panel" class="hide-content">
|
||||
<div class="mobile-menu-container">
|
||||
|
||||
<div class="mobile-menu-wrapper">
|
||||
<div class="mobile-menu-item">
|
||||
Entries
|
||||
</div>
|
||||
<div class="mobile-submenu-wrapper">
|
||||
|
||||
<a class="mobile-submenu-item" href="../../years.html">
|
||||
Winning entries
|
||||
</a>
|
||||
|
||||
<a class="mobile-submenu-item" href="../../authors.html">
|
||||
Winning authors
|
||||
</a>
|
||||
|
||||
<a class="mobile-submenu-item" href="../../location.html">
|
||||
Location of authors
|
||||
</a>
|
||||
|
||||
<a class="mobile-submenu-item" href="../../bugs.html">
|
||||
Bugs and (mis)features
|
||||
</a>
|
||||
|
||||
<a class="mobile-submenu-item" href="../../faq.html#fix_an_entry">
|
||||
Fixing entries
|
||||
</a>
|
||||
|
||||
<a class="mobile-submenu-item" href="../../faq.html#fix_author">
|
||||
Updating author info
|
||||
</a>
|
||||
|
||||
<a class="mobile-submenu-item" href="../../thanks-for-help.html">
|
||||
Thanks for the help
|
||||
</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mobile-menu-wrapper">
|
||||
|
||||
<div class="mobile-menu-item">
|
||||
Status
|
||||
</div>
|
||||
<div class="mobile-submenu-wrapper">
|
||||
|
||||
<a class="mobile-submenu-item" href="../../news.html">
|
||||
News
|
||||
</a>
|
||||
|
||||
<a class="mobile-submenu-item" href="../../status.html">
|
||||
Contest status
|
||||
</a>
|
||||
|
||||
<a class="mobile-submenu-item" href="../../next/rules.html">
|
||||
IOCCC rules
|
||||
</a>
|
||||
|
||||
<a class="mobile-submenu-item" href="../../next/guidelines.html">
|
||||
IOCCC guidelines
|
||||
</a>
|
||||
|
||||
<a class="mobile-submenu-item" href="../../markdown.html">
|
||||
Markdown guidelines
|
||||
</a>
|
||||
|
||||
<a class="mobile-submenu-item" href="../../SECURITY.html">
|
||||
Security policy
|
||||
</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mobile-menu-wrapper">
|
||||
<div class="mobile-menu-item">
|
||||
FAQ
|
||||
</div>
|
||||
<div class="mobile-submenu-wrapper">
|
||||
|
||||
<a class="mobile-submenu-item" href="../../faq.html">
|
||||
Frequently asked questions
|
||||
</a>
|
||||
|
||||
<a class="mobile-submenu-item" href="../../quick-start.html#enter">
|
||||
Enter the IOCCC
|
||||
</a>
|
||||
|
||||
<a class="mobile-submenu-item" href="../../faq.html#compiling">
|
||||
Compiling entries
|
||||
</a>
|
||||
|
||||
<a class="mobile-submenu-item" href="../../faq.html#running_entries">
|
||||
Running entries
|
||||
</a>
|
||||
|
||||
<a class="mobile-submenu-item" href="../../faq.html#help">
|
||||
How to help
|
||||
</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mobile-menu-wrapper">
|
||||
<div class="mobile-menu-item">
|
||||
About
|
||||
</div>
|
||||
<div class="mobile-submenu-wrapper">
|
||||
|
||||
<a class="mobile-submenu-item" href="../../index.html">
|
||||
Home page
|
||||
</a>
|
||||
|
||||
<a class="mobile-submenu-item" href="../../social.html">
|
||||
IOCCC social media
|
||||
</a>
|
||||
|
||||
<a class="mobile-submenu-item" href="../../about.html">
|
||||
About the IOCCC
|
||||
</a>
|
||||
|
||||
<a class="mobile-submenu-item" href="../../judges.html">
|
||||
The judges
|
||||
</a>
|
||||
|
||||
<a class="mobile-submenu-item" href="../../contact.html">
|
||||
Contact us
|
||||
</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var headerOpenMenuButton = document.getElementById("header-open-menu-button");
|
||||
var headerCloseMenuButton = document.getElementById("header-close-menu-button");
|
||||
var mobileMenuPanel = document.getElementById("mobile-menu-panel");
|
||||
|
||||
headerOpenMenuButton.addEventListener("click", () => {
|
||||
headerOpenMenuButton.classList.remove("topbar-mobile-menu");
|
||||
headerOpenMenuButton.classList.add("hide-content");
|
||||
|
||||
headerCloseMenuButton.classList.remove("hide-content");
|
||||
headerCloseMenuButton.classList.add("topbar-mobile-menu");
|
||||
|
||||
mobileMenuPanel.classList.remove("hide-content");
|
||||
mobileMenuPanel.classList.add("topbar-mobile-panel");
|
||||
});
|
||||
|
||||
headerCloseMenuButton.addEventListener("click", () => {
|
||||
headerCloseMenuButton.classList.remove("topbar-mobile-menu");
|
||||
headerCloseMenuButton.classList.add("hide-content");
|
||||
|
||||
mobileMenuPanel.classList.add("hide-content");
|
||||
mobileMenuPanel.classList.remove("topbar-mobile-panel");
|
||||
|
||||
headerOpenMenuButton.classList.add("topbar-mobile-menu");
|
||||
headerOpenMenuButton.classList.remove("hide-content");
|
||||
});
|
||||
</script>
|
||||
|
||||
<!-- END: this line ends content from: inc/topbar.default.html -->
|
||||
<!-- START: this line starts content from: inc/header.default.html -->
|
||||
|
||||
<div class="header">
|
||||
<a href="../../2011/zucker/index.html">
|
||||
<img src="../../png/ioccc.png"
|
||||
alt="IOCCC image by Matt Zucker"
|
||||
width=300
|
||||
height=110>
|
||||
</a>
|
||||
<h1>The International Obfuscated C Code Contest</h1>
|
||||
<h2>2024/tmarrec - Prize in cyclonic coding</h2>
|
||||
<h3>3D tornado simulation</h3>
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/header.default.html -->
|
||||
<!-- START: this line starts content from: inc/navbar.mid.html -->
|
||||
|
||||
<div class="navbar">
|
||||
<a class="Left" href="../straadt/index.html">← 2024/straadt</a>
|
||||
<a class="Left" href="../index.html">↑ 2024 ↑</a>
|
||||
<a class="Left" href="../tompng/index.html">2024/tompng →</a>
|
||||
<a class="Right" href="https://github.com/ioccc-src/winner/blob/master/2024/tmarrec/prog.c">C code</a>
|
||||
<a class="Right" href="https://github.com/ioccc-src/winner/blob/master/2024/tmarrec/Makefile">Makefile</a>
|
||||
<a class="Right" href="#inventory">Inventory</a>
|
||||
<a class="Right" href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fwww.ioccc.org%2F2024%2Ftmarrec%2Findex.html">✓</a>
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/navbar.mid.html -->
|
||||
<!-- START: this line starts content from: inc/before-content.default.html -->
|
||||
|
||||
<div class="content" id="content">
|
||||
|
||||
<!-- END: this line ends content from: inc/before-content.default.html -->
|
||||
<!-- START: this line starts content for HTML phase 20 by: bin/output-index-author.sh via bin/md2html.sh -->
|
||||
|
||||
<!-- START: this line starts content generated by: bin/output-index-author.sh -->
|
||||
|
||||
<h2 id="author">Author:</h2>
|
||||
<ul>
|
||||
<li>Name: <a href="../../authors.html#Tristan_Marrec">Tristan Marrec</a><br>
|
||||
Location: <a href="../../location.html#CA">CA</a> - <em>Canada</em></li>
|
||||
</ul>
|
||||
|
||||
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
|
||||
|
||||
<!-- END: this line ends content for HTML phase 20 by: bin/output-index-author.sh via bin/md2html.sh -->
|
||||
<!-- START: this line starts content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
|
||||
|
||||
<!-- BEFORE: 1st line of markdown file: 2024/tmarrec/README.md -->
|
||||
<h2 id="to-build">To build:</h2>
|
||||
<pre><code> make all</code></pre>
|
||||
<h2 id="to-use">To use:</h2>
|
||||
<pre><code> clear; ./prog</code></pre>
|
||||
<h2 id="try">Try:</h2>
|
||||
<pre><code> ./try.sh</code></pre>
|
||||
<h2 id="alternate-code">Alternate code:</h2>
|
||||
<p>The original submitted entry was flickering when executed. This alternate
|
||||
code implements the original level of flickering.</p>
|
||||
<p>The original submitted entry was flickering when executed. We added code to stop that.
|
||||
After adding this to the compile line:</p>
|
||||
<pre><code> -DQ='fputs("\033[H",stdout);'</code></pre>
|
||||
<p>We changed the source as follows:</p>
|
||||
<pre><code> make diff_alt_prog</code></pre>
|
||||
<h3 id="alternate-build">Alternate build:</h3>
|
||||
<pre><code> make alt</code></pre>
|
||||
<h3 id="alternate-use">Alternate use:</h3>
|
||||
<pre><code> ./prog.alt</code></pre>
|
||||
<h2 id="judges-remarks">Judges’ remarks:</h2>
|
||||
<p>This prize in <strong>cyclonic coding</strong> will certainly twist your perspective on C code.</p>
|
||||
<p>This is not your garden variety tempest in a teapot. It’s a tornado in a window!</p>
|
||||
<h2 id="authors-remarks">Author’s remarks:</h2>
|
||||
<h3 id="d-fluid-simulation">3D fluid simulation</h3>
|
||||
<pre><code> advection=semi-lagrangian scheme
|
||||
projection=pressure solver with neumann boundary condition
|
||||
linear solver=gauss-seidel relaxation
|
||||
rendering=ray marching</code></pre>
|
||||
<!--
|
||||
|
||||
Copyright © 1984-2025 by Landon Curt Noll and Leonid A. Broukhis. All Rights Reserved.
|
||||
|
||||
You are free to share and adapt this file under the terms of this license:
|
||||
|
||||
Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
|
||||
|
||||
For more information, see:
|
||||
|
||||
https://creativecommons.org/licenses/by-sa/4.0/
|
||||
|
||||
-->
|
||||
<!-- AFTER: last line of markdown file: 2024/tmarrec/README.md -->
|
||||
|
||||
<!-- END: this line ends content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
|
||||
<!-- START: this line starts content for HTML phase 22 by: bin/output-index-inventory.sh via bin/md2html.sh -->
|
||||
|
||||
<!-- START: this line starts content generated by: bin/output-index-inventory.sh -->
|
||||
|
||||
<div id="inventory">
|
||||
<h1 id="inventory-for-2024tmarrec">Inventory for 2024/tmarrec</h1>
|
||||
</div>
|
||||
<h2 id="primary-files">Primary files</h2>
|
||||
<ul>
|
||||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2024/tmarrec/prog.c">prog.c</a> - entry source code</li>
|
||||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2024/tmarrec/Makefile">Makefile</a> - entry Makefile</li>
|
||||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2024/tmarrec/prog.alt.c">prog.alt.c</a> - alternate source code</li>
|
||||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2024/tmarrec/prog.orig.c">prog.orig.c</a> - original source code</li>
|
||||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2024/tmarrec/try.sh">try.sh</a> - script to try entry</li>
|
||||
</ul>
|
||||
<h2 id="secondary-files">Secondary files</h2>
|
||||
<ul>
|
||||
<li><a href="2024_tmarrec.tar.bz2">2024_tmarrec.tar.bz2</a> - download entry tarball</li>
|
||||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2024/tmarrec/README.md">README.md</a> - markdown source for this web page</li>
|
||||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2024/tmarrec/.entry.json">.entry.json</a> - entry summary and manifest in JSON</li>
|
||||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2024/tmarrec/.gitignore">.gitignore</a> - list of files that should not be committed under git</li>
|
||||
<li><a href=".path">.path</a> - directory path from top level directory</li>
|
||||
<li><a href="index.html">index.html</a> - this web page</li>
|
||||
</ul>
|
||||
<hr style="width:10%;text-align:left;margin-left:0">
|
||||
<h4>
|
||||
Jump to: <a href="#">top</a>
|
||||
</h4>
|
||||
|
||||
<!-- END: next line ends content generated by: bin/output-index-inventory.sh -->
|
||||
|
||||
<!-- END: this line ends content for HTML phase 22 by: bin/output-index-inventory.sh via bin/md2html.sh -->
|
||||
<!-- START: this line starts content from: inc/after-content.default.html -->
|
||||
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/after-content.default.html -->
|
||||
<!-- START: this line starts content from: inc/footer.inventory.html -->
|
||||
|
||||
<!--
|
||||
|
||||
Copyright © 1984-2025 by Landon Curt Noll. All Rights Reserved.
|
||||
|
||||
You are free to share and adapt this file under the terms of this license:
|
||||
|
||||
Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
|
||||
|
||||
For more information, see:
|
||||
|
||||
https://creativecommons.org/licenses/by-sa/4.0/
|
||||
|
||||
-->
|
||||
|
||||
<div class="footer">
|
||||
|
||||
<div id="copyright"><h3>Copyright © 1984-2025 by Landon Curt Noll:
|
||||
<a href="https://creativecommons.org/faq/#what-does-some-rights-reserved-mean"
|
||||
target="_blank"
|
||||
rel="license noopener noreferrer">Some Rights Reserved</a></h3>
|
||||
<p>
|
||||
This work is <b>licensed by Landon Curt Noll</b> under
|
||||
<b><a href="https://creativecommons.org/licenses/by-sa/4.0/?ref=chooser-v1"
|
||||
target="_blank"
|
||||
rel="license noopener noreferrer"
|
||||
style="display:inline-block;">CC BY-SA 4.0</a></b>.
|
||||
<img style="height:22px!important;margin-left:3px;vertical-align:text-bottom;"
|
||||
src="../../png/cc.png"
|
||||
alt="cc inside circle symbol">
|
||||
<img style="height:22px!important;margin-left:3px;vertical-align:text-bottom;"
|
||||
src="../../png/by.png"
|
||||
alt="person inside circle symbol">
|
||||
<img style="height:22px!important;margin-left:3px;vertical-align:text-bottom;"
|
||||
src="../../png/sa.png"
|
||||
alt="arrow looping back on itself inside circle symbol"><br>
|
||||
You should <b>carefully review</b> the
|
||||
<b><a href="https://creativecommons.org/licenses/by-sa/4.0/legalcode.en"
|
||||
target="_blank"
|
||||
rel="license noopener noreferrer">CC BY-SA 4.0 LEGAL CODE</a></b>
|
||||
before using the licensed material.<br>
|
||||
You may wish to review the
|
||||
<b><a href="../../license.html"
|
||||
target="_blank"
|
||||
rel="license noopener noreferrer">highlights of some of the key features and terms</a></b>
|
||||
of <b>CC BY-SA 4.0</b>.<br>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div id="coda"><h3>Coda</h3>
|
||||
<p>
|
||||
<a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fwww.ioccc.org%2F2024%2Ftmarrec%2Findex.html" rel="nofollow">Nu HTML check this web page</a><br>
|
||||
<a href="#top">Jump to top</a> <a href="#content">Jump to Content</a> <a href="#inventory">Jump to Inventory</a><br>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/footer.inventory.html -->
|
||||
<!-- START: this line starts content from: inc/bottom.default.html -->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<!-- END: this line ends content from: inc/bottom.default.html -->
|
||||
@@ -0,0 +1,54 @@
|
||||
#define _(x)for(F=0;x>F;++F)
|
||||
float x,
|
||||
T=240
|
||||
,B,j= .53,f,y,O[4426112], Z,w,
|
||||
R, n, m,E ,i
|
||||
, U,g=
|
||||
0; char P[60737];int d=80,X=79,Y=64,l=40, L=
|
||||
551368, t,I,a,F,G,e,M=6400,c=15168,J =949,K=12,k=
|
||||
0x1fbb4000;float*W(int t,int I,int a,int T){ return&O[(t
|
||||
+ 82*I+6724 *a)+(c+T*L)];}float b(float x,float y,float n){x=x*x+y*y+n*n;int s=k+(*
|
||||
( int*)&x>>1);return*(float*)&s; }void H(float x,float y,float n,
|
||||
float*k,float*h,float*c) {U=b(x,y,n);*k=x/U;*h=y/U;*c=n/ U;}void s(int x, int
|
||||
S){ _(L)O[c+x*L+F]+=.4*O[ c+S*L+F];}float*D(int o){return &O[(t *X+I)*3+o];} float
|
||||
z( float k){return 0>k? -k:k;}void o(int x,int y){_(e){G=F%M;t= G%d+1;I=G/d+1;a=F /M+1;*W (t
|
||||
,I,a ,x)=*W( t,I,a,y);}} void A(float*z){*z=*z<.5?.5:*z>85?85:*z;}void u(int E, int y,int u ,
|
||||
int v ,int w) {_(e){G=F%M;t=G%d+1;I=G/d+1;a=F/M+1;float U=t-d*.4**W(t,I,a,u),J=I- d*.4**W(t,I, a,v) ,e=
|
||||
a-d* .4**W(t ,I,a,w);A(&U);A(&J);A(&e);float F=U-(int)U,j=J-(int)J,l=1-j, i=e-(int)e,c=1-i;*W(t ,I,a
|
||||
,E)=(1-F)*(l*c **W(U,J,e,y)+j*c* *W(U,1+J,e,y)+l*i**W(U,J,e+1 ,y)+j*i**W(U,1+J,1+e,y) )+F*(
|
||||
l*c**W(U+1,J,e,y) +j*c**W(1+U,1+J,e,y)+l*i**W(1+ U,J,1+e,y)+j*i**W(1+U,J+1,e+ 1,y)
|
||||
) ;}}int puts(const char*);void v(int x,int E,int k,int b,int c){*W(t,I,a,x)-=40*(*W(t+k,I+b ,a+c
|
||||
,E )-*W(t-k,I-b,a-c,E));}void q(int u,int T,int w,int E){_(e){G=F%M;t=G%d+1;I=G/d+1;a=F/M+
|
||||
1;*W (t,I,a,E)=-1./3*((*W(1+t,I,a,u)-*W(t-1,I,a,u))/d+(*W(t,I+1,a,T)-*W(t,I-1,a,T) )/
|
||||
d+(*W ( t,I,1+a,w)-*W(t,I,a-1,w))/d);}_(e){G=F %M;t=G%d+1;I=G/d+ 1;a=F/
|
||||
M+1;v(u,E,1,0,0);v(T,E,0,1,0);v(w,E,0,0,1 );}}char h[]=
|
||||
" (\\tjxucXUCQOmqdkaoM&%$\033[38;5;141m+"; int main(){e=M*d;I=c+
|
||||
L*8;P[J*Y] ='\0';_(I)O[F]=0;for(t=0;t<Y;++t){P[t*J+X*K
|
||||
]='\n';for(I=0;I<X;){H(I ++-40,t-32,-145,&w,&Z,&R);*D(0)=w;*D(1)=Z;*D(2 )=
|
||||
R;}} for(;;){_(L)O[c+3*L+F]=O[c+4*L+F]=O[c+5*L+F]=O[c+7*L +F]=0;_(e){G =F%M
|
||||
;t=G%d+1;I=G/d+1;a=F/M+1;x=t-l;y=a-l;U=x*x+y*y;G=k+(*(int*)&U>>1);i=*(float*) &G;if
|
||||
(I<13&I>10){if (i<2){*W(t,I,a,4)=1.5;m=g+(I/d);U=m*m;w=m*m;m=m-(U*m)/6+(U*
|
||||
U*m)/120;E=1-w/2+(w*w)/24;*W(t,I,a,3)=m/2+.0275;*W(t,I
|
||||
,a,5)=E*.7-.35;}}if(I<2&i <3)*W(t,I,a,7)=.1;}s(0,
|
||||
3);s(1,4);s (2,5);o(5,2);o(4,1);o(3,0 )
|
||||
;q(3,4,5,1);u(1,4,3,4,5);u(0,3,3,4,5);u(2 ,5,3
|
||||
, 4,5); q(0,1,2,4);s(6,7);o(7,6);u(6,7,0,1,2 );x=T*
|
||||
.9998+B*.02;B=.9998*B-T*.02;T=x;H(- T,0,-B,&R,&w,& Z
|
||||
);g+= .1;g=g>3.14 ?-g:g;H(Z,0,-R,&m,&E ,&i);_(
|
||||
5056){G= F%5056;t=G%Y;I=G/Y;U=*D(0); float v=*D (1),g
|
||||
=*D(2),V=U*m+v*(E*Z -w*i)+g*-R,s=U*E +v*(i*
|
||||
R-Z* m)+g*-w;U=U*i+v*(m*w-R*E)+g*-Z;f=0;int q=t*
|
||||
J+I*K+8;for(a=0;a<K;++a)P[q+a-8]=h[35+a];while(f<d*5
|
||||
){x=z(T+V*f)-l,y=z(s*f)-l,n=z(B+U*f)-l;float
|
||||
k=y>n?y:n,c=x>k?x:k,F=(c<0?c:0)+b(x<0
|
||||
?0:x,y<0?0:y,n>0?n:0);if(F<.01){x=T+f
|
||||
*V+l;y=f*s+l;n=B+f*U+l; f=1;a=0;for(;
|
||||
(a++<1)|(d>x& y<d&
|
||||
n<d& x>0&0<y& n>0); )
|
||||
{f*=1-*W(n+1,1+y,x+1,6)*j;x=x+V*j;y=y+s*j;n=n+U
|
||||
*j;}a=(1-f)*35;a=0>a?0:a>34?34:a;
|
||||
int c=240+.44*a;P[q]=(c-200
|
||||
)/10+48;P[q+1]=c%10+48
|
||||
;P[q+3]=h[a];break;}f+=F
|
||||
;}}puts(P);}}
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
#define _(x)for(F=0;x>F;++F)
|
||||
float x,
|
||||
T=240
|
||||
,B,j= .53,f,y,O[4426112], Z,w,
|
||||
R, n, m,E ,i
|
||||
, U,g=
|
||||
0; char P[60737];int d=80,X=79,Y=64,l=40, L=
|
||||
551368, t,I,a,F,G,e,M=6400,c=15168,J =949,K=12,k=
|
||||
0x1fbb4000;float*W(int t,int I,int a,int T){ return&O[(t
|
||||
+ 82*I+6724 *a)+(c+T*L)];}float b(float x,float y,float n){x=x*x+y*y+n*n;int s=k+(*
|
||||
( int*)&x>>1);return*(float*)&s; }void H(float x,float y,float n,
|
||||
float*k,float*h,float*c) {U=b(x,y,n);*k=x/U;*h=y/U;*c=n/ U;}void s(int x, int
|
||||
S){ _(L)O[c+x*L+F]+=.4*O[ c+S*L+F];}float*D(int o){return &O[(t *X+I)*3+o];} float
|
||||
z( float k){return 0>k? -k:k;}void o(int x,int y){_(e){G=F%M;t= G%d+1;I=G/d+1;a=F /M+1;*W (t
|
||||
,I,a ,x)=*W( t,I,a,y);}} void A(float*z){*z=*z<.5?.5:*z>85?85:*z;}void u(int E, int y,int u ,
|
||||
int v ,int w) {_(e){G=F%M;t=G%d+1;I=G/d+1;a=F/M+1;float U=t-d*.4**W(t,I,a,u),J=I- d*.4**W(t,I, a,v) ,e=
|
||||
a-d* .4**W(t ,I,a,w);A(&U);A(&J);A(&e);float F=U-(int)U,j=J-(int)J,l=1-j, i=e-(int)e,c=1-i;*W(t ,I,a
|
||||
,E)=(1-F)*(l*c **W(U,J,e,y)+j*c* *W(U,1+J,e,y)+l*i**W(U,J,e+1 ,y)+j*i**W(U,1+J,1+e,y) )+F*(
|
||||
l*c**W(U+1,J,e,y) +j*c**W(1+U,1+J,e,y)+l*i**W(1+ U,J,1+e,y)+j*i**W(1+U,J+1,e+ 1,y)
|
||||
) ;}}int puts(const char*);void v(int x,int E,int k,int b,int c){*W(t,I,a,x)-=40*(*W(t+k,I+b ,a+c
|
||||
,E )-*W(t-k,I-b,a-c,E));}void q(int u,int T,int w,int E){_(e){G=F%M;t=G%d+1;I=G/d+1;a=F/M+
|
||||
1;*W (t,I,a,E)=-1./3*((*W(1+t,I,a,u)-*W(t-1,I,a,u))/d+(*W(t,I+1,a,T)-*W(t,I-1,a,T) )/
|
||||
d+(*W ( t,I,1+a,w)-*W(t,I,a-1,w))/d);}_(e){G=F %M;t=G%d+1;I=G/d+ 1;a=F/
|
||||
M+1;v(u,E,1,0,0);v(T,E,0,1,0);v(w,E,0,0,1 );}}char h[]=
|
||||
" (\\tjxucXUCQOmqdkaoM&%$\033[38;5;141m+"; int main(){e=M*d;I=c+
|
||||
L*8;P[J*Y] ='\0';_(I)O[F]=0;for(t=0;t<Y;++t){P[t*J+X*K
|
||||
]='\n';for(I=0;I<X;){H(I ++-40,t-32,-145,&w,&Z,&R);*D(0)=w;*D(1)=Z;*D(2 )=
|
||||
R;}} for(;Q){_(L)O[c+3*L+F]=O[c+4*L+F]=O[c+5*L+F]=O[c+7*L +F]=0;_(e){G =F%M
|
||||
;t=G%d+1;I=G/d+1;a=F/M+1;x=t-l;y=a-l;U=x*x+y*y;G=k+(*(int*)&U>>1);i=*(float*) &G;if
|
||||
(I<13&I>10){if (i<2){*W(t,I,a,4)=1.5;m=g+(I/d);U=m*m;w=m*m;m=m-(U*m)/6+(U*
|
||||
U*m)/120;E=1-w/2+(w*w)/24;*W(t,I,a,3)=m/2+.0275;*W(t,I
|
||||
,a,5)=E*.7-.35;}}if(I<2&i <3)*W(t,I,a,7)=.1;}s(0,
|
||||
3);s(1,4);s (2,5);o(5,2);o(4,1);o(3,0 )
|
||||
;q(3,4,5,1);u(1,4,3,4,5);u(0,3,3,4,5);u(2 ,5,3
|
||||
, 4,5); q(0,1,2,4);s(6,7);o(7,6);u(6,7,0,1,2 );x=T*
|
||||
.9998+B*.02;B=.9998*B-T*.02;T=x;H(- T,0,-B,&R,&w,& Z
|
||||
);g+= .1;g=g>3.14 ?-g:g;H(Z,0,-R,&m,&E ,&i);_(
|
||||
5056){G= F%5056;t=G%Y;I=G/Y;U=*D(0); float v=*D (1),g
|
||||
=*D(2),V=U*m+v*(E*Z -w*i)+g*-R,s=U*E +v*(i*
|
||||
R-Z* m)+g*-w;U=U*i+v*(m*w-R*E)+g*-Z;f=0;int q=t*
|
||||
J+I*K+8;for(a=0;a<K;++a)P[q+a-8]=h[35+a];while(f<d*5
|
||||
){x=z(T+V*f)-l,y=z(s*f)-l,n=z(B+U*f)-l;float
|
||||
k=y>n?y:n,c=x>k?x:k,F=(c<0?c:0)+b(x<0
|
||||
?0:x,y<0?0:y,n>0?n:0);if(F<.01){x=T+f
|
||||
*V+l;y=f*s+l;n=B+f*U+l; f=1;a=0;for(;
|
||||
(a++<1)|(d>x& y<d&
|
||||
n<d& x>0&0<y& n>0); )
|
||||
{f*=1-*W(n+1,1+y,x+1,6)*j;x=x+V*j;y=y+s*j;n=n+U
|
||||
*j;}a=(1-f)*35;a=0>a?0:a>34?34:a;
|
||||
int c=240+.44*a;P[q]=(c-200
|
||||
)/10+48;P[q+1]=c%10+48
|
||||
;P[q+3]=h[a];break;}f+=F
|
||||
;}}puts(P);}}
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
#define _(x)for(F=0;x>F;++F)
|
||||
float x,
|
||||
T=240
|
||||
,B,j= .53,f,y,O[4426112], Z,w,
|
||||
R, n, m,E ,i
|
||||
, U,g=
|
||||
0; char P[60737];int d=80,X=79,Y=64,l=40, L=
|
||||
551368, t,I,a,F,G,e,M=6400,c=15168,J =949,K=12,k=
|
||||
0x1fbb4000;float*W(int t,int I,int a,int T){ return&O[(t
|
||||
+ 82*I+6724 *a)+(c+T*L)];}float b(float x,float y,float n){x=x*x+y*y+n*n;int s=k+(*
|
||||
( int*)&x>>1);return*(float*)&s; }void H(float x,float y,float n,
|
||||
float*k,float*h,float*c) {U=b(x,y,n);*k=x/U;*h=y/U;*c=n/ U;}void s(int x, int
|
||||
S){ _(L)O[c+x*L+F]+=.4*O[ c+S*L+F];}float*D(int o){return &O[(t *X+I)*3+o];} float
|
||||
z( float k){return 0>k? -k:k;}void o(int x,int y){_(e){G=F%M;t= G%d+1;I=G/d+1;a=F /M+1;*W (t
|
||||
,I,a ,x)=*W( t,I,a,y);}} void A(float*z){*z=*z<.5?.5:*z>85?85:*z;}void u(int E, int y,int u ,
|
||||
int v ,int w) {_(e){G=F%M;t=G%d+1;I=G/d+1;a=F/M+1;float U=t-d*.4**W(t,I,a,u),J=I- d*.4**W(t,I, a,v) ,e=
|
||||
a-d* .4**W(t ,I,a,w);A(&U);A(&J);A(&e);float F=U-(int)U,j=J-(int)J,l=1-j, i=e-(int)e,c=1-i;*W(t ,I,a
|
||||
,E)=(1-F)*(l*c **W(U,J,e,y)+j*c* *W(U,1+J,e,y)+l*i**W(U,J,e+1 ,y)+j*i**W(U,1+J,1+e,y) )+F*(
|
||||
l*c**W(U+1,J,e,y) +j*c**W(1+U,1+J,e,y)+l*i**W(1+ U,J,1+e,y)+j*i**W(1+U,J+1,e+ 1,y)
|
||||
) ;}}int puts(const char*);void v(int x,int E,int k,int b,int c){*W(t,I,a,x)-=40*(*W(t+k,I+b ,a+c
|
||||
,E )-*W(t-k,I-b,a-c,E));}void q(int u,int T,int w,int E){_(e){G=F%M;t=G%d+1;I=G/d+1;a=F/M+
|
||||
1;*W (t,I,a,E)=-1./3*((*W(1+t,I,a,u)-*W(t-1,I,a,u))/d+(*W(t,I+1,a,T)-*W(t,I-1,a,T) )/
|
||||
d+(*W ( t,I,1+a,w)-*W(t,I,a-1,w))/d);}_(e){G=F %M;t=G%d+1;I=G/d+ 1;a=F/
|
||||
M+1;v(u,E,1,0,0);v(T,E,0,1,0);v(w,E,0,0,1 );}}char h[]=
|
||||
" (\\tjxucXUCQOmqdkaoM&%$\033[38;5;141m+"; int main(){e=M*d;I=c+
|
||||
L*8;P[J*Y] ='\0';_(I)O[F]=0;for(t=0;t<Y;++t){P[t*J+X*K
|
||||
]='\n';for(I=0;I<X;){H(I ++-40,t-32,-145,&w,&Z,&R);*D(0)=w;*D(1)=Z;*D(2 )=
|
||||
R;}} for(;;){_(L)O[c+3*L+F]=O[c+4*L+F]=O[c+5*L+F]=O[c+7*L +F]=0;_(e){G =F%M
|
||||
;t=G%d+1;I=G/d+1;a=F/M+1;x=t-l;y=a-l;U=x*x+y*y;G=k+(*(int*)&U>>1);i=*(float*) &G;if
|
||||
(I<13&I>10){if (i<2){*W(t,I,a,4)=1.5;m=g+(I/d);U=m*m;w=m*m;m=m-(U*m)/6+(U*
|
||||
U*m)/120;E=1-w/2+(w*w)/24;*W(t,I,a,3)=m/2+.0275;*W(t,I
|
||||
,a,5)=E*.7-.35;}}if(I<2&i <3)*W(t,I,a,7)=.1;}s(0,
|
||||
3);s(1,4);s (2,5);o(5,2);o(4,1);o(3,0 )
|
||||
;q(3,4,5,1);u(1,4,3,4,5);u(0,3,3,4,5);u(2 ,5,3
|
||||
, 4,5); q(0,1,2,4);s(6,7);o(7,6);u(6,7,0,1,2 );x=T*
|
||||
.9998+B*.02;B=.9998*B-T*.02;T=x;H(- T,0,-B,&R,&w,& Z
|
||||
);g+= .1;g=g>3.14 ?-g:g;H(Z,0,-R,&m,&E ,&i);_(
|
||||
5056){G= F%5056;t=G%Y;I=G/Y;U=*D(0); float v=*D (1),g
|
||||
=*D(2),V=U*m+v*(E*Z -w*i)+g*-R,s=U*E +v*(i*
|
||||
R-Z* m)+g*-w;U=U*i+v*(m*w-R*E)+g*-Z;f=0;int q=t*
|
||||
J+I*K+8;for(a=0;a<K;++a)P[q+a-8]=h[35+a];while(f<d*5
|
||||
){x=z(T+V*f)-l,y=z(s*f)-l,n=z(B+U*f)-l;float
|
||||
k=y>n?y:n,c=x>k?x:k,F=(c<0?c:0)+b(x<0
|
||||
?0:x,y<0?0:y,n>0?n:0);if(F<.01){x=T+f
|
||||
*V+l;y=f*s+l;n=B+f*U+l; f=1;a=0;for(;
|
||||
(a++<1)|(d>x& y<d&
|
||||
n<d& x>0&0<y& n>0); )
|
||||
{f*=1-*W(n+1,1+y,x+1,6)*j;x=x+V*j;y=y+s*j;n=n+U
|
||||
*j;}a=(1-f)*35;a=0>a?0:a>34?34:a;
|
||||
int c=240+.44*a;P[q]=(c-200
|
||||
)/10+48;P[q+1]=c%10+48
|
||||
;P[q+3]=h[a];break;}f+=F
|
||||
;}}puts(P);}}
|
||||
|
||||
Executable
+26
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# try.sh - demonstrate 2024/tmarrec
|
||||
|
||||
# make sure CC is set so that when we do make CC="$CC" it isn't empty. Doing it
|
||||
# this way allows us to have the user specify a different compiler in an easy way.
|
||||
#
|
||||
[[ -z "$CC" ]] && CC="clang"
|
||||
|
||||
# make sure the program has been built
|
||||
#
|
||||
make CC="$CC" all >/dev/null || exit 1
|
||||
|
||||
# clear the screen
|
||||
#
|
||||
clear
|
||||
|
||||
# try the program
|
||||
#
|
||||
echo 'Please adjust your terminal window to be at least 65 lines by 80 columns.' 1>&2
|
||||
echo 1>&2
|
||||
read -r -n 1 -p "Press any key to run: ./prog: "
|
||||
echo 1>&2
|
||||
echo 1>&2
|
||||
./prog
|
||||
echo 1>&2
|
||||
Reference in new issue
Block a user