Long year: Difference between revisions

Added Easylang
m (→‎{{header|Wren}}: Minor tidy)
(Added Easylang)
 
(One intermediate revision by one other user not shown)
Line 240:
<pre>
long years 2000-2099: 2004 2009 2015 2020 2026 2032 2037 2043 2048 2054 2060 2065 2071 2076 2082 2088 2093 2099
</pre>
 
=={{header|Amazing Hopper}}==
Task solves with Amazing Hopper flavour Basico:
<syntaxhighlight lang="c">
 
#include <basico.h>
 
#proto esañolargo(_X_)
 
algoritmo
 
año=1800, c=5
imprimir ("Long (53 week) years between 1800 and 2100:\n\n" )
iterar grupo ( ++año, #( año<=2100 ), \
cuando ( #( es año largo( año )==4 || es año largo( año-1 )==3 ) ){ \
imprimir ( año, " ", solo si( #( c==0 ) , NL; c=6 ), --c ) } )
terminar
 
subrutinas
 
es año largo (y)
retornar ' #( (y + floor(y / 4) - floor(y / 100) + floor(y / 400)) % 7 ) '
</syntaxhighlight>
{{out}}
<pre>
Long (53 week) years between 1800 and 2100:
 
1801 1807 1812 1818 1824 1829
1835 1840 1846 1852 1857 1863
1868 1874 1880 1885 1891 1896
1903 1908 1914 1920 1925 1931
1936 1942 1948 1953 1959 1964
1970 1976 1981 1987 1992 1998
2004 2009 2015 2020 2026 2032
2037 2043 2048 2054 2060 2065
2071 2076 2082 2088 2093 2099
</pre>
 
Line 1,423 ⟶ 1,463:
2093
2099</pre>
 
=={{header|EasyLang}}==
<syntaxhighlight>
func p y .
return (y + y div 4 - y div 100 + y div 400) mod 7
.
func longyear y .
return if p y = 4 or p (y - 1) = 3
.
for y = 2000 to 2100
if longyear y = 1
write y & " "
.
.
</syntaxhighlight>
 
{{out}}
<pre>
2004 2009 2015 2020 2026 2032 2037 2043 2048 2054 2060 2065 2071 2076 2082 2088 2093 2099
</pre>
 
=={{header|Elixir}}==
2,046

edits