Activity for snail_β
Type | On... | Excerpt | Status | Date |
---|---|---|---|---|
Edit | Post #283767 |
Post edited: -4 |
— | over 2 years ago |
Edit | Post #286363 |
Post edited: sbcs scoring |
— | over 2 years ago |
Comment | Post #286363 |
Can you count each character as one byte? (more) |
— | over 2 years ago |
Edit | Post #286363 | Initial revision | — | over 2 years ago |
Answer | — |
A: Create a range grid BQN (CBQN), 10 bytes Anonymous function that takes `m` on the left and `n` on the right. ```bqn {π¨βΏπ©β₯βπ¨Γπ©} βπ¨Γπ© # list of range 0,mn) π¨βΏπ©β₯ # reshape list to mn ``` [Try it here! (more) |
— | over 2 years ago |
Comment | Post #283012 |
Multiple other answers use an array of lines as the art input. (more) |
— | almost 3 years ago |
Edit | Post #285474 |
Post edited: |
— | almost 3 years ago |
Edit | Post #285474 | Initial revision | — | almost 3 years ago |
Answer | — |
A: Evaluate a single variable polynomial equation BQN, 13 bytes ```bqn {+Β΄(π¨βββ π©)Γπ©} { } # fn +Β΄ # sum reduce (π¨βββ π©) # x^i for each term Γπ© # times each coefficient ``` Try it (more) |
— | almost 3 years ago |
Edit | Post #285404 | Initial revision | — | almost 3 years ago |
Answer | — |
A: A number adder, not a death adder Ruby, 28 bytes ```ruby puts"puts #{gets}+gets.toi" puts"puts # print P2, which prints #{gets} # P1's input value, interpolated +gets.toi" # plus P2's input value ``` For instance, if the input to P1 is 10, then P2 is ```ruby put... (more) |
— | almost 3 years ago |
Edit | Post #285331 | Initial revision | — | about 3 years ago |
Answer | — |
A: Operation "Find The Operator" Ruby, 58 bytes Simple eval solution. Using `` for exponentiation. ->a,b,c{%w[+ - / % ].select{eval("#{a}#{1}#{b}")==c}} Attempt This Online! (more) |
— | about 3 years ago |
Comment | Post #284994 |
Fixed, and made the code shorter :) (more) |
— | about 3 years ago |
Edit | Post #284994 |
Post edited: -6 refactor |
— | about 3 years ago |
Edit | Post #284994 |
Post edited: |
— | about 3 years ago |
Edit | Post #284994 | Initial revision | — | about 3 years ago |
Answer | — |
A: Golf golf challenge Ruby, 110 106 bytes Fixed capitalization and refactored for -4. ```ruby ->p,s{d=s-p s1?" bogey":"")} ``` Attempt This Online! (more) |
— | about 3 years ago |
Edit | Post #281024 |
Post edited: Corrected formatting, for leaderboard |
— | about 3 years ago |
Comment | Post #279167 |
[down to 44 bytes](https://tio.run/##KypNqvz/P81W1y5bp6I6W684syrVztA@O9ogVjstOjvaUE9P1zBWpyJWq8IqOxrIrP1fUFpSrJCmpwGUM4jVUTC0MNLkQhbTUTACS5ggCRvpmcKEDfRMsajXUTAGESYQI4FK/gMA)
You should just use a lambda `f=->k,x{}` since it's s way shorter. You call a Proc like `f[args]` instead of `f(args)`. Als... (more) |
— | over 3 years ago |
Edit | Post #284230 |
Post edited: explanation |
— | over 3 years ago |
Suggested Edit | Post #281024 |
Suggested edit: Corrected formatting, for leaderboard (more) |
helpful | over 3 years ago |
Edit | Post #284230 | Initial revision | — | over 3 years ago |
Answer | — |
A: Weave Strings Together [Ruby], 51 bytes ```ruby ->a{(0..a.map(&:size).max).map{|n|a.map{1[n]}}""} ->a{ } # lambda taking array `a` (0..a.map(&:size).max) # range of 0..length of longest string .map{|n| ... (more) |
— | over 3 years ago |
Edit | Post #284222 | Initial revision | — | over 3 years ago |
Answer | — |
A: Collatz conjecture; Count the tries to reach $1$ [Ruby], 33 bytes Recursive lambda solution. ```ruby c=->n{nn{ } # c = lambda taking `n` n<2? : # if n < 2... 0 # return 0... 1+c[ ] # else return 1 + collatz count for... ... (more) |
— | over 3 years ago |
Edit | Post #283976 |
Post edited: |
— | over 3 years ago |
Edit | Post #284102 |
Post edited: golf -5 |
— | over 3 years ago |
Edit | Post #284102 | Initial revision | — | over 3 years ago |
Answer | — |
A: Repeat the characters [jq], 32 27 bytes -5 bytes (thank you Razetime) .n as$n|.s/""|map(.$n)|add Try it online! (more) |
— | over 3 years ago |
Edit | Post #283976 |
Post edited: More info |
— | over 3 years ago |
Edit | Post #284099 |
Post edited: Golfed -5 |
— | over 3 years ago |
Edit | Post #284099 | Initial revision | — | over 3 years ago |
Answer | — |
A: Repeat the characters [Ruby], 34 29 bytes ```ruby ->s,n{s.chars.map{1n}""} ``` Try it online! (more) |
— | over 3 years ago |
Edit | Post #284058 | Initial revision | — | over 3 years ago |
Answer | — |
A: Are All Elements Equal? [Ruby], 15 bytes ```ruby ->a{a.all?a[0]} ->a{ } # lambda taking array `a` a.all? # do all items in the array match... a[0] # ...the first? ``` Try it online! (more) |
— | over 3 years ago |
Edit | Post #284037 | Initial revision | — | over 3 years ago |
Answer | — |
A: A number adder, not a death adder [Ahead], 10 bytes IO"@O+I"W@ This prints `N1I+0@`. Try it online! (more) |
— | over 3 years ago |
Edit | Post #284004 |
Post edited: flags |
— | over 3 years ago |
Edit | Post #284004 |
Post edited: |
— | over 3 years ago |
Edit | Post #284004 | Initial revision | — | over 3 years ago |
Answer | — |
A: My house is destroyed! Can you make me one? [jq] `--raw-output`, 32 bytes jq is the language of the month, apparently. Here it is! Not sure if the `--raw-output` flag really matters, someone let me know. ```js "#".+(" #"+" "(.-2)+"#")(.-1) ``` Try it online! (more) |
— | over 3 years ago |
Comment | Post #282736 |
Feel free to submit your own answer, since this approach is different enough from my own. I only feel good about taking small golf improvements. (more) |
— | over 3 years ago |
Edit | Post #283976 | Initial revision | — | over 3 years ago |
Answer | — |
A: Tips for golfing in Ruby Omitting parens on function calls You can omit parentheses on function calls in many cases. ```ruby foo(bar,baz) foo bar,baz ``` This is even true if a function call doesn't have any parameters. (This is because all function calls and property accesses are just methods, by the way.) ```ruby p... (more) |
— | over 3 years ago |
Edit | Post #283973 |
Post edited: -1 |
— | over 3 years ago |
Comment | Post #283972 |
[21 bytes](https://tio.run/##KypNqvz/v6C0pFjJIzUnJ19HQbk6PbWkuFZR6f//4rzEzBwA)
Don't need to use parens on function calls if you don't provide arguments. (more) |
— | over 3 years ago |
Comment | Post #283966 |
The challenge doesn't specify that output has to be on standard output. Is that a requirement? (more) |
— | over 3 years ago |
Edit | Post #283973 | Initial revision | — | over 3 years ago |
Answer | — |
A: Golf a FRACTRAN interpreter [Ruby], 51 50 bytes -1 from Razetime ```ruby ->p,n{while i=p.find{(1n).tof%1==0} n=i end n} ``` Try it online! (more) |
— | over 3 years ago |