duplicates = multiple editions
A Classical Introduction to Modern Number Theory, Kenneth Ireland Michael Rosen
A Classical Introduction to Modern Number Theory, Kenneth Ireland Michael Rosen
This information applies to the PICO-8 0.1.6
release.
This document is here to help folks with a proficiency in Lua understand the limitations and discrepencies between Lua and PICO-8's Lua.
You can always view the manual or yellowafterlife's extended 0.1.1
manual.
print(function() end)
outputs the string function
instead of the string function: 0x0000000
.A list of simple tasks to perform when learning or evaluating a new language. Each of these should be able to be completed in a few hours, and will help to get the feel of the language and its standard libraries. A well-rounded set of evaluation tasks will help ensure all parts of the language are exercised. You might also write some tests to demonstrate implementation correctness.
Screen resolutions | |
------------------ | |
PICO-8 supports different undocumented videomodes that can be activated at runtime, | |
using poke(0x5F2C, X) where X is one of the following mode numbers: | |
0: 128x128, 0 pages | |
1: 64x128, 1 page | |
2: 128x64, 1 page | |
3: 64x64, 3 pages |
This project has moved to https://github.com/jonhoo/drwmutex so it can be imported into Go applications.
So the general idea with FMA3 is that it's designed to have enough degrees of | |
freedom so you can just have a more general FMA4 op in the IR and pick the right | |
FMA3 op *very* late (ideally, after register allocation!). | |
The generalized FMA op looks like this: | |
dst = FMA ±src0, ±src1, ±src2 | |
where at most one of the src's can be a memory operand. This computes | |
(±src0 * ±src1) ± src2. The two signs for src0 and src1 combine |
// ---- Straightforward: | |
__m128i lo_int = _mm_and_si128(_mm_set1_epi32(0xffff), in); // low 16 bits of all vals | |
__m128i hi_int = _mm_srli_epi32(in, 16); // high 16 bits of all vals | |
__m128 lo_flt = _mm_cvtepi32_ps(lo_int); // exact (all 16 bit ints = machine numbers) | |
__m128 hi_flt = _mm_cvtepi32_ps(hi_int); // exact | |
__m128 hi_scl = _mm_mul_ps(hi_flt, _mm_set1_ps(65536.0f)); // exact (just exponent change) | |
__m128 result = _mm_add_ps(hi_scl, lo_flt); // this is the only step that rounds. | |
// same approach also works with FMA where available. |
One of the primary benefits of using a fixed-width | |
programming font is that things line up in columns | |
if they are the same length in characters. (Please | |
note that monospacing is not just for indentation; | |
indentation works fine with proportional fonts. It | |
is only once you have a non-blank character on the | |
line that proportional vs. monospace differ much.) | |
In my experience, lining code up so features align | |
vertically makes it a lot easier to avoid the bugs |
Please consider using http://lygia.xyz instead of copy/pasting this functions. It expand suport for voronoi, voronoise, fbm, noise, worley, noise, derivatives and much more, through simple file dependencies. Take a look to https://github.com/patriciogonzalezvivo/lygia/tree/main/generative
float rand(float n){return fract(sin(n) * 43758.5453123);}
float noise(float p){
float fl = floor(p);
float fc = fract(p);
#include "hemicube.h" | |
#define PACK_HEMICUBES 1 | |
static void get_hemicube_face_normal(int index, Vector3 *forward, Vector3 *left, Vector3 *up) { | |
// Unwrapped hemicube with positive-Z in the middle. | |
switch (index) { | |
case 0: *forward = Vector3(+1, 0, 0); *left = Vector3( 0, 1, 0); break; |