Activity for orthoplex
Type | On... | Excerpt | Status | Date |
---|---|---|---|---|
Comment | Post #285929 |
You can eliminate the plus sign via `a+b` → `a-(-b)`. (more) |
— | over 2 years ago |
Comment | Post #286668 |
You can eliminate the init-loop by or-ing the lookup with 0.
Using `pairs` also seems a bit overkill since you're not using `k` anywhere.
`function(t)r={}for i=1,#t do r[t[i]]=1+(r[t[i]]or 0)end return r end` (more) |
— | over 2 years ago |
Comment | Post #286637 |
Actually, `set(x)` → `x` works just fine in this case.
I also found a set-of-pairs solution that is equally as long:
`lambda x:{*zip(x,map(x.count,x))}` (more) |
— | over 2 years ago |
Edit | Post #286541 | Initial revision | — | over 2 years ago |
Answer | — |
A: From the smallest seed HQ9+, 2 bytes Two quines. QQ (more) |
— | over 2 years ago |
Edit | Post #286283 |
Post edited: |
— | over 2 years ago |
Edit | Post #286356 | Initial revision | — | over 2 years ago |
Answer | — |
A: Create a range grid [Python 2], 46 bytes lambda m,n:[range(n,n+n)for in range(m)] Try it online! (more) |
— | over 2 years ago |
Edit | Post #286355 | Initial revision | — | over 2 years ago |
Answer | — |
A: Create a range grid [Python 3], 49 bytes lambda m,n:[[range(n,n+n)]for in range(m)] Try it online! (more) |
— | over 2 years ago |
Comment | Post #286311 |
At first, I thought you were cheesing the test cases, but you're right, -1 is the only negative number you can possibly get. Clever!
The penultimate line should then be
```lua
_=(_==256or _<0)and 0or _
``` (more) |
— | over 2 years ago |
Comment | Post #286311 |
Tables to the rescue ^^
```lua
_=0
for c in s:gmatch'.'do
_=({d=_-1,i=_+1;s=_*_})[c]or print(_)or _
_=({[256]=0,[-1]=0})[_]or _
end
``` (more) |
— | over 2 years ago |
Comment | Post #286301 |
How about we use our own function to shorten the for-loop even more? This should also relieve your discomfort with not calling `f`.
```lua
local function f()goto l::l::return end
for _ in f do end
if true and false then elseif""then else end
repeat until""or not nil
while""do break end
``` (more) |
— | over 2 years ago |
Comment | Post #286301 |
Oh oops, you're right, I completely overlooked `in`. Still, the for-loop could be shortened to something sneaky like
```lua
for x in print do end
``` (more) |
— | over 2 years ago |
Comment | Post #286301 |
You can shorten your for-loop and save a few spaces on the numerical constants. Also, I don't think the rules require you to call your function in the end.
```lua
local function f()if true then for v=0,0 do while false do break end repeat until""and""or not nil end elseif""then else end goto l::l::... (more) |
— | over 2 years ago |
Comment | Post #286300 |
You can shorten your loop by using goto. As a bonus, this makes your code look even more cryptic (:
```lua
_=''::_::_=_..'*'print(_)goto _
``` (more) |
— | over 2 years ago |
Comment | Post #286295 |
oh sweet, we have a 35 then ^^
```haskell
main=mapM putStrLn$iterate('*':)"*"
``` (more) |
— | over 2 years ago |
Comment | Post #286295 |
Neat solution, but that import is quite expensive. Maybe try something like
```haskell
x="*":map('*':)x
main=mapM putStrLn x
``` (more) |
— | over 2 years ago |
Edit | Post #286294 | Initial revision | — | over 2 years ago |
Answer | — |
A: Looping counter [Ruby], 18 bytes loop{$><<$/=?+$/} Try it online! (more) |
— | over 2 years ago |
Edit | Post #286286 | Initial revision | — | over 2 years ago |
Answer | — |
A: Looping counter [brainfuck], 31 bytes ++++++++++[[>]>-[---]] Try it online! (more) |
— | over 2 years ago |
Edit | Post #286285 | Initial revision | — | over 2 years ago |
Answer | — |
A: Looping counter [><>], 10 bytes 1:naoa1+! Try it online! (more) |
— | over 2 years ago |
Edit | Post #286284 | Initial revision | — | over 2 years ago |
Answer | — |
A: Looping counter [dc], 13 bytes [r1+pArdx]dx Try it online! (more) |
— | over 2 years ago |
Edit | Post #286283 | Initial revision | — | over 2 years ago |
Answer | — |
A: Looping counter [Bash], 17 bytes echo x$1;./$0 x$1 Try it online! Thanks to celtschk for spotting my mistake :) (more) |
— | over 2 years ago |
Edit | Post #286282 | Initial revision | — | over 2 years ago |
Answer | — |
A: Looping counter [Python 2], 26 bytes =1 while 1:=10;print- Try it online! (more) |
— | over 2 years ago |
Edit | Post #286281 | Initial revision | — | over 2 years ago |
Answer | — |
A: Looping counter [Python 3], 28 bytes ="" while 1:+="";print() Try it online! (more) |
— | over 2 years ago |
Edit | Post #285932 | Initial revision | — | almost 3 years ago |
Answer | — |
A: It's Hip to be Square [dc], 9 bytes ?dvd-^p Try it online! Comparisons are expensive in dc, so you have to get a bit creative. I came up with $0^{n-\lfloor\sqrt{n}\rfloor^2}$. (more) |
— | almost 3 years ago |
Edit | Post #285931 | Initial revision | — | almost 3 years ago |
Answer | — |
A: Make my value binary [dc], 4 bytes 2o?p Try it online! (more) |
— | almost 3 years ago |
Comment | Post #285903 |
`%#_ _` has 4 unique bytes, no? (more) |
— | almost 3 years ago |
Edit | Post #285886 | Initial revision | — | almost 3 years ago |
Answer | — |
A: Can you give me half? dc, 3 unique bytes, 138 bytes This challenge is pretty easy if you aim for just 4 unique bytes. For example, you could push the stack depth repeatedly to get ascending integers, set the precision to something positive, divide and then print. ```dc zzzzk/p ``` And surely it can't go any lower, ... (more) |
— | almost 3 years ago |