This example shows a very simple evolutionary algorithm.
The program starts with one guess, creates several mutated children, and keeps the better ones.
Over time, the guess improves until it reaches the target number.
Search found 70 matches
- Tue Mar 31, 2026 8:37 am
- Forum: CPad Beginner Examples
- Topic: simple Genetic Algorithm example
- Replies: 0
- Views: 11
- Tue Mar 31, 2026 8:03 am
- Forum: CPad Beginner Examples
- Topic: Simple Transformer example
- Replies: 0
- Views: 21
Simple Transformer example
Tiny Transformer-Style Attention Example
What this example teaches :
This tiny demo shows the core transformer idea:
1. Each earlier word has a key
This helps decide whether the word is important.
2. Each earlier word also has a value
This carries useful meaning.
3. The current position ...
What this example teaches :
This tiny demo shows the core transformer idea:
1. Each earlier word has a key
This helps decide whether the word is important.
2. Each earlier word also has a value
This carries useful meaning.
3. The current position ...
- Tue Mar 31, 2026 7:45 am
- Forum: CPad Beginner Examples
- Topic: Simple Neural Network example
- Replies: 0
- Views: 7
Simple Neural Network example
Beginner Neural Network in C — A Tiny Perceptron That Learns OR
this example teaches:
inputs
weights
bias
weighted sum
activation function
training from examples
error correction
What is the neural network doing?
This tiny network receives two inputs:
x1
x2
It computes:
sum = x1*w1 + x2 ...
this example teaches:
inputs
weights
bias
weighted sum
activation function
training from examples
error correction
What is the neural network doing?
This tiny network receives two inputs:
x1
x2
It computes:
sum = x1*w1 + x2 ...
- Tue Mar 24, 2026 10:48 am
- Forum: CPad Beginner Examples
- Topic: General Linear Equations Solver
- Replies: 0
- Views: 28
General Linear Equations Solver
Solves linear equations using Gaussian elimination
Example input for the system:
2x + y - z = 8
-3x - y + 2z = -11
-2x + y + 2z = -3
you would enter:
N = 3
Row 1: 2 1 -1 8
Row 2: -3 -1 2 -11
Row 3: -2 1 2 -3
Example input for the system:
2x + y - z = 8
-3x - y + 2z = -11
-2x + y + 2z = -3
you would enter:
N = 3
Row 1: 2 1 -1 8
Row 2: -3 -1 2 -11
Row 3: -2 1 2 -3
- Tue Mar 24, 2026 8:29 am
- Forum: Fun CPad graphics demos
- Topic: Interactive function graph plotter
- Replies: 0
- Views: 22
Interactive function graph plotter
An interactive function graph plotter
You can type expressions like:
sin(x)
cos(x)
x*x
x^3
1/x
sin(x)*x
sqrt(abs(x))
exp(sin(x))
You can type expressions like:
sin(x)
cos(x)
x*x
x^3
1/x
sin(x)*x
sqrt(abs(x))
exp(sin(x))
- Mon Mar 23, 2026 8:43 pm
- Forum: Fun CPad graphics demos
- Topic: Mini Bricks game
- Replies: 0
- Views: 18
Mini Bricks game
A mini Bricks game
- Fri Mar 20, 2026 5:48 pm
- Forum: CPad Beginner Examples
- Topic: Read a string from keyboard
- Replies: 0
- Views: 19
Read a string from keyboard
This demo shows how to read a string from keyboard
- Fri Mar 20, 2026 5:42 pm
- Forum: CPad Beginner Examples
- Topic: Compare strings (strcmp)
- Replies: 0
- Views: 17
Compare strings (strcmp)
Example that demonstrates how to compare strings using the strcmp function
- Fri Mar 20, 2026 5:38 pm
- Forum: CPad Beginner Examples
- Topic: Concatenate strings (strcat)
- Replies: 0
- Views: 15
Concatenate strings (strcat)
Example that demonstrates how to concatenate strings using the strcat function
- Fri Mar 20, 2026 2:24 pm
- Forum: CPad Beginner Examples
- Topic: Copy safely with size (strncpy)
- Replies: 0
- Views: 14
Copy safely with size (strncpy)
Example that demonstrates how to safely copy a string using the strncpy function