From aaca4fac93732afa1a9cafece7cfc6af595a4cf4 Mon Sep 17 00:00:00 2001 From: ddn <107157865+drowningnewt@users.noreply.github.com> Date: Tue, 13 Feb 2024 23:09:16 -0500 Subject: [PATCH 1/5] Add colstagger args to main.go --- main.go | 1 + 1 file changed, 1 insertion(+) diff --git a/main.go b/main.go index 83bc4dc..5cbdd26 100644 --- a/main.go +++ b/main.go @@ -333,6 +333,7 @@ func commandUsage(command *Command) { func main() { ReadWeights() flag.BoolVar(&StaggerFlag, "stagger", Config.Weights.Stagger, "if true, calculates distance for ANSI row-stagger form factor") + flag.BoolVar(&ColStaggerFlag, "colstagger", Config.Weights.ColStagger, "if true, calculates distance for col-stagger form factor") flag.BoolVar(&SlideFlag, "slide", false, "if true, ignores slideable sfbs (made for Oats) (might not work)") flag.BoolVar(&DynamicFlag, "dynamic", false, "") flag.Parse() From 8372c40e07ace5d9649d0eff972c004e8093a844 Mon Sep 17 00:00:00 2001 From: ddn <107157865+drowningnewt@users.noreply.github.com> Date: Tue, 13 Feb 2024 23:10:49 -0500 Subject: [PATCH 2/5] Add colstagger Y calculations --- layout.go | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/layout.go b/layout.go index 80897a1..d52cf0a 100644 --- a/layout.go +++ b/layout.go @@ -760,9 +760,21 @@ func staggeredX(c, r int) float64 { return sx } +func staggeredY(c, r int) float64 { + var sy float64 + if c < 10 { + sy = float64(r) - Config.Weights.ColStaggers[c] + } else if c >= 10 { + sy = float64(r) - Config.Weights.ColStaggers[9]//Unsure if pinky stagger being the same is guaranteed + } + return sy +} + func twoKeyDist(a, b Pos, weighted bool) float64 { var ax float64 var bx float64 + var ay float64 + var by float64 if StaggerFlag { ax = staggeredX(a.Col, a.Row) @@ -772,8 +784,16 @@ func twoKeyDist(a, b Pos, weighted bool) float64 { bx = float64(b.Col) } + if ColStaggerFlag { + ay = staggeredY(a.Col, a.Row) + by = staggeredY(b.Col, b.Row) + } else { + ay = float64(a.Row) + by = float64(b.Row) + } + x := ax - bx - y := float64(a.Row - b.Row) + y := ay - by var dist float64 if weighted { From a6146d7f92ab10fa3512d8bb23c340c61cb41401 Mon Sep 17 00:00:00 2001 From: ddn <107157865+drowningnewt@users.noreply.github.com> Date: Tue, 13 Feb 2024 23:11:39 -0500 Subject: [PATCH 3/5] Update globals.go to have colstagger --- globals.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/globals.go b/globals.go index 9db5f98..da8c6f7 100644 --- a/globals.go +++ b/globals.go @@ -15,6 +15,8 @@ package main var StaggerFlag bool +var ColStaggerFlag bool +var ColStaggers [10]float64 var SlideFlag bool var DynamicFlag bool var ImproveFlag bool @@ -54,6 +56,8 @@ var Config struct { } Weights struct { Stagger bool + ColStagger bool + ColStaggers [10]float64 FSpeed struct { SFB float64 DSFB float64 From 5c9e7d8dc9e158d03cfedfa152aa793ca9b4f390 Mon Sep 17 00:00:00 2001 From: ddn <107157865+drowningnewt@users.noreply.github.com> Date: Tue, 13 Feb 2024 23:13:12 -0500 Subject: [PATCH 4/5] Add colstag sample to config --- config.toml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/config.toml b/config.toml index 7a29a54..4c3d3c9 100644 --- a/config.toml +++ b/config.toml @@ -30,6 +30,11 @@ Dist.Lateral = 1.4 # Lateral movement multiplier # Can be overriden using the -stagger flag. Stagger = false +# Set to true to measure distances with set column staggers. +# Can be overriden using the -colstagger flag. +ColStagger = false +ColStaggers = [0, 0.75, 1.25, 0.80, 0.75, 0.75, 0.80, 1.25, 0.75, 0] + [Weights.Fspeed] SFB = 1.0 # Weight of sfbs DSFB = 0.5 # Weight of dsfbs From 1d571ea8a08143fd74a47dacae47c9f36e5c872b Mon Sep 17 00:00:00 2001 From: semi Date: Fri, 16 Feb 2024 16:15:58 -0800 Subject: [PATCH 5/5] Update config.toml --- config.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/config.toml b/config.toml index 4c3d3c9..9e8ab57 100644 --- a/config.toml +++ b/config.toml @@ -33,6 +33,7 @@ Stagger = false # Set to true to measure distances with set column staggers. # Can be overriden using the -colstagger flag. ColStagger = false +# For columns after the 10th, last stagger value is used. ColStaggers = [0, 0.75, 1.25, 0.80, 0.75, 0.75, 0.80, 1.25, 0.75, 0] [Weights.Fspeed]