Skip to content

Instantly share code, notes, and snippets.

View starwing's full-sized avatar

Xavier Wang starwing

  • Chengdu
View GitHub Profile
@starwing
starwing / pathfinding.c
Created January 19, 2022 07:34
A* Path finding in Lua
/*
* AStarfinding
*
* local path_find = require "pathfinding"
*
* local function neighbors(add, x, y, dist)
* add(x+1, y, hint, 1)
* end
*
* local r = path_find(sx, sy, tx, ty, neighbors)
@starwing
starwing / findup.rs
Created July 17, 2023 09:39
手机9键双拼方案搜索程序
use std::{
collections::{HashMap, HashSet},
fmt,
fmt::{Display, Formatter},
hash::Hash,
iter::FromIterator,
sync::OnceLock,
};
#[derive(Debug, Hash, Clone, Copy, Eq, PartialEq)]