Exemplo n.º 1
0
from winsound import MessageBeep, MB_OK, MB_ICONASTERISK as beep;

# Establish our connection object
conn1 = NetworkInterface();
conn1.baseSite = "dignityice.com";
conn1.target = "/dg/Xunnamius/house2/pyGameInterface.php";

# Set up our environment
loggedIn = False;
time.clock(); # Clear the timer

# Sound-off!
# No color support in this version for now, so the Display.*Msg distinctions are only code-deep
Display.sysMsg('DO NOT RUN THIS PROGRAM IN THE PYTHON INTERACTIVE CONSOLE (IDLE)! DO NOT!\n\n');
Display.sysMsg('Mini-MAR BETA version', __version__);
conn1.status();
Display.sysMsg('Bernard Dickens - Project II -', __author__);

# Exit MAR
def MAR_exit(status=0):
    if(status == 0): Display.gameMsg('Program Terminated.');
    else: Display.errorMsg('Program Terminated Unexpectedly ('+str(status)+')!');
    Display.evnMsg('(C) Copyright 2010 - Dark Gray. All Rights Reserved.');
    Display.pause();
    os._exit(status);

# Is this JSON-like data?
def is_JSON(data):
    data = str(data).strip();
    if(data[0] == '{' and data[-1] == '}'): return True;
    return False;
# Our superglobals
__version__ = "1.1b6"
__author__ = "Xunnamius of Dark Gray"

import re
from string import ascii_uppercase, ascii_letters
from random import randint
from math import fabs
from httplib import BadStatusLine
from collections import OrderedDict
from NetworkInterface import NetworkInterface
from DisplayInterface import Display

conn1 = NetworkInterface()
conn1.status()

ascii_uppercase = ascii_uppercase[::-1]

try:
    gameNum = 0
    i = 1
    state = "y"
    # No color support in this version, so the Display.*Msg distinctions are only code-deep
    Display.sysMsg("Bernard Dickens - Letter Guessing Game (Project II) - ", __author__)

    while i == 1:
        i = Display.menu(
            OrderedDict([("free play", False), ("load profile", 1), ("online play", True), ("exit", 2)]),
            initMsg="Please Select Your Gameplay Mode:",
            prefix="# ",