@ais523 what is the output of echo "__SIZE_TYPE__ f1(__SIZE_TYPE__ delta) { return __builtin_wasm_memory_grow(0, delta); }" | clang -x c - -target wasm64-unknown-unknown -emit-llvm -o - -S -O0 for you?
I haven't really used my extensions much, or gone over old solutions to see, but e.g. here it would take the place of the whole definition U←{⍵⍵⍣¯1⍺⍺⍵⍵⍵}
@lirtosiast Yes, anywhere where you need to do a transformation while the data temporarily is represented differently, e.g. bitwise operations would be ⍢⊤
@lirtosiast Well, for every invertible transformation function, you could have an additional quick which does the transformation, applies a link, then undoes the transformation. You'll just run out of characters quickly.
For example if f∆ was defined as DfḌ you could save a byte with 9_∆ or something.
@lirtosiast If your transformation is complex enough, it will pay off to have Under. How about this one? Swap the top two elements of the anti-diagonal beginning one step below the NE corner: 10∘×⍢(3↑1 1⍉1⊖⌽)
@lirtosiast Yeah, my model for ⍢ is built upon two features of Dyalog APL that are essentially black magic: Selective assignment and function inverses.
Speeding up powers of 2
code-golf
Create a function or program that indefinitely prints outs successive powers of 2 separated by newlines. However, the nth power of 2 must have a delay of 1/n seconds either before or after it is printed, but please specify this in your answer. If you choose to ...
@El'endiaStarman i guess they mean like java streams/unix streams?
@DemCodeLines mostly when data is too big that it isn't really an option to load the entire thing into memory, i guess?
well, also if your stream needs to undergo a lot of operations since normally you'd need to build a new list for each operation (so... basically most things)
@lirtosiast :| no i meant what do you mean by what type
A string is a magic string if
- It consists of only digits
- The digits form 8 unique numbers between 1 and 80
- All the digits are used
- Digits must be used in order
- No two numbers should not use the same digit in the string
Write a program which given a string as input prints out all the se...
APL (Dyalog Extended), 13 11 bytesSBCS
-2 with my extensions to Dyalog APL.
Anonymous tacit function, taking and returning a character matrix.
~∘' '⍤1⍢⍉⍢⊖
Try it online!
~ remove
∘ the
' ' spaces
⍤ from
1 rows (lit. 1D sub-arrays)
⍢ while
⍉ transposed
⍢ while
⊖ flipped
@Downgoat i use clang v6 from debian and i'm getting the same error as ais523
@Downgoat you decided against buddy allocation? what you have there looks more complicated. i'd also expect it to be slower - you search for a suitably-sized free block in a single linked list. with buddy allocation blocks can only have one of <64 discrete sizes and are segregated in separate linked lists, so you don't have to search.
there would be wasted space at the end of the block, but who cares - x86_64's address space is practically unlimited. virtual memory will make sure to materialise in ram only those pages you actually touch
this is my first question, make sure to tell me if anything could be worded better or if anything is spelled wrong etc.
KoTH: iterated Nash bargaining!
In this king of the hill challenge, you must play an iterated Nash bargaining game (https://en.wikipedia.org/wiki/Bargaining_problem).
You and...
@HyperNeutrino I'm doing that (banning the identity \$x \mapsto x\$) in any case.
I don't think Jelly, score 0 or the various other empty programs will be particularly interesting.
It should be: You need to implement something interesting while keeping your score low. Trading bytes for a smaller score, but trying too hard to minimize the score will be penalized (unless you manage to stuff all that complexity into one bytes and map it to zero) due to using many bytes
another boring approach (but very difficult to create a program for) would be to encode the program's bytes according to their frequency in it
for example, my program is reeeeeeeeemeenefgheee that encodes itself as 100000000020030456000 (code points), and decodes these code points back to their respective characters, and leaves everything else as-is
in this case, we'll want to start with 1, not 0, use that translator as the encoded program, and then translate the characters of the encoded program's decoder
Some spammer failed at a mail merge: Dear {{first-name}}, I am interested in your product {{product-name}}. Please contact me back at {{email}} at your convenience.