Задача ''Minesweeper Generator''
Здравейте, колеги! Ще бъда много благодарен, ако някой може да ми помогне със следната задача:
Minesweeper Generator
Everybody remembers the old mines game. Now it is time to create your own.
You will be given an integer n for the size of the mines field with square shape and another one for the number of bombs that you have to place in the field. On the next n lines, you will receive the position for each bomb. Your task is to create the game field placing the bombs at the correct positions and mark them with "*", and calculate the numbers in each cell of the field. Each cell represents a number of all bombs directly near it (up, down, left, right and the 4 diagonals).
Input
On the first line, you are given the integer n – the size of the square matrix.
On the second line – the number of the bombs.
The next n lines holds the position of each bomb.
Output
Print the matrix you've created.
Constraints
The size of the square matrix will be between [2…15].
В Judge получавам 87 точки и Runtime error и не мога да разбера какво пропускам.
Моят код е: https://pastebin.com/bHTsB0Jr
Линк към Judge: https://judge.softuni.bg/Contests/Practice/Index/2463#1
Много благодаря! Аз предполагах, че точно там е проблемът и затова пробвах с регекс преди ти да ми отговориш и получих 100 точки. Твоето решение, обаче ми харесва повече. :)
Супер , и аз там гърмях,но ползвах .isnumeric , и по същия начин отрязваше двуцифрените :)
А пробвах каквои ли не :)