HackerTrans
TopNewTrendsCommentsPastAskShowJobs

rak1507

no profile record

Submissions

Notes on writing a voxel game in Dyalog APL

homewithinnowhere.com
3 points·by rak1507·il y a 4 mois·0 comments

comments

rak1507
·il y a 8 mois·discuss
You won't get anything from vapourware salesmen.
rak1507
·il y a 8 mois·discuss
It seemingly takes a long time to write good software too, co-dfns is infinity+1 years in progress...
rak1507
·il y a 9 mois·discuss
There's a difference between one line and short/terse/elegant.

  {m:(x,x)#til x*x; r:til[x]-x div 2; 2(flip r rotate')/m} 
generates magic squares of odd size, and the method is much clearer. This isn't even golfed as the variables have been left.
rak1507
·l’année dernière·discuss
The append is the only thing that is O(1), finding the deletion mask is linear (≠ is linear, isn't it?) and the actual deletion is also linear (⌿ is also linear).

       ]runtime -repeat=1s 'v←k1 ⋄ v⌿⍨←v≠2'

 \* Benchmarking "v←k1 ⋄ v⌿⍨←v≠2", repeat=1s
 ┌──────────┬──────────────┐
 │          │(ms)          │
 ├──────────┼──────────────┤
 │CPU (avg):│0.008491847826│
 ├──────────┼──────────────┤
 │Elapsed:  │0.008466372283│
 └──────────┴──────────────┘
       ]runtime -repeat=1s 'v←k2 ⋄ v⌿⍨←v≠2'

 \* Benchmarking "v←k2 ⋄ v⌿⍨←v≠2", repeat=1s
 ┌──────────┬────────────┐
 │          │(ms)        │
 ├──────────┼────────────┤
 │CPU (avg):│0.8333333333│
 ├──────────┼────────────┤
 │Elapsed:  │0.83        │
 └──────────┴────────────┘
rak1507
·l’année dernière·discuss
The problem is that this isn't a "hashmap" in any meaningful sense, because all the operations are O(n).
rak1507
·il y a 5 ans·discuss
lol do you actually think people care about providing the 'best quality software they can create' https://www.npmjs.com/package/is-even etc