This file contains 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
#!/usr/bin/env python | |
from BaseHTTPServer import HTTPServer | |
from BaseHTTPServer import BaseHTTPRequestHandler | |
import cgi | |
HOST = "194.176.114.21" | |
PORT = 8008 | |
FILE_PREFIX = "." | |
if __name__ == "__main__": |
This file contains 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
Приветствие и регистрация: | |
Клиент: {action: "register", nickname: "Anna"} | |
Сервер: {status: "ok", id:231} | |
Получение списка пользователей (после успешной регистрации): | |
Клиент: {action: "fetch_users"} | |
Сервер: {status: "ok", users:[{id:40, nickname:"Alex"}, {id:105, nickname:"Ckopo"}]} | |
Вступление в игру: | |
Клиент: {action: "join", opponent_id:105} | |
Сервер: {status: "ok", data: {heaps:[10, 5, 2], your_turn: false}} | |
Получение статуса с сервера |
This file contains 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
Приветствие и регистрация: | |
Клиент: {action: "register", nickname: "Anna"} | |
Сервер: {status: "error", error_id: 101, error_desc: "Nickname alredy occupied"} | |
Сервер: {status: "error", error_id: 1, error_desc: "Internal server error"} | |
Вступление в игру: | |
Клиент: {action: "join", opponent_id:10005} | |
Сервер: {status: "error", error_id: 201, error_desc: "No available user with id 10005"} | |
Получение статуса с сервера |
This file contains 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
#!/usr/bin/env python | |
from BaseHTTPServer import HTTPServer | |
from BaseHTTPServer import BaseHTTPRequestHandler | |
import json | |
HOST = "194.176.114.21" | |
PORT = 8048 | |
FILE_PREFIX = "." | |
class JSONRequestHandler (BaseHTTPRequestHandler): |
This file contains 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
#!/usr/bin/env python | |
from BaseHTTPServer import HTTPServer | |
from BaseHTTPServer import BaseHTTPRequestHandler | |
import json | |
HOST = "194.176.114.21" | |
PORT = 8048 | |
FILE_PREFIX = "." | |
players = { | |
"Alice" : 1, |
This file contains 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
package com.itschool.itprogect.set3; | |
import android.content.Context; | |
import android.graphics.Canvas; | |
import android.graphics.Color; | |
import android.graphics.Paint; | |
import android.graphics.Path; | |
import android.graphics.Point; | |
import android.util.AttributeSet; | |
import android.view.View; |
This file contains 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
#!/usr/bin/env python | |
from BaseHTTPServer import HTTPServer | |
from BaseHTTPServer import BaseHTTPRequestHandler | |
import json | |
import random | |
import MySQLdb | |
# SET-game server | |
HOST = "194.176.114.21" |
This file contains 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
#!/usr/bin/env python | |
from BaseHTTPServer import HTTPServer | |
from BaseHTTPServer import BaseHTTPRequestHandler | |
import json | |
import random | |
import MySQLdb | |
# SET-game server | |
HOST = "194.176.114.21" |
This file contains 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
#!/usr/bin/env python | |
from BaseHTTPServer import HTTPServer | |
from BaseHTTPServer import BaseHTTPRequestHandler | |
import json | |
import random | |
import MySQLdb | |
# SET-game server | |
HOST = "194.176.114.21" |
This file contains 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
#!/usr/bin/python | |
cards = [ | |
{ "color" : "white" }, | |
{ "color" : "red" }, | |
{ "color" : "green" } | |
] | |
print cards |
OlderNewer