Skip to content Search Apps Documentation Source Content Run Reset Eval Playground File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.

v1 source pure

Package giornate is a Sinopia showcase engine: a fresco wall caught mid-work. A fresco is painted on wet plaster one ...

Overview

Package giornate is a Sinopia showcase engine: a fresco wall caught mid-work. A fresco is painted on wet plaster one day-patch (giornata) at a time, from the top of the wall down. The wall is cut into irregular patches by slanted lines; one hidden composition runs under all of them. Finished patches show it in pigment, the rest still show the red-ochre sinopia underdrawing (outline, hatching, construction lines).

Everything is integer maths (a 64-step quarter-sine table, truncating division), so the TypeScript twin in frontend/src/engines/giornate.ts is byte-identical. Two RNG streams come from the seed: seed+"|traits" decides the traits (cheap, no geometry: Traits never renders) and seed+"|art" draws the picture, so art draws never shift traits.

Constants 1

const MaxSVGBytes

1const MaxSVGBytes = 24576
source

MaxSVGBytes: measured max is 14,663 B over 20,000 default seeds and 15,005 B with params (docs/engines/giornate.md); 24 KiB leaves ~1.6x margin.

Functions 8

func Manifest

1func Manifest() engine.Manifest
source

Manifest describes the engine. Author and FeeBps are set by the adapter.

func Render

1func Render(in engine.Input) string
source

Render returns the raw SVG for in.Seed under in.Params. Core validates params before every render; invalid params panic.

func SVG

1func SVG(seed string) string
source

SVG renders a seed with the default (showcase) params.

func SVGWith

1func SVGWith(seed, ps string) string
source

SVGWith renders a seed under params as a standalone SVG document.

func Traits

1func Traits(in engine.Input) []engine.Trait
source

Traits returns the nine traits of in.Seed under in.Params. It never renders: one 8-draw RNG pass and a few table walks.

func ValidateParams

1func ValidateParams(s string) error
source

ValidateParams accepts "" and the canonical params JSON only.

func TraitsOf

1func TraitsOf(seed string) TraitSet
source

TraitsOf decodes a seed with the default params.

func TraitsWith

1func TraitsWith(seed, ps string) TraitSet
source

TraitsWith decodes a seed under params; invalid params panic.

Types 1

type TraitSet

struct
1type TraitSet struct {
2	Pigments, Giornate, Completion, Motif, Hatch, Construction, Gilding, Craquelure string
3	Score                                                                           int
4	Rarity                                                                          string
5
6	pig, gio, comp, motif, hatch, cons, gild, craq int // table indices actually used
7	grain                                          bool
8}
source

TraitSet is a decoded seed. The SVG builder and the trait list read the same struct, so picture and metadata cannot disagree.

Dependencies

Source Files 2