Skip to content

Incorrect implementation of snake's convert-x-y function. #19

Description

@TommyJerryMairo

The convert-x-y in the snake section of this tutorial consists of an incorrect implementation. The faulty implementation works as the cells word multiples the top-of-stack value by a scalar 1. However, in other forth runtimes, such as gforth, one cell takes 4 or 8 bytes, depending on the CPU word length.

The correct implementation should be : convert-x-y ( x y -- offset ) 24 * + cells ;

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions