Questions tagged [interactive]

Used for challenges that require user interaction during their runtime

Filter by
Sorted by
Tagged with
88 votes
61 answers
23k views

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
53 votes
58 answers
8k views

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
52 votes
6 answers
2k views

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
  • 9,726
51 votes
26 answers
10k views

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
10k views

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
4k views

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,369
36 votes
66 answers
5k views

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
  • 29.9k
35 votes
19 answers
2k views

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.8k
32 votes
20 answers
3k views

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
  • 35.6k
27 votes
14 answers
4k views

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.3k
24 votes
17 answers
2k views

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,476
19 votes
23 answers
2k views

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
  • 29.9k
19 votes
18 answers
5k views

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
  • 29.9k
15 votes
3 answers
580 views

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
815 views

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
512 views

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
12 votes
5 answers
761 views

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
11 votes
1 answer
531 views

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
2k views

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
9 votes
3 answers
439 views

Guess The Array

Problem author: https://stats.ioinformatics.org/people/5815 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
5 votes
2 answers
231 views

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
-4 votes
5 answers
236 views

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