GithubHelp home page GithubHelp logo

dots64's Introduction

dots64 puzzle

Copyright (c) 2024 by David R. Van Wagner MIT LICENSE davevw.com

10:25 PM 1/26/2024 Sprite puzzle for you! Which sprites hit another first?

Given the following collision data including the pairs of signed x, y speed in pixels, and detail that the sprites are each moved once in order before checking for any collisions.

Answers when I figure it out, ~24 hours

note: circles are radius 10, sin/cos math truncated to int sprite data for a solid circle:

00 00 00 00 ff 00 03 ff c0 07 ff e0 0f ff f0 0f 
ff f0 1f ff f8 1f ff f8 3f ff fc 3f ff fc 3f ff 
fc 3f ff fc 3f ff fc 3f ff fc 1f ff f8 1f ff f8 
0f ff f0 0f ff f0 07 ff e0 03 ff c0 00 ff 00

Also I didn't stop processing until there were 7 or more collisions... so may have to back up the movement a few iterations or more to find each first collision. So hint: backup 3 iterations with subtraction.

10:13 AM 1/27/2024 Instructions for DOTS64.D64

LOAD"RUNME",8
RUN

-OR-

LOAD"DOTS64.ML",8,1
POKE 44,10:POKE 2560,0:NEW
LOAD"DOTS64STEPS",8
RUN
  1. Wait, sprites and solver will load, screen will resemble puzzle. Do SYS49152 to restore sprites if needed.

puzzle

  1. Tap the DELETE/BACKSPACE key three times, and will backup time to non-colided state, with sprite 3 at the left edge of the screen.
  2. Tap SPACEBAR slowly to advance the sprites forward in time based on their speeds (distances per iteration).
  3. You will observe the sprite numbers and coordinates on the left of the screen, with the speeds on the right of the screen.
  4. And as they move, the closest sprites data will show in the center of the screen including distance in pixels.
  5. Any detected collisions will be shown in inverse.
  6. Collision bitmask after all sprites are iterated will be shown in reverse on the left.
  7. Repeat SPACEBAR to advance forward in time until all are collided as shown in the puzzle.
  8. Move back, and repeat forward in time watching slowly to see which sprites hit the other sprites. You can solve by observation.
  9. Note: alternatively you could've solved with a spreadsheet to crunch the numbers backwards and forwards.

The distance between sprites is calculated using the Pythagorean theorem. Since these are circles of radius 10, if the distance is 20 or less, they are considered touching, and because they are identically shaped circles it doesn't matter whether you measure the distinces of the sprite origins, or take an extra step and calculate the center of the circles -- the symmetry cancels out the need for the extra step. While that BASIC processing is going on, the Commodore 64 VIC-II chip that is painting the sprites on screen is also detecting collisions as it runs through the scan lines, with that data displayed as well.

solver

Answer is also posted on X/Twitter.

dots64's People

Contributors

davervw avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.