Skip to content

Instantly share code, notes, and snippets.

View Zeirison's full-sized avatar
🎯
Focusing

Dmytro Soldatenko Zeirison

🎯
Focusing
View GitHub Profile
@Zeirison
Zeirison / tic-tac-toe.py
Last active August 29, 2015 14:18
New functions and fixes
__author__ = 'Zeirison'
import sys
enemy = int(input("Please choose the opponent \n (1 - Human, 2 - Computer):"))
field = ["_", "_", "_", "_", "_", "_", "_", "_", "_"]
def section_check(a):
__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
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)
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