Just For Fun
Posted in 1995
Hello All, You know the old "all work and no play" etc etc saying, so here Ive decided to let you have my Informix-4gl version of the classic Hangman game. Cut the .per and .4gl out and save them as instructed, compile and have a moment of fun. Add more words later at your leisure if you desire or scoring or whatever. You may modify it as you wish as much as you wish. If you add something really cool, send me a copy! This program is completely free and may be given away and copied as much as you wish. No warrenties are expressed or implied of any kind! Use completely at your own risk, I am not liable for anything at anytime period. James Tibbets jtibb@rankin.com -- ) \\ / ( /|\\ )\\_/( /|\\ * / | \\ (/\\|/\\) / | \\ * |\\ / | \\ \\`|'/ / | \\ /| | .________________/___|___o__ __\\|/__ __o___|___\\________________. | | James Tibbets |^` V ^|` Suite 1286 | | Application Engineer Phoenix, Arizona 85029 | | Rankin Technology Group Phone:(602) 997-6996 | | 2432 West Peoria Avenue Fax: (602) 997-4256 | | ._______________________________________________________________. | |/ | /\\ / \\\\ \\ /\\ | \\ | * | / V )) V \\ | * |/ // \\| V ---------------- Cut and save as hangman.per ----------------------------- {##################################################################### # Copyright (C) 1994 Rankin Technology Group Inc. Phoenix, AZ # All rights reserved. # Use, modification, duplication, and/or distribution of this # software is limited by the software license agreement. # Sccsid: %Z% %M% %I% Delta: %G% ###################################################################### # Screen Generator version: 4.10.UC1 } DATABASE formonly SCREEN { --------------------------------------------- ------- | | | | | | | ---------------- Letter:[A] --------------------------------------------- } ATTRIBUTES A = formonly.guess, upshift, comments = "Enter a letter to guess."; INSTRUCTIONS screen record s_screen (formonly.guess) delimiters " " --------------- Cut ------------------------------------------------------ ---------------- Cut and save as hangman.4gl ----------------------------- ###################################################################### # Copyright (C) 1994 Rankin Technology Group Inc. Phoenix, AZ # All rights reserved. # Use, modification, duplication, and/or distribution of this # software is limited by the software license agreement. # Sccsid: %Z% %M% %I% Delta: %G% ###################################################################### # hangman.4gl 1.0 Written 11/02/95 by James Tibbets Rankin Technology Group. # This is an Informix-4gl version of Hangman. # Maybe in the future add scoring, more words...clean up, etc etc... # globals define x smallint, y smallint, open_scr char(1), num_let_guess smallint, letter_guess char(1), got_letter smallint, a_word char(15), word_lngth smallint, num_wrong smallint, g_word array[26] of record old_word char(1) end record, init_prep char(1), word_selected array[15] of record sel_flag smallint end record end globals main call start_hangman() end main ###################################################################### function start_hangman() ###################################################################### # # #_init initialize init_prep to null let x = 1 let y = 1 for x = 1 to 26 initialize g_word[x].* to null end for let num_wrong = 0 let word_lngth = 0 let got_letter = false call set_word() call guess() end function # start_hangman() ###################################################################### function set_word() # sets the word to be guessed ###################################################################### # In the future add more words. # #_define_var - Define local variables define cur_time datetime hour to second, tmp_time char(8) let cur_time = time let tmp_time = cur_time case when tmp_time[8] = 1 let a_word = "WIN" let word_lngth = length(a_word) when tmp_time[8] = 2 let a_word = "ELEPHANT" let word_lngth = length(a_word) when tmp_time[8] = 3 let a_word = "RANDOM" let word_lngth = length(a_word) when tmp_time[8] = 4 let a_word = "COMPUTER" let word_lngth = length(a_word) when tmp_time[8] = 5 let a_word = "FISH" let word_lngth = length(a_word) when tmp_time[8] = 6 let a_word = "POPCORN" let word_lngth = length(a_word) when tmp_time[8] = 7 let a_word = "ORANGE" let word_lngth = length(a_word) when tmp_time[8] = 8 let a_word = "MONKEY" let word_lngth = length(a_word) when tmp_time[8] = 9 let a_word = "HOUSE" let word_lngth = length(a_word) when tmp_time[8] = 0 let a_word = "BUILDING" let word_lngth = length(a_word) otherwise let a_word = "OTHERWISE" let word_lngth = length(a_word) end case end function # set_word() ###################################################################### function disp_clue() ###################################################################### # #_define_var - Define local variables define x smallint, y smallint #_init let x = 0 let y = 2 for x = 1 to word_lngth display "=" at 11, y let y = y + 1 end for end function # disp_clue() ###################################################################### function guess() # returns guess ###################################################################### # #_define_var - Define local variables define letter_guess char(1) #_open_window if open_scr is null then open window selwin1 at 5, 16 with 16 rows, 45 columns attribute (border, blue) #_display_parameters display "Hangman" at