App: manual Page: fragments/sequences_1
PHP
|
HTML
fragments/sequences_1.pad
|
Result
|
|
<p>{sequence '1..8'}{$sequence} {/sequence}</p> <p>{sequence fibonacci, rows=8}{$sequence} {/sequence}</p> <p>{sequence prime, from=10, rows=6}{$sequence} {/sequence}</p> <p>{sequence 'A..F'}{$sequence} {/sequence}</p>
|
|
App: manual Page: pages/sequences
PHP
|
HTML
pages/sequences.pad
|
Result
|
|
{meta title='Sequences'}
<p>The <code>{sequence}</code> tag generates values instead of reading them: a range, a mathematical series, letters - 122 types, each iterated like any data tag:</p>
{example 'fragments/sequences_1'}
<p>That is the smallest corner of a whole subsystem: plays that keep, remove or flag terms, stores that pass a sequence from one tag to the next, actions that transform it, and random draws with their own rules. It has an application of its own, which is its manual:</p>
<p><b><a href="{$padHost}sequence/">The sequence application</a></b> - every type, play, action and option, demonstrated live.</p> <h2>Seeing and hearing them</h2>
<p>A sequence is data like any other, so {tag 'chart'} and {tag 'sparkline'} draw it straight away with <code>sequence=</code>:</p>
{example 'fragments/sequences_2'}
<p>The sequence application has three pages built on that: the <a href="{$padHost}sequence/?gallery">Gallery</a> draws every type beside the OEIS entry its terms come from, <a href="{$padHost}sequence/?listen">Listen</a> plays a sequence as notes - Recamán's is the famous one - in an audio file written into the page, and <a href="{$padHost}sequence/?guess">Guess</a> shows the start of a sequence and asks for the next term.</p>
|
|
App: regression/framework Page: expressions/any_type_answers_the_same_way
PHP
|
HTML
expressions/any_type_answers_the_same_way.pad
|
Result
|
|
{if sequence:prime(8) eq 19} y {/if}
|
|
App: regression/framework Page: lenient/a_sequence_parameter_that_is_no_number_takes_its_default
PHP
lenient/a_sequence_parameter_that_is_no_number_takes_its_default.php
|
HTML
lenient/a_sequence_parameter_that_is_no_number_takes_its_default.pad
|
Result
|
<?php
// The lenient walk under test: with the syntax check off, what cannot run passes the // value through or yields empty, and the walk carries on.
$padCheckSyntax = FALSE;
?>
|
[{sequence '1;2;3', from='abc'}{$sequence} {/sequence}][{sequence 3, increment='x'}{$sequence} {/sequence}][{sequence 3, skip='x'}{$sequence} {/sequence}][{sequence 3, minimal='x'}{$sequence} {/sequence}][{sequence prime, to='x', rows=3}{$sequence} {/sequence}]
|
|
App: regression/framework Page: lenient/a_term_position_below_1_or_with_a_fraction_has_no_term
PHP
lenient/a_term_position_below_1_or_with_a_fraction_has_no_term.php
|
HTML
lenient/a_term_position_below_1_or_with_a_fraction_has_no_term.pad
|
Result
|
<?php
// The lenient walk under test: with the syntax check off, what cannot run passes the // value through or yields empty, and the walk carries on.
$padCheckSyntax = FALSE;
?>
|
[{echo sequence:prime(0)}][{echo sequence:fibonacci(-3)}][{echo sequence:fibonacci(2.7)}][{echo sequence:prime(1)}]
|
|
App: regression/framework Page: passes/a_prefixed_sequence_pair_keeps_its_closing_tag_inside_a_pass
PHP
|
HTML
passes/a_prefixed_sequence_pair_keeps_its_closing_tag_inside_a_pass.pad
|
Result
|
|
{code}{prime:keep rows=3, from=10}{$sequence},{/prime:keep}{/code}
|
|
App: regression/framework Page: prefixes/keep_names_a_play_over_a_type
PHP
|
HTML
prefixes/keep_names_a_play_over_a_type.pad
|
Result
|
|
{keep:prime rows=4, from=10} {$sequence}, {/keep:prime}
|
|
App: regression/framework Page: prefixes/sequence_names_a_sequence_type
PHP
|
HTML
prefixes/sequence_names_a_sequence_type.pad
|
Result
|
|
{sequence:prime rows=3} {$sequence}, {/sequence:prime}
|
|
App: regression/framework Page: sequence/a_count_of_zero_gives_no_rows
PHP
sequence/a_count_of_zero_gives_no_rows.php
|
HTML
sequence/a_count_of_zero_gives_no_rows.pad
|
Result
|
<?php
$n = 0; $m = 3;
?>
|
[{sequence $n}{$sequence} {/sequence}][{sequence prime, rows=0}{$sequence} {/sequence}][{loop0}x{/loop}][{sequence $m}{$sequence} {/sequence}]
|
|
App: regression/framework Page: sequence/a_count_or_range_given_to_a_type_without_a_parameter_is_read_as_such
PHP
|
HTML
sequence/a_count_or_range_given_to_a_type_without_a_parameter_is_read_as_such.pad
|
Result
|
|
[{prime 5}{$prime} {/prime}][{fibonacci 5}{$fibonacci} {/fibonacci}][{keep:prime '1..10'}{$sequence} {/keep:prime}][{flag:even '1;2;3'}{$sequence}{/flag:even}][{multiply 3, rows=3}{$multiply} {/multiply}][{repeat 'x', rows=2}{$repeat}{/repeat}]
|
|
App: regression/framework Page: sequence/a_count_past_the_integer_range_is_as_many_as_there_are
PHP
|
HTML
sequence/a_count_past_the_integer_range_is_as_many_as_there_are.pad
|
Result
|
|
[{set $n = 10 ** 30}{sequence prime, rows=$n, to=20}{$sequence} {/sequence}][{set $m = 0 - 10 ** 30}{sequence prime, rows=$m, to=20}{$sequence} {/sequence}][{sequence prime, rows='1e30', to=20}{$sequence} {/sequence}]
|
|
App: regression/framework Page: sequence/a_first_parameter_an_action_does_not_take_is_the_store_the_type_or_the_count_it_names
PHP
|
HTML
sequence/a_first_parameter_an_action_does_not_take_is_the_store_the_type_or_the_count_it_names.pad
|
Result
|
|
{sequence '11..16', push='nums'/}[{reverse 'prime'}{$sequence} {/reverse}][{action:first 'prime'}{$sequence} {/action:first}][{action:splice 'nums', splice=2}{$sequence} {/action:splice}][{append 5}{$sequence} {/append}][{action:sort 'nums'}{$sequence} {/action:sort}][{action:shift 'nums', shift=2}{$sequence} {/action:shift}]
|
|
App: regression/framework Page: sequence/a_formula_type_answers_every_position_from_its_formula
PHP
|
HTML
sequence/a_formula_type_answers_every_position_from_its_formula.pad
|
Result
|
|
[{echo sequence:prime(78499)}][{echo sequence:prime(100000)}][{echo sequence:square(500000)}][{echo sequence:totient(300000)}][{echo sequence:polite(999990)}][{echo sequence:prime(1229)}][{echo sequence:recaman(12)}][{echo sequence:bell(3)}]
|
|
App: regression/framework Page: sequence/a_negative_number_is_no_prime
PHP
|
HTML
sequence/a_negative_number_is_no_prime.pad
|
Result
|
|
{sequence '-10..10', keep='prime'}{$sequence} {/sequence}|{sequence prime, from=-5, rows=3}{$sequence} {/sequence}
|
|
App: regression/framework Page: sequence/a_number_right_after_an_option_naming_a_type_or_an_action_that_counts_is_its_value
PHP
|
HTML
sequence/a_number_right_after_an_option_naming_a_type_or_an_action_that_counts_is_its_value.pad
|
Result
|
|
{sequence '1..9', push='a'/}[{pull:a first, 2}{$sequence} {/pull:a}][{pull:a add, 2}{$sequence} {/pull:a}][{sequence '1..3', add, 2}{$sequence} {/sequence}][{sequence '1..3', first, 2}{$sequence} {/sequence}][{prime first, 3}{$sequence} {/prime}][{sequence add, 3, rows=3}{$sequence} {/sequence}]
|
|
|