honeycomb: Grid is not calling `.map()`
Here’s a test I wrote that is not throwing an error, but it should:
describe('rectangle()', () => {
test('returns a new grid', () => {
const grid = new Grid(createHexPrototype(), rectangle({ width: 2, height: 2 })).map((h) => h).run()
const newGrid = grid.map((h) => {
throw new Error('')
})
grid.run()
newGrid.run()
})
})
This test throws an error, as expected:
describe('rectangle()', () => {
test('returns a new grid', () => {
- const grid = new Grid(createHexPrototype(), rectangle({ width: 2, height: 2 })).map((h) => h).run()
+ const grid = new Grid(createHexPrototype(), rectangle({ width: 2, height: 2 })).map((h) => h) //.run()
+ grid.run()
const newGrid = grid.map((h) => {
throw new Error('')
})
grid.run()
newGrid.run()
})
})
version: 4.0.0-alpha.3
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 16 (8 by maintainers)
Commits related to this issue
- fix(grid): fix bug where internal hexes were cleared after Grid run() was called fix #67 — committed to flauwekeul/honeycomb by flauwekeul 3 years ago
- fix(grid): fix bug where internal hexes were cleared after Grid run() was called fix #67 — committed to flauwekeul/honeycomb by flauwekeul 3 years ago
- :bookmark: 4.0.0 [skip ci] # [v4.0.0](https://github.com/flauwekeul/honeycomb/compare/v3.1.8...v4.0.0) (2022-10-04) ## ✨ New Features - [`e08bc46`](https://github.com/flauwekeul/honeycomb/commit/e08... — committed to flauwekeul/honeycomb by semantic-release-bot 2 years ago
🎉 This issue has been resolved in version 4.0.0-beta.1 🎉
The release is available on:
Your semantic-release bot 📦🚀
I just released alpha.4. It contains a
ring()
andspiral()
traverser and I’ve tried to fix the duplicate hexes that chaining traversers caused. I’m looking forward to your opinion (of course it’s fine if you don’t want to).I took a quick look at your app, it looks nice and clean. Unfortunately, I don’t know the rules of the game, so I have no idea how to play it. But any game that uses hexagons is worth playing, so I’ll learn this when I have more time.
@flauwekeul this is probably not the best place to post this, but I didn’t want to open another issue for this.
I’ve finished the Cryptid solver and I’ll try it out tomorrow.
Here’s the code and the app: https://vfonic.github.io/honeycomb/ https://github.com/vfonic/honeycomb/tree/gh-pages
As you’ve seen, I’ve made 2 separate issues.
For you it may have been easier to use v3 (it also has typings, so it can be used with TypeScript), but for me it’s very good you’re using v4-alpha. It gives me a very valuable insight in how other people use my library. Maybe you’re not using v4 as I intend to, but that’s because there’s not much documentation yet. And even if there were plenty of documentation and examples, people write code as they’re used to and that might be different from how I’d like them to.
I’ll look into your code and either make changes in Honeycomb or I could give some advice how to better use Honeycomb (if you want).