<commit_before>package mario

import (
	neural "github.com/poseidon4o/go-neural/src/neural"
	util "github.com/poseidon4o/go-neural/src/util"
	"math"
)

const G_CONST float64 = 9.8 * 150

var G_FORCE util.Vector = util.Vector{
	X: 0,
	Y: G_CONST,
}

const BLOCK_SIZE int = 25

var JUMP_FORCE util.Vector = util.Vector{
	X: 0,
	Y: -700,
}

var X_ACCELERATION util.Vector = util.Vector{
	X: 20,
	Y: 0,
}

const OBSTACLE_SPACING int = 10

type Figure struct {
	pos     util.Vector
	vel     util.Vector
	nextPos util.Vector
	jumps   int
}

func (f *Figure) Jump() {
	if f.jumps >= 1 {
		return
	}
	f.jumps++
	f.vel = *f.vel.Add(&JUMP_FORCE)
	f.vel.Y = math.Max(f.vel.Y, JUMP_FORCE.Y)
}

func (f *Figure) Land() {
	f.jumps = 0
}

func (f *Figure) Move(dir int) {
	acc := X_ACCELERATION
	if dir < 0 {
		acc = *acc.Neg()
	}
	f.vel = *f.vel.Add(&acc)
}

type Level struct {
	size    util.Vector
	blocks  [][]*util.Vector
	figures []*Figure
}

func (l *Level) makeHole(c *int) {
	*c += 3 // int(3 + neural.RandMax(2))
}

func (l *Level) makeObstacle(c *int) {
	r := int(l.size.Y/float64(BLOCK_SIZE)) - 1
	for q := 0; q < 5; q++ {
		l.blocks[*c][r-q] = util.NewVector(float64(*c*BLOCK_SIZE), float64((r-q)*BLOCK_SIZE))
	}
}

func (l *Level) makeGround(c *int) {
	r := int(l.size.Y/float64(BLOCK_SIZE)) - 1

	l.blocks[*c][r] = util.NewVector(float64(*c*BLOCK_SIZE), float64(r*BLOCK_SIZE))
}

func NewLevel(w, h int) *Level {
	blockH := h / BLOCK_SIZE
	blockW := w / BLOCK_SIZE
<commit_msg>Make mario lvl holes semi random size<commit_after>package mario

import (
	neural "github.com/poseidon4o/go-neural/src/neural"
	util "github.com/poseidon4o/go-neural/src/util"
	"math"
)

const G_CONST float64 = 9.8 * 150

var G_FORCE util.Vector = util.Vector{
	X: 0,
	Y: G_CONST,
}

const BLOCK_SIZE int = 25

var JUMP_FORCE util.Vector = util.Vector{
	X: 0,
	Y: -700,
}

var X_ACCELERATION util.Vector = util.Vector{
	X: 20,
	Y: 0,
}

const OBSTACLE_SPACING int = 10

type Figure struct {
	pos     util.Vector
	vel     util.Vector
	nextPos util.Vector
	jumps   int
}

func (f *Figure) Jump() {
	if f.jumps >= 1 {
		return
	}
	f.jumps++
	f.vel = *f.vel.Add(&JUMP_FORCE)
	f.vel.Y = math.Max(f.vel.Y, JUMP_FORCE.Y)
}

func (f *Figure) Land() {
	f.jumps = 0
}

func (f *Figure) Move(dir int) {
	acc := X_ACCELERATION
	if dir < 0 {
		acc = *acc.Neg()
	}
	f.vel = *f.vel.Add(&acc)
}

type Level struct {
	size    util.Vector
	blocks  [][]*util.Vector
	figures []*Figure
}

func (l *Level) makeHole(c *int) {
	*c += int(3 + neural.RandMax(2))
}

func (l *Level) makeObstacle(c *int) {
	r := int(l.size.Y/float64(BLOCK_SIZE)) - 1
	for q := 0; q < 5; q++ {
		l.blocks[*c][r-q] = util.NewVector(float64(*c*BLOCK_SIZE), float64((r-q)*BLOCK_SIZE))
	}
}

func (l *Level) makeGround(c *int) {
	r := int(l.size.Y/float64(BLOCK_SIZE)) - 1

	l.blocks[*c][r] = util.NewVector(float64(*c*BLOCK_SIZE), float64(r*BLOCK_SIZE))
}

func NewLevel(w, h int) *Level {
	blockH := h / BLOCK_SIZE
	blockW := w / BLOCK_SIZE

{'fraction_non_alphanumeric': 0.1708711738984191, 'fraction_numerical': 0.028590649175916583, 'mean_word_length': 3.405925925925926, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5083336', 'n_tokens_mistral': 1440, 'n_tokens_neox': 1346, 'n_words': 299}