New: 77 pattern programs with tested code in C, C++, Java and Python Explore patterns

Code Playground

Write, edit and run C, C++ and Python programs right here in your browser. It is free, there is nothing to install and no sign-up. Start with the pyramid program below, change it, and press Run.

Loading the editor…

How to use the playground

  1. Pick a language tab: C, C++, Java or Python.
  2. Edit the code. Tab indents, and Ctrl + Enter runs the program.
  3. If your program reads input (scanf, cin or input()), type the values in the Input box, one per line.
  4. Press Run. The output, and any compiler or runtime errors, appear underneath.
  5. Stop ends a program that runs too long, Reset brings back the original code and Copy copies your code.

Good to know

  • Python is real Python 3.14 (Pyodide) with the standard library.
  • C and C++ use the real Clang compiler (C++17) running inside your browser. The first C or C++ run downloads about 26 MB once; your browser keeps it for next time.
  • Java can be edited and copied here, but not run yet. To run it on your computer, install the JDK and use javac and java.
  • Programs stop after 10 seconds or 100,000 characters of output. They cannot use the network or open files.
  • Your code never leaves your device: nothing is sent to our server and nothing is stored. See the privacy policy.
  • It works best on a computer. The C/C++ compiler needs a lot of memory, so it may not start on some older phones.

Practise with pattern programs

Every pattern article has an Edit & Run button under each program, so you can change the size or the characters and see what happens. Good places to start: