Write a function in your language of choice that displays all its arguments on screen.
e.g. display("This function",1,0.9,'i','s',7/3,"displaying stuff") resulting in
"This function10.9is2displaying stuff"
Name:
Challenge2013-08-02 23:52
Write a function in your language of choice that makes >>1 go back to /g/.
e.g. https://boards.4chan.org/g/ resulting in
(>>1 goes back to /g/)
Name:
Anonymous2013-08-03 0:34
JavaScript
function display(){var s=[];for(i in arguments)s.push(arguments[i]);alert(s.join(" "))}
Name:
Anonymous2013-08-03 0:42
(define (disp . args) (for-each display args))
Name:
Anonymous2013-08-03 0:48
>>1 variable_name? X => X of text and X.size > 0 and if X.0 upcase? then Yes else X is '?'
function_name? X => X of text and not X~variable_name?
sym_head? C => C alpha? or ['_' '?' '<' '>'] has (X => X is C)
sym_body? C => C digit? or sym_head? C
//temporary hack; because Yes/No/Void should be functions
fn>asText O => if Yes is O then 'Yes'
else if No is O then 'No'
else if Void is O then 'Void'
else '#invalid'
integer_digits2 Ds N => | Ds = list (N `%` 10) @Ds
| N = N `/` 10
| if N > 0 then integer_digits2 Ds N else Ds
integer>digits N => integer_digits2 [] N
integer>asText O =>
| Sign = if O < 0 then '-' else ''
| O = if O < 0 then O neg else O
| DigitChars = O.digits: D => '0123456789'.D
| [Sign @DigitChars] join_text
Keywords = list 'Yes' 'No' 'Void' 'and' 'or' 'if' 'then' 'else'
text>asText O =>
if O is '' then '``'
else if Keywords has:K => K is O then ['`' O '`'] join_text
else | Q = if not O.0~sym_head? then '`'
else if O has:X => not X~sym_body? then '`'
else '' //no need for quotes
| Xs = O: C => if C is Q then '\\`' //quote
else if C is '\n' then '\\n'
else C
| [Q @Xs Q] join_text
// intersperse Xs with M
// infix 'and' [cat dog fox] --> [cat and dog and fox]
infix M Xs => if Xs end then []
else | T = Xs tail
| if T end then Xs
else ((infix M T) headed M) headed Xs.head
list>asText O =>
| S = O size
| if S is 2 and O.0 is '\\'
then _ break list>asText (['\\' O.1~asText] join_text)
else Void
| Max = 150
| Xs = O take: if S < Max then S else Max
| Xs = infix ' ': Xs: X => X~asText
| E = if S < Max then [] else [' ...']
| ['(' @Xs @E ')'] join_text
printable? X => if tag_of.X isnt fn then Yes
else if [Yes No Void] has:S => S is X then Yes
else exports_of.X has:E => E.0 is asText
asText X => if printable? X then X asText
else [`#[` address_of.X.asText `]`] join_text
say @Xs => | Xs = infix ' ': Xs map: X => if tag_of.X is text then X else asText X
| text_out [@Xs '\n'].join_text
Name:
Anonymous2013-08-03 0:58
this is not possible in a statically typed language
>>16
LLLLLLLLLLLLLLLLLLLLLLLLEEEEEEEEEEEEEEEEEEEEELLLLLLLLLLLLLLLLL
>LE /G/REENTEXT
>LE E/G/IN MEMES
>IMPLYIN/G/ LE 2013 ISGHTIYHTGYTG ISNT LE BEST REDDIT MEME XDDDDDDDDDDDDDDDDDDDDDD
LELELELELEELELELELELELELELEEEEEEEEEEEEEL
Zermelo began to axiomatize set theory in 1905; in 1908, he published his results despite his failure to prove the consistency of his axiomatic system.
Name:
Anonymous2013-09-01 17:14
display = function(...) print(table.concat({...},"")) end
display("This function",1,0.9,'i','s',7/3,"displaying stuff")
Name:
Anonymous2013-09-01 19:21
Power set of a set A is the set whose members are all possible subsets of A. For example, the power set of {1, 2} is { {}, {1}, {2}, {1,2} } .