Live · powered by WFL

This page is running WFL right now

Everything below was produced by WFL on the server as this page loaded — the example programs were executed live, and the tools compute on your input with the standard library. No JavaScript runs the WFL; WFL does.

Rendered live by WFL · request #169 · 18:22:53

Example programs, executed on each request

Real .wfl files in playground/examples/. The server reads each one, highlights it, and runs it — the output is whatever the program just displayed.

FizzBuzz

Nested conditionals and the modulo operator.
fizzbuzz.wfl
1// FizzBuzz, in plain English — no symbols, just words.
2// "modulo" is the word form of the % operator.
3count from 1 to 20:
4 check if count modulo 15 is equal to 0:
5 display "FizzBuzz"
6 otherwise:
7 check if count modulo 3 is equal to 0:
8 display "Fizz"
9 otherwise:
10 check if count modulo 5 is equal to 0:
11 display "Buzz"
12 otherwise:
13 display count
14 end check
15 end check
16 end check
17end count
output — ran live by WFL
1
2
Fizz
4
Buzz
Fizz
7
8
Fizz
Buzz
11
Fizz
13
14
FizzBuzz
16
17
Fizz
19
Buzz

Fibonacci

A count loop carrying two running totals.
fibonacci.wfl
1// The first 15 Fibonacci numbers, built with two running totals.
2store a as 0
3store b as 1
4count from 1 to 15:
5 display a
6 store sum_ab as a plus b
7 change a to b
8 change b to sum_ab
9end count
output — ran live by WFL
0
1
1
2
3
5
8
13
21
34
55
89
144
233
377

Primes

Trial division with a while loop and break.
primes.wfl
1// Prime numbers up to 40, by trial division.
2count from 2 to 40:
3 store is_prime as yes
4 store d as 2
5 repeat while d times d is less than or equal to count:
6 check if count modulo d is equal to 0:
7 change is_prime to no
8 break
9 end check
10 change d to d plus 1
11 end repeat
12 check if is_prime:
13 display count
14 end check
15end count
output — ran live by WFL
2
3
5
7
11
13
17
19
23
29
31
37

Try it with your own input

Submit a value and WFL computes the answer server-side and re-renders this page. (Interactive tools need the live server — wfl serve.wfl.)

Hash it

WFLHASH-256 and SHA-256 of your text — WFL's crypto module.

Text stats

Length, word count, uppercase and reverse — the text module.

Pattern match

Does it look like an email? WFL's readable pattern engine decides.