def wordmask_tst(): print('**************************************') print('wordmask() testing...') word = 'mathstronauts' maskcounter = 0 wordmasked = mathstropy.wordmask(word) for i in wordmasked: if i == '_': maskcounter += 1 if maskcounter == 2: result = 'Passed' else: result = 'Failed' print('Description: Mask two letters in mathstronauts.') print('Output:', wordmasked) print('Result:', result)
# Intro to GameDev - word guessing game - While Loop TEMPLATE import mathstropy random_word = mathstropy.randomword() # random word generator function print("Your job is to guess the secret word.") hint = mathstropy.wordmask(random_word) print(hint) # this shows the masked word, some letters of the word are hidden # initialize the cv # create a while loop # once while loop ends # print the random word and congratulate user
# -*- coding: utf-8 -*- """ Created on Sat Aug 29 23:44:27 2020 @author: JZST6G """ ##import os ## ##path_parent = os.path.dirname(os.getcwd()) ##os.chdir(path_parent) ##print(os.getcwd()) import mathstropy word = mathstropy.randomword() print(mathstropy.wordmask(word))