Palindrome dates: Difference between revisions

Added Quackery.
m (syntax highlighting fixup automation)
(Added Quackery.)
Line 2,019:
dateTest = ""
Next
 
 
</syntaxhighlight>
 
=={{header|Quackery}}==
 
<syntaxhighlight lang="Quackery"> [ dup 400 mod 0 = iff
[ drop true ] done
dup 100 mod 0 = iff
[ drop false ] done
4 mod 0 = ] is leap ( y --> b )
 
[ 1 -
[ table
31 [ dup leap 28 + ]
31 30 31 30 31 31 30
31 30 31 ]
do nip ] is monthdays ( y m --> n )
 
[ 1+ dip [ 2dup monthdays ]
tuck < while
drop 1+ 1
over 13 = if
[ 2drop 1+ 1 1 ] ] is nextday ( y m d --> y m d )
 
 
[ dip 2dup dup dip unrot ] is 3dup ( a b c --> a b c a b c )
 
[ swap 100 * +
swap 10000 * +
number$ ] is date$ ( y m d --> $ )
 
[ dup reverse = ] is palindrome ( $ --> b )
 
[ char - swap 4 stuff
char - swap 7 stuff ] is +dashes ( $ --> $ )
 
[] temp put
2020 02 02
[ nextday
3dup date$
dup palindrome iff
[ temp take
swap nested join
temp put ]
else drop
temp share
size 15 = until ]
drop 2drop
temp take witheach
[ +dashes echo$ cr ]</syntaxhighlight>
 
{{out}}
 
<pre>2021-12-02
2030-03-02
2040-04-02
2050-05-02
2060-06-02
2070-07-02
2080-08-02
2090-09-02
2101-10-12
2110-01-12
2111-11-12
2120-02-12
2121-12-12
2130-03-12
2140-04-12
</pre>
 
 
=={{header|Raku}}==
1,462

edits