Skip to main content

Code Examples Gallery

Browse curated, runnable examples across 11 languages. Click any card to open, edit & run it live.

35 examples
Compiler ⚙️ C++ Intermediate

Bubble Sort in C++

Sort an array in place and print it — a first sorting algorithm.

Open & run
Playground 🎨 CSS Beginner

Center a Box with Flexbox

The classic perfectly-centered card using only three flexbox properties.

Open & run
Playground 🎨 CSS Beginner

Responsive Grid Gallery

An auto-fitting image grid that reflows to any screen width with one line of CSS.

Open & run
Playground 🌐 HTML Beginner

Semantic Article Layout

A well-structured article using header, article, section and footer landmarks.

Open & run
Compiler Java Beginner

A Simple Class in Java

Define a class, construct an object, and call a method.

Open & run
Playground JavaScript Beginner

Live Digital Clock

Update the DOM every second with setInterval and toLocaleTimeString.

Open & run
Playground JavaScript Intermediate

Tiny To-Do List

Add and remove items — a minimal intro to event handling and the DOM.

Open & run
Compiler 🐍 Python Beginner

FizzBuzz in Python

The interview classic — print 1–20 replacing multiples of 3/5.

Open & run
Compiler 🐍 Python Intermediate

List Comprehensions

Build squares and filter evens in a single readable expression.

Open & run
Compiler 🐍 Python Beginner

Hello World

Print a greeting to the console — the simplest Python program.

Open & run
Compiler 🐍 Python Beginner

Fibonacci

Generate the first N Fibonacci numbers using an iterative approach.

Open & run
Compiler 🐍 Python Intermediate

OOP Example

Create classes, constructors and methods — basic object-oriented Python.

Open & run
Compiler 🐍 Python Intermediate

List Comprehension

Build squares and flatten matrices with Python list comprehensions.

Open & run
Compiler JavaScript Beginner

Hello World

Log a greeting — the simplest JavaScript program.

Open & run
Compiler JavaScript Intermediate

Async / Await

Demonstrate Promises and async/await with sequential delays.

Open & run
Compiler JavaScript Beginner

Array Methods

Use filter, map, and reduce to transform an array of numbers.

Open & run
Compiler JavaScript Intermediate

Destructuring

Unpack nested objects and arrays with ES6 destructuring.

Open & run
Compiler 🐘 PHP Beginner

Hello World

Echo a greeting — the simplest PHP script.

Open & run
Compiler 🐘 PHP Beginner

Arrays & Loops

Iterate indexed and associative arrays with foreach and array_walk.

Open & run
Compiler 🐘 PHP Intermediate

OOP Example

Inheritance with Shape and Circle classes using typed properties.

Open & run
Compiler ⚙️ C++ Beginner

Hello World

Print to stdout with iostream — the simplest C++ program.

Open & run
Compiler ⚙️ C++ Intermediate

Bubble Sort

Sort an array in place and print it — a first sorting algorithm.

Open & run
Compiler ⚙️ C++ Intermediate

Binary Search

Search a sorted array efficiently with binary search.

Open & run
Compiler ⚙️ C++ Intermediate

Linked List

Implement a simple singly linked list with push and print.

Open & run
Compiler 🔧 C Beginner

Hello World

Print a greeting with printf — the simplest C program.

Open & run
Compiler 🔧 C Intermediate

Pointers

Swap two integers using pointer arguments.

Open & run
Compiler Java Beginner

Hello World

Print a greeting — the simplest Java program.

Open & run
Compiler Java Intermediate

Classes & Objects

Define a Student class, sort an ArrayList, and print results.

Open & run
Compiler Java Intermediate

Streams API

Filter, map and reduce arrays with the Java Streams API.

Open & run
Compiler 🐹 Go Beginner

Hello World

Print a greeting — the simplest Go program.

Open & run
Compiler 🐹 Go Intermediate

Goroutines

Launch concurrent goroutines and synchronize with WaitGroup.

Open & run
Compiler 💎 Ruby Beginner

Hello World

Print a greeting — the simplest Ruby program.

Open & run
Compiler 💎 Ruby Beginner

Blocks & Iterators

Use blocks, each_with_index, map, and select on an array of names.

Open & run
Compiler 🖥️ Bash Beginner

Hello World

Echo a greeting — the simplest Bash script.

Open & run
Compiler 🖥️ Bash Beginner

Script Basics

Variables, loops, and conditionals in a single Bash script.

Open & run