codesample

noun
UK /ˈkəʊdˌsɑːmpəl/
US /ˈkoʊdˌsæmpəl/

A small piece of computer code that shows how to do something.

The teacher shared a codesample so we could see how the game works.


OTHER MEANINGS

2. A short block of code used to test whether a program works.

She ran a codesample to check the new function.

3. A piece of code copied from one project and used in another.

He pasted a codesample from the website into his file.

4. An example of coding style shown in a lesson or book.

The book includes a codesample after every chapter.