« first day (3266 days earlier)      last day (1578 days later) » 

8:23 AM
0
A: Sandbox for Proposed Challenges

Shieru AsakotoInterpret LCGFuck™ code-golfinterpreter Introduction LCGFuck™ is a Brainfuck-like esoteric programming language invented by me. Inspired by linear congruential generators (LCGs), the idea of using LCGs to program is implemented in LCGFuck™. An LCG in LCGFuck™ is defined with 5 integers, namely...

 
9:10 AM
@ngn up to 19
@ngn now your code gives warning even if I don't use -Wall
e.g. unused variable ‘d’ [-Wunused-variable]
S L f3()_(L r=(L)n<<2*n;I d=1+msk/nt;pthread_barrier_t b;pthread_barrier_init(&b,0,nt);A a[nt];pthread_t t[nt];
^
ngn.c:6:25: note: in definition of macro ‘_’
#define _(a...){return({a;});}
^
ngn.c: At top level:
ngn.c:14:5: warning: ‘min’ defined but not used [-Wunused-function]
S I min(I x,I y)_(x<y?x:y)S L gcd(L x,L y)_(W(x,L z=x;x=y%x;y=z)y)S I rev(I x)_(I r=0;F(i,n,r+=(x>>i&1)<<(n-1-i))r)
the ^ are pointing in the wrong place because of copy and paste it seems
 
ngn
@Anush different version of gcc, i guess
just ignore the unused stuff, i'll remove it in a moment
 
ok thanks
bpaste.net/PXMA is a version of your code that is a tiny bit less insane :)
but I would love a version without the #define's
 
ngn
@Anush what's wrong with my #defines? :)
 
@ngn it makes it impossible to understand the code!
and in particular, I would like to profile it which is a total pain if I can't understand what each line is doing
 
ngn
it's easy: _( ) is like { } except the last expression is returned. useful for function bodies.
W(condition,body) is a while loop. $(condition,body) is "if".
 
9:23 AM
I will try to do it myself.. as I can see I will get no help :)
 
ngn
P(condition,expr) is a predicate - if ... then return ...
 
but n= 19 is massive progress!
what is f0?
 
ngn
i named the functions f0 f1 f2 f3. larger numbers call smaller.
 
do you think there is any more speed squeezable from this?
 
ngn
f0 in particular is the transition from column j-1 to column j, like in the finnish paper
@Anush i do actually, but it would be hard to make the compilers do what i want
 
9:25 AM
@ngn oh that sounds exciting
what do you want the compiler to do?
godbolt.org is a great way to check exactly what the compiler is doing with different flags etc
if your code were readable we could even ask on SO :)
 
ngn
in the code that makes a transition from column j-1 to j, we perform a similar set of operations twice - first on x and then on ~x. those could be sped up with simd instructions.
 
sounds promising and fun
are you thinking gcc intrinsics ?
godbolt is particularly useful for this sort of low level tuning in my experience
it would be worth first seeing what the compiler is doing of course, in case it already does it!
 
ngn
@Anush either that, or write simple loops and somehow make the compilers vectorize them
@Anush that's possible too. i haven't looked at the instructions yet.
 
ngn
9:55 AM
strange. gcc produces the same non-vectorized code even if i use simd intrinsics.
clang too. so it must be my fault.
@Anush ok, now that part is all simd but slower :(
 
10:12 AM
0
Q: Dissect a word and arrange all its letters in alphabetical order

Riley JonesQuestion Write a program to accept one string on the console and print back its letters arranged in alphabetical order. The string must only have the following characters: 0123456789abcdefghijklmnopqrstuvwxyz Rules The ascending alphabetical order is defined in the given string. All rep...

 
10:44 AM
6
Q: Knight's tour game (7x7)

le_vineYour job is to solve this chess-related game. The setup of the game is a 7x7 tile grid, you start on a random tile and you have to hop on each tile, until you hopped on all 49 tiles. Top left corner is (0,0) Rules: you can hop on each tile once. the only move allowed in the game is to hop tw...

 
 
1 hour later…
12:04 PM
Do you guys have any news about Dennis? He's not been around for
 
a long time.
@LuisMendo Last TIO commit was Nov 19
This looks unusual:
 
In talk.tryitonline.net, his latest message is from Dec 13
 
But SE reports him as seen 2 days ago.
 
12:19 PM
He’s just getting less involved in CGCC like the vast majority of us I’d say, pretty normal
 
@Fatalize TIO is completely separate from CGCC, and he hasn't had any GitHub activity, even non-TIO things.
 
I mean, TIO is heavily linked to CGCC
In any case, everyone is entitled to take a break from things
 
@Fatalize TIO is heavily linked to from CGCC — ftfy
 
@Fatalize entitled of course. I just wanted to make sure he's ok
 
 
1 hour later…
1:35 PM
@ngn interesting. Is it worth making a MWE so we can diagnose it?
@Adám I had no idea C# had Hebrew calendar built in! Makes me want to like the language now :)
 
@Anush It is more .NET than C# that has it. My initial APL implementation used that, but now the range is beyond what .NET handles.
Oh, I just realised that of course it is only one year that's missing. D'oh.
 
 
4 hours later…
5:16 PM
@Adám very nice answer!
 
5:36 PM
@Anush What is?
 
@Adám your hannukah answer
currently rust is annoying me. Can anyone make a static compilation of codegolf.stackexchange.com/a/197576/9207 for me please
 
@Anush Other than some golfing tricks and realising from Arnauld that there's only one problematic year, it is very straight-forward.
 
 
1 hour later…
ngn
7:03 PM
@Anush probably not. the fact that compilers prefer non-vectorized code is an indication that simd is likely not worth here. sse instructions process 4 32-bit ints at a time, which should be faster than 4 individual instructions, but we need only 2 at a time and it may be slower in our case.
 
@ngn computers often vectorize code for speedups. But you do have to tell the compiler which simd instructions your cpu supports
 
ngn
@Anush i used -march=native
 
And often that it doesn't need to worry about fussy math rules
Compilers also aren't that good at it which is why using intrinsics can often speed things up
Which is basically you doing it for the compiler
 
ngn
@Anush yep. that's what i tried to do.
 
Is you can make a minimal example we can look at the assembly via godbolt and see what is going on
 
ngn
7:09 PM
i did look at the assembly. it had vector instructions.
 
Interesting
 
7:35 PM
1
Q: How many ACUs do I have?

ElPedroPosted from sandbox The Intro What is an ACU? This challenge is based on the concept of money and since this is an international community, we all use different currencies, so in keeping with our spirit of inclusiveness, I have invented a new currency called Arbitrary Currency Units (ACUs) spec...

 
 
1 hour later…
8:50 PM
CMC: Given a string, return counts for each of the lowercase vowels (aeiou) and for the total of lowercase consonants.
E.g. "Hello, World!"{e:1, o:2, consonants:5}
 
@Adám dzaima/APL, 22 21 or 18 bytes depending on allowed output format
 
@dzaima The 18-byter's format took me a while to understand. But sure, that's fine.
Using uppercase-(in)variation is clever.
@dzaima Interesting, I didn't realise your doesn't mix.
 
9:05 PM
@Adám i'm not sure if that was intentional ¯\_(ツ)_/¯
 
So your 18 is 20 in Extended ,∘≢⌸'aeiou'∘⍳⊢⍤⌿⍨⌈≠⊢ and 23 in 18.0 ,∘≢⌸'aeiou'∘⍳⊢⍤⌿⍨1∘⎕C≠⊢
@dzaima Is there a way to get an expression for an array in dzaima/APL?
 
@Adám like that repObj thing? no, not currently
sounds like an interesting thing to implement though
 
9:23 PM
@dzaima I thought your reduce didn't auto-disclose.
 
@Adám it always has for 1=≢⍴⍵
 
Ah, right, it was a special case. I remember now.
 
hmm. prototypes are annoying :|
 
 
2 hours later…
11:10 PM
0
A: Sandbox for Proposed Challenges

Noodle9What's my score? In the language of your own choosing write a program or function that returns the number of upvotes (be it positive or negative) your answer currently has. Rules Program or function - your choice. No input. Output however you like but it must be your current number of upvotes...

 

« first day (3266 days earlier)      last day (1578 days later) »