MCPcopy Create free account
hub / github.com/ActiveState/code / settingsMenu

Function settingsMenu

recipes/Python/580811_Uno_TextBased/recipe-580811.py:1458–1492  ·  view source on GitHub ↗
(gs)

Source from the content-addressed store, hash-verified

1456 return gs
1457
1458 def settingsMenu(gs):
1459 while True:
1460 sys.stdout.write("\x1b[8;32;63t")
1461 sys.stdout.flush()
1462 clearShell()
1463 print('\n\t\tSettings')
1464 print('\n\t1. Draw Effects\t\t\t{}'.format(gs.displayEffects))
1465 print('\t2. Hide Computer Hands\t\t{}'.format(gs.hideComputerHands))
1466 print('\t3. Computer Speed\t\t{}'.format(gs.computerSpeed.title()))
1467 #print('\t4. Zero Card Changes Color\t{}'.format(gs.zeroChange))
1468 #print('\t5. Run Simulations\t\t{}'.format(gs.computerSimulation))
1469 print('\n\tA. Exit')
1470
1471 selection = str(input('\nSelection: ')).upper()
1472 while selection not in ('1', '2', '3', '4', '5', 'A', ''):
1473 print('\nSelection Invalid')
1474 selection = str(input('\nSelection: ')).upper()
1475
1476 if selection == '1':
1477 gs.displayEffects = not gs.displayEffects
1478
1479 elif selection == '2':
1480 gs.hideComputerHands = not gs.hideComputerHands
1481
1482 elif selection == '3':
1483 gs.changeComputerSpeed()
1484 '''
1485 elif selection == '4':
1486 gs.zeroChange = not gs.zeroChange
1487
1488 elif selection == '5':
1489 gs.computerSimulation = not gs.computerSimulation
1490 '''
1491 elif selection == 'A' or selection == '' or selection in ('4','5'):
1492 return gs
1493
1494 def drawMainMenu(gs):
1495 clearShell()

Callers 1

mainMenuFunction · 0.85

Calls 8

clearShellFunction · 0.85
printFunction · 0.85
strFunction · 0.85
changeComputerSpeedMethod · 0.80
writeMethod · 0.45
flushMethod · 0.45
formatMethod · 0.45
titleMethod · 0.45

Tested by

no test coverage detected