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:
Landon Curt Noll committed 2025-08-02 14:43:07 -07:00
1 parent 10512e6c79
commit 09750f8899
443 files changed
+182938 -231

No files matched your search

+113
View File
@@ -0,0 +1,113 @@
{
"no_comment" : "mandatory comment: because comments were removed from the original JSON spec",
"entry_JSON_format_version" : "1.2 2024-09-25",
"award" : "Nice accent eh-ward",
"year" : 2024,
"dir" : "howe",
"entry_id" : "2024_howe",
"title" : "eh",
"abstract" : "mini vi",
"author_set" : [
{
"author_handle" : "Anthony_C_Howe"
}
],
"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.orig.c",
"inventory_order" : 50,
"OK_to_edit" : false,
"display_as" : "c",
"display_via_github" : true,
"entry_text" : "original source code"
},
{
"file_path" : "prog.html",
"inventory_order" : 100,
"OK_to_edit" : false,
"display_as" : "markdown",
"display_via_github" : true,
"entry_text" : "eh man page"
},
{
"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_howe.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" : "prog.md",
"inventory_order" : 4000000000,
"OK_to_edit" : true,
"display_as" : "markdown",
"display_via_github" : true,
"entry_text" : "markdown source for prog.html"
},
{
"file_path" : "index.html",
"inventory_order" : 4294967295,
"OK_to_edit" : false,
"display_as" : "html",
"display_via_github" : false,
"entry_text" : "this web page"
}
]
}
+2
View File
@@ -0,0 +1,2 @@
eh
foo
+1
View File
@@ -0,0 +1 @@
2024/howe
Binary file not shown.
+232
View File
@@ -0,0 +1,232 @@
#!/usr/bin/env make
#
# 2024/howe
#############################
# shell used by this Makefile
#############################
SHELL= bash
#######################
# common tool locations
#######################
include ../../var.mk
#####################
# C compiler settings
#####################
# Common C compiler warnings to silence
#
# -Wno-char-subscripts ctypes macros
# -Wno-incompatible-pointer-types atexit(endwin)
# -Wno-unused-parameter main(int argc, ...)
#
# -Wno-strict-prototypes functions no arguments
# -Wno-missing-prototypes clang functiosn without static
# -Wno-missing-variable-declarations clang globals without static
# -Wno-tentative-definition-array clang array definitions
#
CSILENCE= -Wno-strict-prototypes -Wno-pointer-sign
# 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
#
# Frack need extra #define to enable SUS standard strdup(), strndup().
#
CDEFINE= -DBUF=${BUF} -DMODE=${MODE} -D_XOPEN_SOURCE=700
# Include files that are needed to compile
#
# Example: CINCLUDE= -include stdio.h
#
CINCLUDE= -include curses.h -include ctype.h -include string.h \
-include stdlib.h -include iso646.h -include regex.h \
-include fcntl.h -include locale.h -include unistd.h
# Other flags to pass to the C compiler
#
# Example: COTHER= -fno-math-errno
#
COTHER= -funsigned-char
# 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= -Os
# Default flags for ANSI C compilation
#
CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${COTHER} ${OPT}
# Libraries needed to build
#
LDFLAGS= -lcurses
# 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-c99-compat -Wno-comma \
-Wno-declaration-after-statement -Wno-implicit-int-conversion \
-Wno-incompatible-function-pointer-types-strict -Wno-missing-prototypes \
-Wno-missing-variable-declarations -Wno-poison-system-directories \
-Wno-shadow -Wno-sign-conversion -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} eh
#
ALT_OBJ=
ALT_TARGET=
# list any data files supplied with your submission
#
# Example: DATA= curds whey
#
DATA=
# Buffer size 128KB
#
BUF= 131072
# File creation mode
#
MODE= 0600
#################
# 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}
eh: ${PROG}
${RM} -f $@
${CP} -f -v ${PROG} $@
# 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
+129
View File
@@ -0,0 +1,129 @@
## To build:
``` <!---sh-->
make all
```
### Bugs and (Mis)features:
The current status of this entry is:
> **STATUS: known bug - please help us fix**
For more detailed information see [2024/howe in bugs.html](../../bugs.html#2024_howe).
## Try:
``` <!---sh-->
./try.sh
```
## Judges' remarks:
This is not your grandmother's 👵 `emacs(1)` 🤓, nor is it as limited as `ed(1)`, eh (🇨🇦)?
The source (and of this program) has fun with an UTF-8 conforming accent, in a manor of speaking 😉.
> TL;DR - to exit type **Q** or press **CTRL+C**.
As mentioned in in the [COMMANDS section of prog.html](prog.html#commands), try these commands:
```
| Key cmd | Action |
|----------|------------------------------------------------------------|
| h j k l | Left, down, up, right cursor movement |
| H J K L | Page top, page down, page up, page bottom |
| b w | Word left, word right |
| | | Goto column (count) of physical line |
| /ERE | Find first occurrence of ERE pattern after the cursor |
| n | Find next occurrence of ERE |
| G | Goto line (count) number; 1G top of file, G bottom |
| \ | Toggle text selection |
| d motion | Delete text selection or region given by motion |
| y motion | Yank (copy) text selection or region given by motion |
| P | Paste last deleted or yanked text region before the cursor |
| i | Insert text mode before cursor, ESC or CTRL+C ends insert |
| u | Toggle undo of last edit |
| x | Delete character after the cursor, i.e., dl |
| W | Write buffer to file |
| Q | Quit |
| CTRL+C | Quit |
```
**NOTE**: Any other key will redraw the screen.
## Author's remarks:
### Building
Simply type `make` to build. There are two macros that can be customised:
* `BUF` to set the buffer size; default 128KB.
* `MODE` to set the file creation mode; default 0600.
### What's Interesting
* This is an update with bug fixes of a previous IOCCC winner, with permission of the author.
* This entry requires Curses. Some Linux might require NCurses built with wide character support, `-lncursesw`.
* The source is UTF-8. When are `é` `ë` `ê` `è` not same as `e`?
* The documentation is found in [prog.html](prog.html).
* `prog` can view its own source.
* A regression test suite is available on demand. The test suite requires `tic(1)` to build the specialised test terminal entry.
* Original unobfuscated more fully featured source available (search/replace, pipe-filter selection, markers, insert file, edit buffer grows, literal character input, multi undo/redo).
* The `iocccsize(1)` tool only counts bytes, not characters, i.e,. UTF-8 multibyte characters such that some characters cost 2, 3, or 4 bytes, thus penalising UTF-8 entries.
> UTF-8 demands equal rights and respect as real characters! The dominance of slim ASCII must end! We are the UTF-8 People's Front for Freedom, Equality, and Brotherhood (oh that's been used already) - We are the UTF-8 Countless Tourist Defence Farce for One Voice, One World, One Character Set.
Furthermore:
* Refactor page framing to address original issue of scrolling and paging up/down when the file contains long lines.
* CTRL+C will exit insert mode as with `vi(1)`; CTRL+C will also quit, unlike `vi(1)`, for those who cannot find `Q`.
* Add extended regular expression forward search with buffer wrap-around.
* Add text selection with delete (cut), yank (copy), and put (paste).
* Add delete (cut), yank (copy) with motion.
* Replace start/end of line with goto-column command.
* Add counts for motion commands, delete, and put.
* Replace top/end of file with goto-line command.
* Fix word left to behave like `vi(1)`.
* Add basic UTF-8 support.
### Updates
<!--
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/
-->
+666
View File
@@ -0,0 +1,666 @@
<!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/howe - Nice accent eh-ward</title>
<link rel="icon" type="image/x-icon" href="../../favicon.ico">
<meta name="description" content="2024 IOCCC entry howe - Nice accent eh-ward">
<meta name="keywords" content="IOCCC, 2024, IOCCC 2024, IOCCC entry, howe, Nice accent eh-ward">
</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/howe/README.md -->
<!-- -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- !!! Do not modify this web page, instead modify the file: 2024/howe/README.md !!! -->
<!-- !!! Do not modify this web page, instead modify the file: 2024/howe/README.md !!! -->
<!-- !!! Do not modify this web page, instead modify the file: 2024/howe/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/howe - Nice accent eh-ward</h2>
<h3>mini vi</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="../ferguson2/index.html">&larr; 2024/ferguson2</a>
<a class="Left" href="../index.html">&uarr; 2024 &uarr;</a>
<a class="Left" href="../kramer/index.html">2024/kramer &rarr;</a>
<a class="Right" href="https://github.com/ioccc-src/winner/blob/master/2024/howe/prog.c">C code</a>
<a class="Right" href="https://github.com/ioccc-src/winner/blob/master/2024/howe/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%2Fhowe%2Findex.html">&#x2713;</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#Anthony_C_Howe">Anthony C Howe</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/howe/README.md -->
<h2 id="to-build">To build:</h2>
<pre><code> make all</code></pre>
<h3 id="bugs-and-misfeatures">Bugs and (Mis)features:</h3>
<p>The current status of this entry is:</p>
<blockquote>
<p><strong>STATUS: known bug - please help us fix</strong></p>
</blockquote>
<p>For more detailed information see <a href="../../bugs.html#2024_howe">2024/howe in bugs.html</a>.</p>
<h2 id="try">Try:</h2>
<pre><code> ./try.sh</code></pre>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>This is not your grandmother’s 👵 <code>emacs(1)</code> 🤓, nor is it as limited as <code>ed(1)</code>, eh (🇨🇦)?</p>
<p>The source (and of this program) has fun with an UTF-8 conforming accent, in a manor of speaking 😉.</p>
<blockquote>
<p>TL;DR - to exit type <strong>Q</strong> or press <strong>CTRL+C</strong>.</p>
</blockquote>
<p>As mentioned in in the <a href="prog.html#commands">COMMANDS section of prog.html</a>, try these commands:</p>
<pre><code> | Key cmd | Action |
|----------|------------------------------------------------------------|
| h j k l | Left, down, up, right cursor movement |
| H J K L | Page top, page down, page up, page bottom |
| b w | Word left, word right |
| | | Goto column (count) of physical line |
| /ERE | Find first occurrence of ERE pattern after the cursor |
| n | Find next occurrence of ERE |
| G | Goto line (count) number; 1G top of file, G bottom |
| \ | Toggle text selection |
| d motion | Delete text selection or region given by motion |
| y motion | Yank (copy) text selection or region given by motion |
| P | Paste last deleted or yanked text region before the cursor |
| i | Insert text mode before cursor, ESC or CTRL+C ends insert |
| u | Toggle undo of last edit |
| x | Delete character after the cursor, i.e., dl |
| W | Write buffer to file |
| Q | Quit |
| CTRL+C | Quit |</code></pre>
<p><strong>NOTE</strong>: Any other key will redraw the screen.</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
<h3 id="building">Building</h3>
<p>Simply type <code>make</code> to build. There are two macros that can be customised:</p>
<ul>
<li><p><code>BUF</code> to set the buffer size; default 128KB.</p></li>
<li><p><code>MODE</code> to set the file creation mode; default 0600.</p></li>
</ul>
<h3 id="whats-interesting">What’s Interesting</h3>
<ul>
<li><p>This is an update with bug fixes of a previous IOCCC winner, with permission of the author.</p></li>
<li><p>This entry requires Curses. Some Linux might require NCurses built with wide character support, <code>-lncursesw</code>.</p></li>
<li><p>The source is UTF-8. When are <code>é</code> <code>ë</code> <code>ê</code> <code>è</code> not same as <code>e</code>?</p></li>
<li><p>The documentation is found in <a href="prog.html">prog.html</a>.</p></li>
<li><p><code>prog</code> can view its own source.</p></li>
<li><p>A regression test suite is available on demand. The test suite requires <code>tic(1)</code> to build the specialised test terminal entry.</p></li>
<li><p>Original unobfuscated more fully featured source available (search/replace, pipe-filter selection, markers, insert file, edit buffer grows, literal character input, multi undo/redo).</p></li>
<li><p>The <code>iocccsize(1)</code> tool only counts bytes, not characters, i.e,. UTF-8 multibyte characters such that some characters cost 2, 3, or 4 bytes, thus penalising UTF-8 entries.</p>
<blockquote>
<p>UTF-8 demands equal rights and respect as real characters! The dominance of slim ASCII must end! We are the UTF-8 People’s Front for Freedom, Equality, and Brotherhood (oh that’s been used already) - We are the UTF-8 Countless Tourist Defence Farce for One Voice, One World, One Character Set.</p>
</blockquote></li>
</ul>
<p>Furthermore:</p>
<ul>
<li><p>Refactor page framing to address original issue of scrolling and paging up/down when the file contains long lines.</p></li>
<li><p>CTRL+C will exit insert mode as with <code>vi(1)</code>; CTRL+C will also quit, unlike <code>vi(1)</code>, for those who cannot find <code>Q</code>.</p></li>
<li><p>Add extended regular expression forward search with buffer wrap-around.</p></li>
<li><p>Add text selection with delete (cut), yank (copy), and put (paste).</p></li>
<li><p>Add delete (cut), yank (copy) with motion.</p></li>
<li><p>Replace start/end of line with goto-column command.</p></li>
<li><p>Add counts for motion commands, delete, and put.</p></li>
<li><p>Replace top/end of file with goto-line command.</p></li>
<li><p>Fix word left to behave like <code>vi(1)</code>.</p></li>
<li><p>Add basic UTF-8 support.</p></li>
</ul>
<h3 id="updates">Updates</h3>
<!--
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/howe/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-2024howe">Inventory for 2024/howe</h1>
</div>
<h2 id="primary-files">Primary files</h2>
<ul>
<li><a href="https://github.com/ioccc-src/winner/blob/master/2024/howe/prog.c">prog.c</a> - entry source code</li>
<li><a href="https://github.com/ioccc-src/winner/blob/master/2024/howe/Makefile">Makefile</a> - entry Makefile</li>
<li><a href="https://github.com/ioccc-src/winner/blob/master/2024/howe/prog.orig.c">prog.orig.c</a> - original source code</li>
<li><a href="https://github.com/ioccc-src/winner/blob/master/2024/howe/prog.html">prog.html</a> - eh man page</li>
<li><a href="https://github.com/ioccc-src/winner/blob/master/2024/howe/try.sh">try.sh</a> - script to try entry</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a href="2024_howe.tar.bz2">2024_howe.tar.bz2</a> - download entry tarball</li>
<li><a href="https://github.com/ioccc-src/winner/blob/master/2024/howe/README.md">README.md</a> - markdown source for this web page</li>
<li><a href="https://github.com/ioccc-src/winner/blob/master/2024/howe/.entry.json">.entry.json</a> - entry summary and manifest in JSON</li>
<li><a href="https://github.com/ioccc-src/winner/blob/master/2024/howe/.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="https://github.com/ioccc-src/winner/blob/master/2024/howe/prog.md">prog.md</a> - markdown source for prog.html</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 &copy; 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%2Fhowe%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 -->
+428
View File
@@ -0,0 +1,428 @@
int y,x,z,w;
char *f,*q;
char b[BUF],*g = b,*h,*c,*ó,*ò;
long o,ö,u,v,l,Q,d = -1;
regex_t e;
void
T(int);
long
P(char *s)
{
return s-b - (s < h ? 0 : h-g);
}
char *
Z(long m)
{
return b+m + (b+m < g ? 0 : h-g);
}
int
S(int a)
{
return 1+(a > 193)+(a > 223)+(a > 239);
}
long
E(long m)
{
return m + (m < P(c) ? S(*Z(m)) : 0);
}
long
D(long m)
{
while (0 < m and (192 bitand *Z(--m)) == 128)
;
return m;
}
void
Û()
{
char *p = ó;
ó = g;
g = p;
p = ò;
ò = h;
h = p;
v = ö;
ö = o;
o = v;
v = o+1;
}
void
V(long m)
{
char *p = Z(m);
while (p < g)
*--h = *--g;
while (h < p)
*g++ = *h++;
ó = g;
ò = h;
ö = o;
}
int
G(char *s,int a)
{
wint_t t;
mbtowc(&t,s,4);
return t == '\t' ? (8-((a bitand 7))) : (a = wcwidth(t)) < 1 ? 1 : a;
}
long
O(long m)
{
while (0 < m and *Z(--m) not_eq '\n')
;
return (m+1) * (0 < m);
}
long
A(long m,int a,int n)
{
char *p;
while (a < n and (p = Z(m)) < c and *p not_eq '\n') {
a += G(p,a);
m = E(m);
}
return m;
}
long
_(long m,long n)
{
char *p;
int a = 0;
long i = m;
while (m < n and (p = Z(m = E(m))) < c) {
a += G(p,a);
if (COLS <= a) {
i = m;
a = 0;
}
}
return i;
}
long
M(long m)
{
long s = O(m);
long t = _(s,m);
if (s < t)
return _(s,t-1);
return _(O(s-1),s-1);
}
long
N(long m)
{
return E(A(m,x,COLS-1));
}
void
C()
{
printw("%*s",COLS-getcurx(stdscr),"");
}
void
Y()
{
char *p;
int i,j;
long s,t,n = P(c);
if (o < u)
u = _(O(o),o);
else if (v <= o and o < N(v))
u = N(u);
else if (v <= o) {
v = u;
for (u = o,i = LINES-1 - (o == n); 0 < --i and v < u; ) {
u = M(u);
}
if (u < v)
u = v;
}
erase();
standout();
printw("%s %ldB",f,o);
C();
if (d < 0)
s = t = d;
else if (o < d) {
s = o;
t = d;
}
else {
s = d;
t = o;
}
for (i = 1,j = 0,v = u; standend(),i < LINES; ) {
if (o == v) {
y = i;
x = j;
}
if (c <= (p = Z(v)))
break;
if (s <= v and v < t)
standout();
int t = S(*p);
mvaddnstr(i,j,p,t);
v += t;
j += G(p,j);
if (*p == '\n' or COLS <= j) {
j = 0;
i++;
}
}
if (i++ < LINES) {
standout();
mvaddstr(i,0,"^D");
}
move(y,x);
refresh();
}
void
🔥()
{
clear();
z = 0;
}
void
H()
{
o = D(o);
}
void
L()
{
o = E(o);
}
void
K()
{
o = A(M(o),0,x);
}
void
J()
{
o = A(N(o),0,x);
}
void
a()
{
o = A(O(o),0,z-1);
z = 0;
}
void
B()
{
while (0 < o and isspace(*Z(o-1)))
--o;
while (0 < o and not isspace(*Z(o-1)))
--o;
}
void
Ê()
{
o = u;
}
void
Ë()
{
o = _(O(v-1),v-1);
}
void
É()
{
int i;
for (o = v,i = 1; i < y; i++)
o = N(o);
o = A(o,0,x);
u = o < P(c) ? v : u;
for (v = o; i < LINES; i++)
v = N(v);
}
void
È()
{
for (int i = LINES-1; 0 < i--; )
o = M(o);
for (u = o; 1 < y--; )
u = M(u);
o = A(o,0,x);
}
void
W()
{
long n = P(c);
while (o < n and not isspace(*Z(o)))
++o;
while (o < n and isspace(*Z(o)))
++o;
}
void
ө()
{
long n = P(c);
for (o = n * (not z); o < n and 1 < z; z--) {
o = A(o,0,999);
o += o < n;
}
u = n;
}
void
I()
{
int a,t;
long n = P(c);
V(o);
while ((a =getch()) not_eq 3 and a not_eq 27) {
t = S(a);
if (a == 8) {
while (n < P(c) and (192 bitand *--g) == 128)
;
}
else if (g+t < h) {
do {
*g++ = a;
v++;
} while (0 < --t and (a = getch()));
}
o = P(h);
Y();
}
z = 0;
}
void
Ô()
{
long i = d;
if (d < 0) {
i = o;
T(14);
}
if (i < o) {
i xor_eq o;
o xor_eq i;
i xor_eq o;
}
free(q);
V(o);
q = strndup(h,Q = i-o);
d = -1;
}
void
X()
{
Ô();
h += Q;
o = P(h);
}
void
Ó()
{
ungetch('l');
X();
}
void
Í()
{
if (q) {
V(o);
memcpy(g,q,Q);
g += Q;
o = P(h);
v = o+1;
}
}
void
κ()
{
int i;
V(0);
write(i = creat(f,MODE),h,c-h);
close(i);
}
void
Ф()
{
f = 0;
}
void
F()
{
regmatch_t p[1];
V(P(c));
*g = 0;
if (o+l < P(c) and not regexec(&e,Z(o+l),1,p,REG_NOTBOL))
o += l + p->rm_so;
else if (not regexec(&e,b,1,p,0))
o = p->rm_so;
else {
l = 0;
return;
}
l = p->rm_eo - p->rm_so + w;
}
void
Ñ()
{
echo();
standout();
mvaddch(0,0,'/');
C();
mvgetnstr(0,1,g,h-g);
regfree(&e);
if (regcomp(&e,g,REG_EXTENDED bitor REG_NEWLINE))
beep();
else {
w = g[0] == '$' and not g[1];
F();
}
z = 0;
}
void
Â()
{
d = d < 0 ? o : -1;
}
char Ќ[] = "hjklbwHJKL|G/nixydPu\\WQ\003";
void (*Κ[])(void) = {
H,J,K,L,B,W,
Ê,É,È,Ë,
a,ө,
Ñ,F,
I,Ó,
Ô,X,Í,Û,
Â,κ,Ф,Ф,
🔥
};
void
T(int m)
{
int j = z,a;
for (z = 0; isdigit(a =getch()); )
z = z * 10 + a - '0';
z = j and z ? j*z : z ? z : j;
for (j = 0; Ќ[j] and a not_eq Ќ[j]; j++)
;
if (j < m) {
do (*Κ[j])(); while (1 < z--);
}
z = 0;
}
int
main(int i,char **j)
{
setlocale(LC_ALL,"");
if (not initscr())
return 1;
raw();
h = c = b + BUF;
if (0 < (i = open(f = *++j,0))) {
g += read(i,b,c-b);
close(i);
if (g < b or c <= g)
return 2;
}
v = 1;
while (f) {
noecho();
Y();
T(99);
}
endwin();
return 0;
}
+592
View File
@@ -0,0 +1,592 @@
<!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>The International Obfuscated C Code Contest</title>
<link rel="icon" type="image/x-icon" href="../../favicon.ico">
<meta name="description" content="prog.md for 2024/howe">
<meta name="keywords" content="IOCCC, 2024/howe, prog.md">
</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/gen-other-html.sh -->
<!-- The content of main section of this web page came from: 2024/howe/prog.md -->
<!-- -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- !!! Do not modify this web page, instead modify the file: 2024/howe/prog.md !!! -->
<!-- !!! Do not modify this web page, instead modify the file: 2024/howe/prog.md !!! -->
<!-- !!! Do not modify this web page, instead modify the file: 2024/howe/prog.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>prog.html for 2024/howe</h2>
</div>
<!-- END: this line ends content from: inc/header.default.html -->
<!-- START: this line starts content from: inc/navbar.up2index.html -->
<div class="navbar">
<a class="Left" href="index.html">&uarr; jump to 2024/howe/index.html &uarr;</a>
<a class="Right" href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fwww.ioccc.org%2F2024%2Fhowe%2Fprog.html">&#x2713;</a>
</div>
<!-- END: this line ends content from: inc/navbar.up2index.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 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<!-- BEFORE: 1st line of markdown file: 2024/howe/prog.md -->
<h1 id="eh1">eh(1)</h1>
<h2 id="name">NAME</h2>
<p>eh - Edit Here - vi(1) the good parts version</p>
<h2 id="synopsis">SYNOPSIS</h2>
<p>eh filename</p>
<h2 id="description">DESCRIPTION</h2>
<p>A minimalist version of <code>vi(1)</code>. It is an example of the “Buffer Gap” method outlined in the <a href="http://www.finseth.com/craft/">The Craft Of Text Editing</a> used by many Emacs style editors. (Yep I mixed <code>vi</code> and <code>emacs</code> in the same paragraph; I’m going to hell for that one.)</p>
<p>Create or read a text file to edit. Text files consists of lines of printable UTF-8 text, tabs, or newline characters. A physical line can be of arbitrary length and is delimited by either a newline or the end of file. Tab stops are every eight columns. The behaviour of non-printable characters may vary depending on the implementation of the Curses library, <code>stty(1)</code> settings, or terminal emulator.</p>
<h2 id="commands">COMMANDS</h2>
<p>The commands are similar, but not the same as <code>vi(1)</code>. Most commands can be prefixed by a repeat count, eg. <code>5w</code>, <code>123G</code>, <code>2dw</code> (<code>d2w</code>), or <code>2d3w</code> (<code>d6w</code>). Motion commands, optionally prefixed by a count, are those that move the cursor without modifying the buffer. Some edit commands can be followed by a motion.</p>
<p>h j k l Left, down, up, right cursor movement.
H J K L Page top, page down, page up, page bottom.
b w Word left, word right.
| Goto column (count) of physical line.
/ERE Find first occurrence of ERE pattern after the cursor.
n Find next occurrence of ERE.
G Goto line (count) number; <strong>1G</strong> top of file, <strong>G</strong> bottom.
  Toggle text selection.
d motion Delete text selection or region given by motion.
y motion Yank (copy) text selection or region given by motion.
P Paste last deleted or yanked text region before the cursor.
i Insert text mode before the cursor, <strong>ESC</strong> or <strong>CTRL+C</strong> ends insert.
u Toggle undo of last edit.
x Delete character after the cursor, i.e., <strong>dl</strong>
W Write buffer to file.
Q Quit.
CTRL+C Quit.</p>
<p>Any other key will redraw the screen.</p>
<h2 id="environment">ENVIRONMENT</h2>
<ul>
<li><p><code>TERM</code> : The user’s terminal type. If the environmental variable <code>TERM</code> is not set or insufficient then terminate with non-zero exit status.</p></li>
<li><p><code>TERMINFO</code> : The absolute file path of a <code>terminfo</code> database. See <code>terminfo(5)</code>.</p></li>
</ul>
<h2 id="exit-status">EXIT STATUS</h2>
<ul>
<li>0 Success</li>
<li>1 Insufficient capabilities for <code>TERM</code>.</li>
<li>2 Read file error</li>
</ul>
<h2 id="see-also">SEE ALSO</h2>
<p><code>ed(1)</code>, <code>ex(1)</code>, <code>vi(1)</code></p>
<h2 id="notes">NOTES</h2>
<ul>
<li><p>Has UTF-8 support.</p>
<ul>
<li>Loads UTF-8 files as-is and internally remains UTF-8 (not converteed to <code>wchar_t</code>).</li>
<li>UTF-8 input will likely require an intl. keyboard or enabling <a href="https://en.wikipedia.org/wiki/QWERTY#US-International">US Intl. dead-key keyboard</a> support. See also <a href="https://en.wikipedia.org/wiki/Unicode_input">Unicode Input</a>.</li>
</ul></li>
<li><p>The display of long physical lines that are larger than the terminal screen is untested, so considered undefined.</p></li>
<li><p>CRLF newlines (DOS, Windows) and other non-spacing control characters are not visible. Consider converting newlines using SUS tools like <code>awk(1)</code> or <code>sed(1)</code>:</p>
<p>$ sed -e’s/<sup>V</sup>M$//’ dos.txt &gt; unix.txt
$ sed -e’s/$/<sup>V</sup>M/’ unix.txt &gt; dos.txt</p>
<p><code>^V</code> is the default <code>stty(1)</code> insert literal prefix key.</p></li>
</ul>
<h2 id="references">REFERENCES</h2>
<ul>
<li><p>Craig A. Finseth, “Craft Of Text Editing”, 1999
<a href="http://www.finseth.com/craft/" class="uri">http://www.finseth.com/craft/</a></p></li>
<li><p>Single Unix Specification, Curses issue 7
<a href="https://pubs.opengroup.org/onlinepubs/9699909599/toc.pdf" class="uri">https://pubs.opengroup.org/onlinepubs/9699909599/toc.pdf</a></p></li>
<li><p>Single Unix Specification, Base Specification 2018, vi(1)
<a href="https://pubs.opengroup.org/onlinepubs/9699919799/utilities/vi.html" class="uri">https://pubs.opengroup.org/onlinepubs/9699919799/utilities/vi.html</a>
<!-- AFTER: last line of markdown file: 2024/howe/prog.md --></p></li>
</ul>
<!-- END: this line ends content for HTML phase 21 by: bin/pandoc-wrapper.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.default.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 &copy; 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%2Fhowe%2Fprog.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>
</p>
</div>
</div>
<!-- END: this line ends content from: inc/footer.default.html -->
<!-- START: this line starts content from: inc/bottom.default.html -->
</body>
</html>
<!-- END: this line ends content from: inc/bottom.default.html -->
+91
View File
@@ -0,0 +1,91 @@
# eh(1)
## NAME
eh - Edit Here - vi(1) the good parts version
## SYNOPSIS
eh filename
## DESCRIPTION
A minimalist version of `vi(1)`. It is an example of the "Buffer Gap" method outlined in the [The Craft Of Text Editing](http://www.finseth.com/craft/) used by many Emacs style editors. (Yep I mixed `vi` and `emacs` in the same paragraph; I'm going to hell for that one.)
Create or read a text file to edit. Text files consists of lines of printable UTF-8 text, tabs, or newline characters. A physical line can be of arbitrary length and is delimited by either a newline or the end of file. Tab stops are every eight columns. The behaviour of non-printable characters may vary depending on the implementation of the Curses library, `stty(1)` settings, or terminal emulator.
## COMMANDS
The commands are similar, but not the same as `vi(1)`. Most commands can be prefixed by a repeat count, eg. `5w`, `123G`, `2dw` (`d2w`), or `2d3w` (`d6w`). Motion commands, optionally prefixed by a count, are those that move the cursor without modifying the buffer. Some edit commands can be followed by a motion.
h j k l Left, down, up, right cursor movement.
H J K L Page top, page down, page up, page bottom.
b w Word left, word right.
| Goto column (count) of physical line.
/ERE Find first occurrence of ERE pattern after the cursor.
n Find next occurrence of ERE.
G Goto line (count) number; **1G** top of file, **G** bottom.
\ Toggle text selection.
d motion Delete text selection or region given by motion.
y motion Yank (copy) text selection or region given by motion.
P Paste last deleted or yanked text region before the cursor.
i Insert text mode before the cursor, **ESC** or **CTRL+C** ends insert.
u Toggle undo of last edit.
x Delete character after the cursor, i.e., **dl**
W Write buffer to file.
Q Quit.
CTRL+C Quit.
Any other key will redraw the screen.
## ENVIRONMENT
* `TERM` : The user's terminal type. If the environmental variable `TERM` is not set or insufficient then terminate with non-zero exit status.
* `TERMINFO` : The absolute file path of a `terminfo` database. See `terminfo(5)`.
## EXIT STATUS
- 0 Success
- 1 Insufficient capabilities for `TERM`.
- 2 Read file error
## SEE ALSO
`ed(1)`, `ex(1)`, `vi(1)`
## NOTES
* Has UTF-8 support.
- Loads UTF-8 files as-is and internally remains UTF-8 (not converteed to `wchar_t`).
- UTF-8 input will likely require an intl. keyboard or enabling [US Intl. dead-key keyboard](https://en.wikipedia.org/wiki/QWERTY#US-International) support. See also [Unicode Input](https://en.wikipedia.org/wiki/Unicode_input).
* The display of long physical lines that are larger than the terminal screen is untested, so considered undefined.
* CRLF newlines (DOS, Windows) and other non-spacing control characters are not visible. Consider converting newlines using SUS tools like `awk(1)` or `sed(1)`:
$ sed -e's/^V^M$//' dos.txt > unix.txt
$ sed -e's/$/^V^M/' unix.txt > dos.txt
`^V` is the default `stty(1)` insert literal prefix key.
## REFERENCES
* Craig A. Finseth, "Craft Of Text Editing", 1999
<http://www.finseth.com/craft/>
* Single Unix Specification, Curses issue 7
<https://pubs.opengroup.org/onlinepubs/9699909599/toc.pdf>
* Single Unix Specification, Base Specification 2018, vi(1)
<https://pubs.opengroup.org/onlinepubs/9699919799/utilities/vi.html>
+428
View File
@@ -0,0 +1,428 @@
int y,x,z,w;
char *f,*q;
char b[BUF],*g = b,*h,*c,*ó,*ò;
long o,ö,u,v,l,Q,d = -1;
regex_t e;
void
T(int);
long
P(char *s)
{
return s-b - (s < h ? 0 : h-g);
}
char *
Z(long m)
{
return b+m + (b+m < g ? 0 : h-g);
}
int
S(int a)
{
return 1+(a > 193)+(a > 223)+(a > 239);
}
long
E(long m)
{
return m + (m < P(c) ? S(*Z(m)) : 0);
}
long
D(long m)
{
while (0 < m and (192 bitand *Z(--m)) == 128)
;
return m;
}
void
Û()
{
char *p = ó;
ó = g;
g = p;
p = ò;
ò = h;
h = p;
v = ö;
ö = o;
o = v;
v = o+1;
}
void
V(long m)
{
char *p = Z(m);
while (p < g)
*--h = *--g;
while (h < p)
*g++ = *h++;
ó = g;
ò = h;
ö = o;
}
int
G(char *s,int a)
{
wint_t t;
mbtowc(&t,s,4);
return t == '\t' ? (8-((a bitand 7))) : (a = wcwidth(t)) < 1 ? 1 : a;
}
long
O(long m)
{
while (0 < m and *Z(--m) not_eq '\n')
;
return (m+1) * (0 < m);
}
long
A(long m,int a,int n)
{
char *p;
while (a < n and (p = Z(m)) < c and *p not_eq '\n') {
a += G(p,a);
m = E(m);
}
return m;
}
long
_(long m,long n)
{
char *p;
int a = 0;
long i = m;
while (m < n and (p = Z(m = E(m))) < c) {
a += G(p,a);
if (COLS <= a) {
i = m;
a = 0;
}
}
return i;
}
long
M(long m)
{
long s = O(m);
long t = _(s,m);
if (s < t)
return _(s,t-1);
return _(O(s-1),s-1);
}
long
N(long m)
{
return E(A(m,x,COLS-1));
}
void
C()
{
printw("%*s",COLS-getcurx(stdscr),"");
}
void
Y()
{
char *p;
int i,j;
long s,t,n = P(c);
if (o < u)
u = _(O(o),o);
else if (v <= o and o < N(v))
u = N(u);
else if (v <= o) {
v = u;
for (u = o,i = LINES-1 - (o == n); 0 < --i and v < u; ) {
u = M(u);
}
if (u < v)
u = v;
}
erase();
standout();
printw("%s %ldB",f,o);
C();
if (d < 0)
s = t = d;
else if (o < d) {
s = o;
t = d;
}
else {
s = d;
t = o;
}
for (i = 1,j = 0,v = u; standend(),i < LINES; ) {
if (o == v) {
y = i;
x = j;
}
if (c <= (p = Z(v)))
break;
if (s <= v and v < t)
standout();
int t = S(*p);
mvaddnstr(i,j,p,t);
v += t;
j += G(p,j);
if (*p == '\n' or COLS <= j) {
j = 0;
i++;
}
}
if (i++ < LINES) {
standout();
mvaddstr(i,0,"^D");
}
move(y,x);
refresh();
}
void
🔥()
{
clear();
z = 0;
}
void
H()
{
o = D(o);
}
void
L()
{
o = E(o);
}
void
K()
{
o = A(M(o),0,x);
}
void
J()
{
o = A(N(o),0,x);
}
void
a()
{
o = A(O(o),0,z-1);
z = 0;
}
void
B()
{
while (0 < o and isspace(*Z(o-1)))
--o;
while (0 < o and not isspace(*Z(o-1)))
--o;
}
void
Ê()
{
o = u;
}
void
Ë()
{
o = _(O(v-1),v-1);
}
void
É()
{
int i;
for (o = v,i = 1; i < y; i++)
o = N(o);
o = A(o,0,x);
u = o < P(c) ? v : u;
for (v = o; i < LINES; i++)
v = N(v);
}
void
È()
{
for (int i = LINES-1; 0 < i--; )
o = M(o);
for (u = o; 1 < y--; )
u = M(u);
o = A(o,0,x);
}
void
W()
{
long n = P(c);
while (o < n and not isspace(*Z(o)))
++o;
while (o < n and isspace(*Z(o)))
++o;
}
void
ө()
{
long n = P(c);
for (o = n * (not z); o < n and 1 < z; z--) {
o = A(o,0,999);
o += o < n;
}
u = n;
}
void
I()
{
int a,t;
long n = P(c);
V(o);
while ((a =getch()) not_eq 3 and a not_eq 27) {
t = S(a);
if (a == 8) {
while (n < P(c) and (192 bitand *--g) == 128)
;
}
else if (g+t < h) {
do {
*g++ = a;
v++;
} while (0 < --t and (a = getch()));
}
o = P(h);
Y();
}
z = 0;
}
void
Ô()
{
long i = d;
if (d < 0) {
i = o;
T(14);
}
if (i < o) {
i xor_eq o;
o xor_eq i;
i xor_eq o;
}
free(q);
V(o);
q = strndup(h,Q = i-o);
d = -1;
}
void
X()
{
Ô();
h += Q;
o = P(h);
}
void
Ó()
{
ungetch('l');
X();
}
void
Í()
{
if (q) {
V(o);
memcpy(g,q,Q);
g += Q;
o = P(h);
v = o+1;
}
}
void
κ()
{
int i;
V(0);
write(i = creat(f,MODE),h,c-h);
close(i);
}
void
Ф()
{
f = 0;
}
void
F()
{
regmatch_t p[1];
V(P(c));
*g = 0;
if (o+l < P(c) and not regexec(&e,Z(o+l),1,p,REG_NOTBOL))
o += l + p->rm_so;
else if (not regexec(&e,b,1,p,0))
o = p->rm_so;
else {
l = 0;
return;
}
l = p->rm_eo - p->rm_so + w;
}
void
Ñ()
{
echo();
standout();
mvaddch(0,0,'/');
C();
mvgetnstr(0,1,g,h-g);
regfree(&e);
if (regcomp(&e,g,REG_EXTENDED bitor REG_NEWLINE))
beep();
else {
w = g[0] == '$' and not g[1];
F();
}
z = 0;
}
void
Â()
{
d = d < 0 ? o : -1;
}
char Ќ[] = "hjklbwHJKL|G/nixydPu\\WQ\003";
void (*Κ[])(void) = {
H,J,K,L,B,W,
Ê,É,È,Ë,
a,ө,
Ñ,F,
I,Ó,
Ô,X,Í,Û,
Â,κ,Ф,Ф,
🔥
};
void
T(int m)
{
int j = z,a;
for (z = 0; isdigit(a =getch()); )
z = z * 10 + a - '0';
z = j and z ? j*z : z ? z : j;
for (j = 0; Ќ[j] and a not_eq Ќ[j]; j++)
;
if (j < m) {
do (*Κ[j])(); while (1 < z--);
}
z = 0;
}
int
main(int i,char **j)
{
setlocale(LC_ALL,"");
if (not initscr())
return 1;
raw();
h = c = b + BUF;
if (0 < (i = open(f = *++j,0))) {
g += read(i,b,c-b);
close(i);
if (g < b or c <= g)
return 2;
}
v = 1;
while (f) {
noecho();
Y();
T(99);
}
endwin();
return 0;
}
+26
View File
@@ -0,0 +1,26 @@
#!/usr/bin/env bash
#
# try.sh - demonstrate 2024/howe
# 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.
if [[ -z "$CC" ]]; then
CC="cc"
fi
make CC="$CC" all >/dev/null || exit 1
read -r -n 1 -p "Press any key to form foo: "
echo 1>&2
rm -f foo
cp prog.c foo
echo 1>&2
echo 'NOTE: To update file, press W' 1>&2
echo 'NOTE: To exit, press Q or press CTRL+C' 1>&2
echo 1>&2
read -r -n 1 -p "Press any key to run: ./eh foo "
echo 1>&2
./eh foo
echo 1>&2