Skip to main content

Questions tagged [interactive]

Used for challenges that require user interaction during their runtime

Filter by
Sorted by
Tagged with
88 votes
61 answers

Shut down the computer!

Challenge: In the programming language of your choice, shut down the machine that your code was executed on. Rules No shutting down by resource exhaustion (e.g.: forkbomb to force shutdown) You are ...
Offtkp's user avatar
  • 3,062
54 votes
58 answers

Create a Checkbox

Write a program that creates a two-state checkbox that people can interact with using a mouse. Specifically, your program should achieve all of the following: Have a 8×8 pixel (or larger if desired) ...
Calvin's Hobbies's user avatar
53 votes
6 answers

Visualize Visual Eyes

You may or may not remember Xeyes, a demo program that came with (and, as far as I know, still comes with) the X window system. Its purpose was to draw a pair of eyes that followed your mouse cursor: ...
Jordan's user avatar
  • 10.1k
51 votes
26 answers

Create a Paint program!

Introduction One day, you were showing your kid how to draw on a computer. You type mspaint.exe in the run bar. To your horror, it says "No items match your ...
Luke B's user avatar
  • 777
49 votes
23 answers

Type the Alphabet - as fast as you can!

Your task is to make a program that measures how fast you can type the letters of the English alphabet. The program shall only accept lowercase letters a to ...
Danko Durbić's user avatar
42 votes
25 answers

Impatiently wait for input

Your task today is to implement a time limit for getting input, a task I've found rather annoying to achieve in most languages. You will create a program function which prompts the user for input. ...
Pavel's user avatar
  • 9,377
37 votes
19 answers

Map inputted ASCII characters

Be sure to see the other challenge, Reverse ASCII character map! The ASCII charset (American Standard Code for Information Interchange) is the most widely-used character encoding standard. ASCII ...
MD XF's user avatar
  • 13.9k
36 votes
66 answers

Insist on an answer

At runtime, keep prompting for a line of input until the user inputs something (other than an empty newline), i.e. does not just press Enter or OK. Output or result is neither required nor prohibited. ...
Adám's user avatar
  • 30.6k
32 votes
20 answers

Laggy text editor

Your challenge is to write a program that constantly prompts for input, and when input is given, output that five seconds* later. However, your program must continue prompting for input during that ...
emanresu A's user avatar
27 votes
14 answers

The shortest distance between two points is a line

Code a program or function to construct an interactive canvas on the screen of at least 400 pixels x 400 pixels in size. The canvas can be any color you wish, bordered or borderless, with or without a ...
AdmBorkBork's user avatar
  • 43.5k
24 votes
17 answers

Implement a Stopwatch

Implement a simple digital Stopwatch, which will display the time elapsed in seconds and minutes, as described below. Important Please read both Display and Controls sections ! Display Time elapsed, ...
zeppelin's user avatar
  • 8,496
19 votes
23 answers

Insist on a new filename

At runtime, keep prompting for a line of input until the user input is not the name of an existing file or directory or other file system item, relative to the current working directory. Then return/...
Adám's user avatar
  • 30.6k
19 votes
18 answers

Create a simple line editor

In: a string without line breaks* Allow the user to edit and submit the line Out: the modified string (optionally with a trailing linebreak) The line editor must at minimum allow the user to: move a ...
Adám's user avatar
  • 30.6k
15 votes
3 answers

PNZ (Guess 3 unique digits in order)

From a challenge in a programming book long ago, PNZ is a game where the user must guess three unique digits in the correct order. Rules: A random 3 digit number with no repeating digits is ...
MrPublic's user avatar
  • 709
14 votes
3 answers

Check all the keys of a keyboard

Write the shortest program that waits for every key of a Standard 101 key US Keyboard* to be pressed and then exits writing OK! Every time a key is pressed the program displays on a new line the ...
Eduard Florinescu's user avatar
14 votes
2 answers

Interactive Maze Solver

Bob got kidnapped and is stuck in a maze. Your job is to help him find a way out. But since it is a very dark and scary maze, he can't see anything. He can only feel walls when he runs in to it, and ...
Maltysen's user avatar
  • 25.7k
13 votes
12 answers

The worst spaghetti code

Objective Write a full program that works exactly like the flow chart below. Each output, which is an integer, shall be through stdout, followed by a line feed. ...
Dannyu NDos's user avatar
  • 5,961
12 votes
5 answers

See you in another life, brotha!

Most of us LOST fans out there remember the computer that Desmond had to type the characters "4 8 15 16 23 42" in every 108 minutes or the world would end (or would it?). The challenge here is to ...
Jacob Misirian's user avatar
12 votes
1 answer

Implement MENACE

Background MENACE (Machine Educable Noughts And Crosses Engine) is a rudimentary shallow machine learning algorithm for the game Noughts and Crosses, created by British computer scientist Donald ...
Geza Kerecsenyi's user avatar
10 votes
10 answers

Play a dumb coinflip game

Write an interactive program or function which allows the user to play The Coinflip Game! The object of the game is to repeatedly flip a coin until you get the same result \$n\$ times in a row. ...
thejonymyster's user avatar
10 votes
11 answers

Reverse ASCII character map

In Map inputted ASCII characters, I asked you to .. map inputted ASCII characters. This time, you will do the opposite, by immediately mapping all ASCII characters, and then mapping spaces over them. ...
MD XF's user avatar
  • 13.9k
9 votes
3 answers

Guess The Array

Problem author: You are given a system with a hidden permutation of the numbers \$1, 2, 3, \ldots, n\$. Your task is to guess this permutation by asking the ...
Huỳnh Trần Khanh's user avatar
8 votes
3 answers

Implement a 2-player version of 1D Chess

The game is played on a 1x8 board with the following setup: KNR..rnk White's pieces are on the left, while black's pieces are on the right. The king (K) can move 1 ...
Quadruplay's user avatar
5 votes
2 answers

The Great Betting Game

Your task is to create either a console "app" or a function which allows the user to bet on certain numbers or retire / claim rounds. Bets Your program or function will prompt for a command ...
user avatar
-5 votes
5 answers

Make an ed clone

ed is the standard text editor on Unix systems. Your goal is to write an ed clone. Task Write a program that reads an input stream and for every received end of line character, print ...
12431234123412341234123's user avatar