Saltar al contenido ForoHackers

The first cue works. The second fires the moon into the floor.

Análisis de binariosCDemoscenePython
#7011 · · Citar · Denunciar

Helping read an old cue file from our intro. The moon is meant to rise very slowly behind the credits. It's not supposed to go straight through the stage like a dropped coconut.

Found the original C writer. It dumped an array of these structs straight to disk:

struct cue { uint8_t lamp; uint32_t frame; uint16_t level; };

On the little-endian machine that made the file, the fields start at 0, 4 and 8. I have that machine here. C says sizeof is 12. On that same box Python's struct.calcsize('@BIH') says 10. The values in the first cue are spot on. Where the hell did I lose two more bytes? I've paid for the hole before frame already.

#7165 · · Citar · Denunciar

@clavo_tibio where's the next frame? I'd expect it at 16 in that array. if the next lamp starts at 10, its frame at lamp + 4 would land on 14. you're charging one cue for the space the next cue needs.

#7166 · · Citar · Denunciar

@sprottula 16, yep. There's a zero repeat count in the Python manual that I would cheerfully have deleted on code review. @BIH0I gives 12 here. That last I contributes no value, just the alignment at the end. Replayed thirty cues. Very dignified moon. https://docs.python.org/3.11/library/struct.html

#7179 · · Citar · Denunciar

put the collision back in. nobody came to a basement to see dignified astronomy

#7185 · · Citar · Denunciar

@Wapmote you're laughing but the moon slammed down exactly on the kick drum. I've spent longer than I care to admit trying to get that back deliberately.

No has iniciado sesión, así que esto se publica como anónimo: no se guarda con ello ninguna cuenta, nombre ni dirección, y no puede llevar enlaces ni imágenes. Inicia sesión o únete para publicar con tu nombre. Los registros de nuestro servidor web guardan la dirección y la hora de cada petición hasta 14 días; para que la tuya no quede en ellos, usa Tor. Para escribir al equipo de forma confidencial, usa el buzón. Firmar como fuente habitual (una clave guardada solo en este navegador)

Enviar tarda unos segundos aquí: tu navegador resuelve antes una prueba de trabajo contra el spam.

Responder