Skip to content

Instantly share code, notes, and snippets.

View chobijaeyu's full-sized avatar
😺
恩宠与勇气

chobijaeyu

😺
恩宠与勇气
  • SPAからサーバーサイドまで設計・実装します。
  • γ Mic
View GitHub Profile
@chobijaeyu
chobijaeyu / Drop Science Pack Compatibility with Enemy Race Manager
Last active May 24, 2022 23:56
Drop Science Pack Compatibility with Enemy Race Manager
require("util")
local auto_cons_researched = true
function auto_cons_check (force)
if force then
if force.technologies["steel-processing"].researched then
auto_cons_researched = true
end
elseif game.players[1] and game.players[1].force.technologies["steel-processing"].researched then
@chobijaeyu
chobijaeyu / set.go
Created June 13, 2022 07:49 — forked from bgadrian/set.go
How to implement a simple set data structure in golang
type Set struct {
list map[int]struct{} //empty structs occupy 0 memory
}
func (s *Set) Has(v int) bool {
_, ok := s.list[v]
return ok
}