I'm new in Kotlin (came from Python) and I'm trying to recreate a tic-tac-toe game.
I'm trying to use a class from another file but i just get this error when i compile the main file:
main.kt:2:21: error: unresolved reference: TicTacToeBoard
var tabuleiro = TicTacToeBoard()
^
In the directory, called "tictactoe", i have the "main.kt" and "board.kt" files:
The "main.kt" file:
fun main(args: Array<String>) {
var tabuleiro = TicTacToeBoard()
}
The "board.kt" file:
class TicTacToeBoard
The same happens with functions from another file.
I've seen a lot of articles and videos where this same syntax work. What am i missing? why is this not working? and how can i use classes from another file on the main file?
EDIT 1: (more information)
I'm using VSCODE and running the file with the
STEP 2: Search for "executor map", then, "edit json"
STEP 3: On the json file, look for "kotlin" and edit the "$filename" to the dot or asterisk (whatever work for you)
STEP 4: Save the file and you're good to go