Data update
This commit is contained in:
parent
4d5544505c
commit
4924dd0264
3073 changed files with 55820 additions and 4408 deletions
16
Task/Loops-Do-while/DuckDB/loops-do-while.duckdb
Normal file
16
Task/Loops-Do-while/DuckDB/loops-do-while.duckdb
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
create or replace function do_while(init) as table (
|
||||
with recursive cte as (
|
||||
select init+1 as value -- Increment unconditionally
|
||||
union all -- Loop
|
||||
select value+1 as value -- Each time through the loop, add 1 to the value then print it.
|
||||
from cte
|
||||
where value % 6 != 0 -- "while value mod 6 is not equal to 0"
|
||||
)
|
||||
from cte order by value
|
||||
);
|
||||
|
||||
# The task
|
||||
from do_while(0);
|
||||
|
||||
# Also check that the loop executes at least once.
|
||||
from do_while(-1);
|
||||
4
Task/Loops-Do-while/Pluto/loops-do-while.pluto
Normal file
4
Task/Loops-Do-while/Pluto/loops-do-while.pluto
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
local value = 0
|
||||
repeat
|
||||
print(++value)
|
||||
until value % 6 == 0
|
||||
6
Task/Loops-Do-while/TAV/loops-do-while-1.tav
Normal file
6
Task/Loops-Do-while/TAV/loops-do-while-1.tav
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
x =: 0
|
||||
?* \ loop forever
|
||||
x =+ 1 \ increment x
|
||||
print x
|
||||
? x %% 6 = 0 \ until
|
||||
?> \ break
|
||||
6
Task/Loops-Do-while/TAV/loops-do-while-2.tav
Normal file
6
Task/Loops-Do-while/TAV/loops-do-while-2.tav
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
x = 0
|
||||
while \ loop forever
|
||||
x += 1 \ increment x
|
||||
print x
|
||||
if x %% 6 == 0 \ until
|
||||
break
|
||||
Loading…
Add table
Add a link
Reference in a new issue