Skip to content

Instantly share code, notes, and snippets.

View rahulsmehta's full-sized avatar

Rahul Mehta rahulsmehta

View GitHub Profile
@rahulsmehta
rahulsmehta / EvilHangman.java
Created August 15, 2012 02:12
EvilHangman Facade Example
//Assume that all necessary packages are imported
public class EvilHangman implements HangmanInterface {
//Assume all private member variables including dictionary and letters guessed,
//num guesses, etc have been instantiated
private int guessesRemaining,wordLength;
//Now here's the important piece: we're going to have the EvilHangman game
//maintain a private, REGULAR hangman game.
private async wait<T>(ms, value: T): Promise<T> {
return new Promise(resolve => setTimeout(resolve, ms, value));
}