Skip to main content

Questions tagged [stateful]

Challenges involving behaviour that depends on previous invocations of the solution.

19 votes
13 answers
2k views

Sandbox Your challenge is to write a program that when first run, will do one of the actions below at random with equal chances of both: A cat program A standard cat program: read everything from <...
CreaZyp154's user avatar
14 votes
6 answers
1k views

I have so many secrets and nowhere to keep them! The goal is simple: write a program that lets you save a string and have it be protected by a password. The program will take an alias, password and (...
Quinn's user avatar
  • 1,363
14 votes
11 answers
4k views

I have a colleague at work that works from home every Tuesday and Thursday. At around 8:00 AM he sends us a message with the following text: Hello today I'm working from home In order to relieve him ...
Charlie's user avatar
  • 13k
49 votes
41 answers
15k views

Your Programs: You'll write two programs (both in the same language). The storage program takes a string from STDIN and stores it somewhere persistent (see below) and then exits without error. The ...
Jared K's user avatar
  • 893
12 votes
4 answers
468 views

Write an indefinitely-running program that reports how many instances of itself are currently running. Each instance of the program should also report the order in which it was opened out of all other ...
darrylyeo's user avatar
  • 7,937
12 votes
4 answers
753 views

Your task is to write a program or function which: When run for the first time, outputs its source code. On subsequent executions, it should output what it output previously, but with one random ...
Esolanging Fruit's user avatar
14 votes
15 answers
3k views

Now, we all know most languages have very simple ways to "self-modify" code. However, what if you were to actually modify the code and edit parts of it...on disk? Your goal is to make code that ...
Twilight Sparkle's user avatar
23 votes
9 answers
855 views

Your task is to write a program or function that outputs the first character of its source code, then the second, then the third... each time it is run. For example, if your program was ...
Conor O'Brien's user avatar
49 votes
34 answers
5k views

Your task is to write a full program that will continue to count down from 10 every time it is run. The first time you run the program, it should print 10. The next ...
Esolanging Fruit's user avatar
12 votes
5 answers
2k views

Warning: This challenge contains some mild spoilers for The Secret of Monkey Island. Towards the end of the game, you're being led through the catacombs by a magically preserved head of a navigator: ...
Martin Ender's user avatar
255 votes
83 answers
85k views

Goal The goal of this challenge is to write code that will execute once and only once. This means basically that it damages the program, script, or environment in some way. If rebooting the system ...
ojblass's user avatar
  • 2,877
10 votes
3 answers
859 views

Summary The aim of this challenge is to write a tenacious program. This is a stateful program designed to output a given string, but for which, if the program is aborted at any point during the ...
fgrieu's user avatar
  • 615
4 votes
6 answers
752 views

Your task is to write a program to perform set operations. The operations and arguments are taken from command line in the format program operation [argument]. ...
Alexandru's user avatar
  • 6,140