This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fun fetchProductDetailsById(id: Int) { | |
| productDetailsState.set(ProductDetailState.Loading) | |
| CoroutineScope(Dispatchers.IO).launch { | |
| resultSingleFlow( | |
| token = { userRepository.getUserAuthData().token }, | |
| database = { dao.getProductDetailsById(id = id) }, | |
| network = { token -> | |
| api.fetchProductDetailsById( | |
| token = token, | |
| id = id |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| interface BaseDao<T> { | |
| @Insert(onConflict = OnConflictStrategy.REPLACE) | |
| fun insert(obj: T) | |
| @Insert(onConflict = OnConflictStrategy.REPLACE) | |
| fun insert(list: List<T>) | |
| @Update | |
| fun update(obj: T) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| __author__ = 'Zeirison' | |
| __version__ = '0.1' | |
| import random | |
| # enemy = int(input("Your opponent (1 - Human, 2 - Computer):")) | |
| # size = int(input("Field size (1 - 3x3, 2 - 4x4, 3 - 5x5, 4 - 6x6:")) | |
| enemy = 1 | |
| tic = 1 | |
| size = 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| __author__ = 'Zeirison' | |
| import sys | |
| enemy = int(input("Please choose the opponent \n (1 - Human, 2 - Computer):")) | |
| field = ["_", "_", "_", "_", "_", "_", "_", "_", "_"] | |
| def section_check(a): |