Skip to content

Instantly share code, notes, and snippets.

@jayrm
jayrm / astar_pathfinding.md
Created July 16, 2022 19:07 — forked from jcward/astar_pathfinding.md
A cached copy of Patrick Lester's A* Pathfinding for Beginners

Retrieved from web.archive.org (link)

Originally available from http://www.policyalmanac.org/games/aStarTutorial.htm (link defunct)

A* Pathfinding for Beginners

By Patrick Lester (Updated July 18, 2005)

This article has been translated into Albanian, Chinese, Finnish, German, Greek, Korean, Polish, Portuguese, Romanian, Russian, Serbian, and Spanish. Other translations are welcome. See email address at the bottom of this article.

@jayrm
jayrm / repack-eq-gcc.sh
Created October 11, 2019 22:32
Script to download and repack Equation gcc toolchain installer as normal 7z acrhive.
#!/bin/bash
# download an equation gcc installer package and repack as normal 7z archive.
# if the installer package has already been downloaded, then just use the
# cached file and repack .exe installer as .7z file.
#
# requires: bash, sh, echo, 7z, find, xargs, mkdir, rm
# requires: wget (if downloading original .exe)
#
# to ensure that no file is downloaded pass the --offline option
@jayrm
jayrm / rtl-decl.bas
Created January 4, 2019 07:42
FreeBASIC 1.06.0 run time library API as of 2019-01-04
'' FreeBASIC 1.06.0 run time library API as of 2019-01-04
#define fbcall
#define wchar wstring
#define wchar_ret wstring
#define bydesc ()
'' -------- rtlArray --------
declare function fb_ArrayRedimEx cdecl ( bydesc as any, byval as const uinteger, byval as const long, byval as const long, byval as const uinteger, ... ) as long
declare function fb_ArrayRedimPresvEx cdecl ( bydesc as any, byval as const uinteger, byval as const long, byval as const long, byval as const uinteger, ... ) as long
@jayrm
jayrm / fbgfx-game-loop-demo-test.bas
Last active May 20, 2023 22:42
FreeBASIC fbgfx game loop demo test for different timing methods
'' --------------------------------------------------------
'' FBGFX game loop testing
''
'' from command prompt:
'' $ ./fbgfx-game-loop-demo-test --help for options
''
'' when running:
'' UP ARROW - select previous item
'' DOWN ARROW - select next item
'' ENTER - select item
@jayrm
jayrm / dbl2dec.bas
Last active April 14, 2018 01:20
Exact Double to Decimal Expansion for FreeBASIC
'' ============================================================
'' Dbl2Dec.bas -- Double float to decimal string expansion
''
'' Copyright (C) 2018 - Jeff Marshall (coder@execulink.com)
''
'' License: 1) Program is provided as-is.
'' 2) There is no warranty or guarantee.
'' 3) There are no other conditions.
''
'' Feel free to use, re-use, or abuse :)
@jayrm
jayrm / qd-dbl2dec.bas
Created April 12, 2018 01:49
Quick and Dirty Double to Decimal Expansion
'' quick and dirty double to decimal expansion
'' inpsired by
'' http://www.exploringbinary.com/quick-and-dirty-floating-point-to-decimal-conversion/
function QD_Dbl2Dec( byval fp as double ) as string
dim as string d, s = "+"
if( fp < 0 ) then s = "-": fp = -fp
if( fp < 1 ) then s &= "0"
dim as double i = fix(fp), f = frac(fp)
while( i > 0 )
@jayrm
jayrm / git-dirs.bas
Last active September 16, 2017 18:28
`git dirs' custom command, get the status of multiple local repositories and submodules recursively, written in freebasic
'' --------------------------------------------------------
'' git-dirs.bas
'' --------------------------------------------------------
'' get status of multiple git directories, recursively
'' copy to {GITDIR}/libexec/git-core/git-dirs[.exe]
'' use `git dirs -h' for usage or see help at bottom of this file
type GIT_DIRS_OPTIONS
recursive as boolean = false