Is there an example of snake using the latest ton-core libraries?
from cryptobugbear

I am trying to test and work with an updated version of getgems.io-snake example.

I got my flattensnake working, however for the makeSnakeCell function I run into the following trouble -

export function makeSnakeCell(data: Buffer) {
let chunks = bufferToChunks(data, 127)
let rootCell = beginCell()
let curCell = rootCell

curCell.bits.writeBuffer(chunks[0])
for (let i = 0; i < chunks.length-1; i++) {
let chunk = chunks[i]


if (chunks[i+1]) {
let nextCell = beginCell().storeBuffer(chunks[i+1])
curCell.storeRef(nextCell)
curCell = nextCell
}
}

return rootCell.endCell()
}

The rootCell has only the first ref. I think the issue is the assignment of nextCell to curCell as builder and not as a cell. However, if I try to endCell for both curCell and nextCell and then assign it throws an error.

If someone already has an updated version that would be great!

šŸ”— Answer on TON Overflow

Mar 7, 2023, 3:04 AM

Ā© 2024 Draquery.com All rights reserved.