Welcome, Guest
You have to register before you can post on our site.

Username/Email:
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 483
» Latest member: aplus
» Forum threads: 2,801
» Forum posts: 26,412

Full Statistics

Latest Threads
Raspberry OS
Forum: Help Me!
Last Post: PerspexSphinx
29 minutes ago
» Replies: 5
» Views: 95
GNU C++ Compiler error
Forum: Help Me!
Last Post: RhoSigma
3 hours ago
» Replies: 1
» Views: 42
Merry Christmas Globes!
Forum: Programs
Last Post: SierraKen
Today, 03:46 AM
» Replies: 10
» Views: 124
Text-centring subs
Forum: Utilities
Last Post: Pete
Today, 02:50 AM
» Replies: 3
» Views: 78
Screw Text Centering. How...
Forum: Utilities
Last Post: Pete
Today, 01:44 AM
» Replies: 0
» Views: 37
List of file sound extens...
Forum: Help Me!
Last Post: aplus
Yesterday, 11:50 PM
» Replies: 16
» Views: 282
Merry Christmas Globes!
Forum: Christmas Code
Last Post: SierraKen
Yesterday, 09:58 PM
» Replies: 7
» Views: 77
Tenary operator in QB64 w...
Forum: Utilities
Last Post: Kernelpanic
Yesterday, 06:58 PM
» Replies: 7
» Views: 120
New QBJS Samples Site
Forum: QBJS, BAM, and Other BASICs
Last Post: DANILIN
Yesterday, 04:29 PM
» Replies: 24
» Views: 861
School themes from USSR a...
Forum: Programs
Last Post: DANILIN
Yesterday, 04:19 PM
» Replies: 24
» Views: 1,955

 
  How to get the most speed out your program?
Posted by: justsomeguy - 06-30-2024, 02:38 PM - Forum: General Discussion - Replies (29)

For those that are intimately familiar with the QB64 and its underlying code. What are some of the best ways to get more speed out of a program?

This is a short list of things that I have heard, but have not seen proven.

  • Using '$CHECKING:OFF' in areas that need the most speed.
  • 'DO ... LOOP' is faster than 'FOR ... NEXT'
  • 'MEMPUT' in a loop is faster than 'MEMFILL'
Are there any other tricks or thing to avoid?

Print this item

  QB64's TYPE / END TYPE inquiry
Posted by: MystikShadows - 06-30-2024, 01:30 PM - Forum: Help Me! - Replies (2)

Hi everyone,

Please move this thread where it belongs if not here. Smile

I just tried to declare a type end type structure but it does not work. here is the situation. I have this type

Code: (Select All)
TYPE FloorData
     FloorID AS LONG
     FloorDescription AS STRING * 60
END TYPE
       
TYPE BuilddingData
     Floors(9) AS FloorData   <- this line is red
END TYPE

It's telling me it needs element as tpy, element=list as type or end type.  I though using arrays was something that was always available to us. help please Smile

Print this item

  Spell Checker
Posted by: SMcNeill - 06-30-2024, 12:22 PM - Forum: SMcNeill - Replies (1)

A program of mine that has been around forever and ever and ever, and which I swear I'd thought I'd shared on this set of forums once before, but apparently haven't -- Steve's Basic Spell Checker!

Code: (Select All)
DEFLNG A-Z
REDIM SpellingWord(0) AS STRING

InitializeSpellchecker
DO
LINE INPUT "Give me a sentence ="; sentence$
IF sentence$ = "" THEN SYSTEM
bad = CheckSentence(sentence$, bad$)
IF bad THEN
PRINT "There were"; -bad; " mistakes found. They were:"
PRINT bad$
ELSE
PRINT "Sentence good!"
END IF
LOOP
END


SUB InitializeSpellchecker
SHARED SpellingWord$
SHARED SpellingWord() AS STRING
PRINT "Initializing spelling lists. Be patient a moment."
SpellingWord$ = CHR$(10)
DO
READ W$
W$ = UCASE$(W$)
IF W$ = "XDONE" THEN EXIT DO
counter = counter + 1
REDIM _PRESERVE SpellingWord(counter) AS STRING
SpellingWord(counter) = W$
SpellingWord$ = SpellingWord$ + CHR$(10) + W$ + CHR$(13)
LOOP


PRINT "Spelling lists ready."
PRINT
PRINT

END SUB


FUNCTION CheckSentence (sent$, bad$)
SHARED SpellingWord$
SHARED SpellingWord() AS STRING
REDIM suggestion(0) AS STRING
REDIM percent(0) AS INTEGER
DIM result AS SINGLE

text$ = LTRIM$(RTRIM$(sent$)) + " "
FOR i = 1 TO LEN(text$)
x = ASC(UCASE$(text$), i)
IF x > 64 AND x < 92 OR x = 39 THEN text1$ = text1$ + MID$(text$, i, 1) ELSE text1$ = text1$ + " "
NEXT
text$ = LTRIM$(RTRIM$(text1$)) + " "

bad = 0 'It's not bad to start with
bad$ = "" 'not bad string to start with either

DO UNTIL finished
l = INSTR(l + 1, text$, " ")
IF l > 0 THEN
word$ = MID$(text$, oldl, l - oldl): oldl = l + 1
IF LEN(word$) < 2 THEN
'Word too small to check, we still count it as good
ELSE
IF INSTR(SpellingWord$, CHR$(10) + UCASE$(word$) + CHR$(13)) THEN
'It's in there!, that's a valid word!
ELSE
s = 0: bad = bad - 1
wl = LEN(word$)
FOR i = 1 TO UBOUND(SpellingWord)
IF wl > LEN(SpellingWord(i)) * .7 AND wl < LEN(SpellingWord(i)) * 1.2 THEN 'no need to check words too short or too long to generate a positive result
result = SpellCheck(word$, SpellingWord(i))
IF result < -75 THEN
s = s + 1
REDIM _PRESERVE suggestion(s)
REDIM _PRESERVE percent(s)
suggestion(s) = SpellingWord(i)
percent(s) = result
END IF
END IF
NEXT
bad$ = bad$ + word$ + " -- " + STR$(s) + " SUGGESTIONS: "
FOR i = 1 TO s
bad$ = bad$ + suggestion(i) '+ "(" + STR$(-percent(i)) + ")" 'Unremark this line if we want to see the percentage match we generated
IF i <> s THEN bad$ = bad$ + ", "
NEXT
bad$ = bad$ + CHR$(10) 'a simple linux file ending for easy parsing later
END IF
END IF
ELSE
finished = -1
END IF

LOOP
CheckSentence = bad
END FUNCTION

FUNCTION SpellCheck (useranswer$, answer$)
IF useranswer$ = answer$ THEN SpellCheck = 100: EXIT FUNCTION 'It's a perfect match

DIM alphabit(26), useralphabit(26)
FOR j = 0 TO 26: alphabit(j) = 0: useralphabit(j) = 0: NEXT
FOR j = 1 TO LEN(answer$)
x = ASC(UCASE$(MID$(answer$, j, 1)))
IF x = 39 THEN alphabit(0) = alphabit(0) + 1: length = length + 1
IF x > 64 AND x < 91 THEN ' we have letters to check the spell checker against!
alphabit(x - 64) = alphabit(x - 64) + 1
length = length + 1
END IF
NEXT
FOR j = 1 TO LEN(useranswer$)
x = ASC(UCASE$(MID$(useranswer$, j, 1)))
IF x = 39 THEN useralphabit(0) = useralphabit(0) + 1
IF x > 64 AND x < 91 THEN useralphabit(x - 64) = useralphabit(x - 64) + 1
NEXT
wordright = 0: wordwrong = 0
FOR j = 0 TO 26
IF alphabit(j) <= useralphabit(j) THEN
wordright = wordright + alphabit(j)
wordwrong = wordwrong + useralphabit(j) - alphabit(j)
ELSE
wordright = wordright + useralphabit(j)
END IF
NEXT
IF LEN(useranswer$) <= 6 THEN
SpellCheck = -wordright / length * 100
ELSE
SpellCheck = -(ABS(wordright - wordwrong / 2) / length * 100)
END IF
IF wordwrong >= wordright THEN SpellCheck = 0 'If we get more letters wrong than we did right, count it bad.
END FUNCTION


DATA "10th","1st","2nd","3rd","4th","5th","6th","7th","8th","9th","a","a&m","a&p","a's","aaa","aaas","aarhus","aaron","aau","aba"
DATA "ababa","aback","abacus","abalone","abandon","abase","abash","abate","abater","abbas","abbe","abbey","abbot","abbott","abbreviate","abc","abdicate","abdomen","abdominal","abduct"
DATA "abe","abed","abel","abelian","abelson","aberdeen","abernathy","aberrant","aberrate","abet","abetted","abetting","abeyance","abeyant","abhorred","abhorrent","abide","abidjan","abigail","abject"
DATA "ablate","ablaze","able","ablution","abner","abnormal","abo","aboard","abode","abolish","abolition","abominable","abominate","aboriginal","aborigine","aborning","abort","abound","about","above"
DATA "aboveboard","aboveground","abovementioned","abrade","abraham","abram","abramson","abrasion","abrasive","abreact","abreast","abridge","abridgment","abroad","abrogate","abrupt","abscess","abscissa","abscissae","absence"
DATA "absent","absentee","absenteeism","absentia","absentminded","absinthe","absolute","absolution","absolve","absorb","absorbent","absorption","absorptive","abstain","abstention","abstinent","abstract","abstracter","abstractor","abstruse"
DATA "absurd","abuilding","abundant","abusable","abuse","abusive","abut","abutted","abutting","abysmal","abyss","abyssinia","ac","academe","academia","academic","academician","academy","acadia","acanthus"
DATA "acapulco","accede","accelerate","accelerometer","accent","accentual","accentuate","accept","acceptant","acceptor","access","accessible","accession","accessory","accident","accidental","accipiter","acclaim","acclamation","acclimate"
DATA "accolade","accommodate","accompaniment","accompanist","accompany","accomplice","accomplish","accord","accordant","accordion","accost","account","accountant","accra","accredit","accreditate","accreditation","accretion","accrual","accrue"
DATA "acculturate","accumulate","accuracy","accurate","accusation","accusative","accusatory","accuse","accustom","ace","acerbic","acerbity","acetate","acetic","acetone","acetylene","ache","achieve","achilles","aching"
DATA "achromatic","acid","acidic","acidulous","ackerman","ackley","acknowledge","acknowledgeable","acm","acme","acolyte","acorn","acoustic","acquaint","acquaintance","acquiesce","acquiescent","acquire","acquisition","acquisitive"
DATA "acquit","acquittal","acquitting","acre","acreage","acrid","acrimonious","acrimony","acrobacy","acrobat","acrobatic","acronym","acropolis","across","acrylate","acrylic","acs","act","actaeon","actinic"
DATA "actinide","actinium","actinolite","actinometer","activate","activation","activism","acton","actor","actress","acts","actual","actuarial","actuate","acuity","acumen","acute","acyclic","ad","ada"
DATA "adage","adagio","adair","adam","adamant","adams","adamson","adapt","adaptation","adaptive","add","added","addend","addenda","addendum","addict","addis","addison","addition","additional"
DATA "additive","addle","address","addressee","addressograph","adduce","adelaide","adele","adelia","aden","adenine","adenoma","adenosine","adept","adequacy","adequate","adhere","adherent","adhesion","adhesive"
DATA "adiabatic","adieu","adipic","adirondack","adjacent","adject","adjectival","adjective","adjoin","adjoint","adjourn","adjudge","adjudicate","adjunct","adjust","adjutant","adkins","adler","administer","administrable"
DATA "administrate","administratrix","admiral","admiralty","admiration","admire","admissible","admission","admit","admittance","admitted","admitting","admix","admixture","admonish","admonition","ado","adobe","adolescent","adolph"
DATA "adolphus","adonis","adopt","adoption","adoptive","adore","adorn","adposition","adrenal","adrenaline","adrian","adriatic","adrienne","adrift","adroit","adsorb","adsorbate","adsorption","adsorptive","adulate"
DATA "adult","adulterate","adulterous","adultery","adulthood","advance","advantage","advantageous","advent","adventitious","adventure","adventurous","adverb","adverbial","adversary","adverse","advert","advertise","advice","advisable"
DATA "advise","advisee","advisor","advisory","advocacy","advocate","aegean","aegis","aeneas","aeneid","aeolian","aeolus","aerate","aerial","aerobacter","aerobic","aerodynamic","aerogene","aeronautic","aerosol"
DATA "aerospace","aeschylus","aesthete","aesthetic","afar","affable","affair","affect","affectate","affectation","affectionate","afferent","affiance","affidavit","affiliate","affine","affinity","affirm","affirmation","affirmative"
DATA "affix","afflict","affluence","affluent","afford","afforest","afforestation","affricate","affront","afghan","afghanistan","aficionado","afield","afire","aflame","afloat","afoot","aforementioned","aforesaid","aforethought"
DATA "afoul","afraid","afresh","africa","afro","aft","aftereffect","afterglow","afterimage","afterlife","aftermath","afternoon","afterthought","afterward","afterword","again","against","agamemnon","agate","agatha"
DATA "agave","age","agee","agenda","agent","agglomerate","agglutinate","agglutinin","aggravate","aggregate","aggression","aggressive","aggressor","aggrieve","aghast","agile","aging","agitate","agleam","agnes"
DATA "agnew","agnomen","agnostic","ago","agone","agony","agouti","agrarian","agree","agreeable","agreed","agreeing","agribusiness","agricola","agricultural","agriculture","agrimony","ague","agway","ah"
DATA "ahead","ahem","ahmadabad","ahmedabad","ahoy","aid","aida","aide","aides","aiken","ail","ailanthus","aile","aileen","aileron","aim","ain't","ainu","air","airborne"
DATA "aircraft","airdrop","airedale","aires","airfare","airfield","airflow","airfoil","airframe","airlift","airline","airlock","airmail","airman","airmass","airmen","airpark","airplane","airport","airspace"
DATA "airspeed","airstrip","airtight","airway","airy","aisle","aitken","ajar","ajax","ak","akers","akin","akron","al","ala","alabama","alabamian","alabaster","alacrity","alai"
DATA "alameda","alamo","alan","alarm","alaska","alb","alba","albacore","albania","albanian","albany","albatross","albeit","alberich","albert","alberta","alberto","albrecht","albright","album"
DATA "albumin","albuquerque","alcestis","alchemy","alcmena","alcoa","alcohol","alcoholic","alcoholism","alcott","alcove","aldebaran","aldehyde","alden","alder","alderman","aldermen","aldrich","aldrin","ale"
DATA "alec","aleck","aleph","alert","alewife","alex","alexander","alexandra","alexandre","alexandria","alexei","alexis","alfalfa","alfonso","alfred","alfredo","alfresco","alga","algae","algaecide"
DATA "algal","algebra","algebraic","algenib","alger","algeria","algerian","algiers","alginate","algol","algonquin","algorithm","algorithmic","alhambra","ali","alia","alias","alibi","alice","alicia"
DATA "alien","alienate","alight","align","alike","alimony","aliphatic","aliquot","alison","alistair","alive","alizarin","alkali","alkaline","alkaloid","alkane","alkene","all","allah","allan"
DATA "allay","allegate","allegation","allege","allegheny","allegiant","allegoric","allegory","allegra","allegro","allele","allemand","allen","allentown","allergic","allergy","alleviate","alley","alleyway","alliance"
DATA "allied","alligator","allis","allison","alliterate","allocable","allocate","allot","allotropic","allotted","allotting","allow","allowance","alloy","allspice","allstate","allude","allure","allusion","allusive"
DATA "alluvial","alluvium","ally","allyl","allyn","alma","almaden","almagest","almanac","almighty","almond","almost","aloe","aloft","aloha","alone","along","alongside","aloof","aloud"
DATA "alp","alpenstock","alpert","alpha","alphabet","alphabetic","alphameric","alphanumeric","alpheratz","alphonse","alpine","alps","already","alsatian","also","alsop","altair","altar","alter","alterate"
DATA "alteration","altercate","alterman","altern","alternate","althea","although","altimeter","altitude","alto","altogether","alton","altruism","altruist","alum","alumina","aluminate","alumna","alumnae","alumni"
DATA "alumnus","alundum","alva","alvarez","alveolar","alveoli","alveolus","alvin","alway","always","alyssum","am","ama","amadeus","amalgam","amalgamate","amanita","amanuensis","amaranth","amarillo"
DATA "amass","amateur","amateurish","amatory","amaze","amazon","ambassador","amber","ambiance","ambidextrous","ambient","ambiguity","ambiguous","ambition","ambitious","ambivalent","amble","ambling","ambrose","ambrosia"
DATA "ambrosial","ambulant","ambulate","ambulatory","ambuscade","ambush","amelia","ameliorate","amen","amend","amende","amerada","america","american","americana","americanism","americium","ames","ameslan","amethyst"
DATA "amethystine","amherst","ami","amicable","amid","amide","amidst","amigo","amino","aminobenzoic","amiss","amity","amman","ammerman","ammeter","ammo","ammonia","ammoniac","ammonium","ammunition"
DATA "amnesia","amoco","amoeba","amoebae","amok","among","amongst","amoral","amorous","amorphous","amort","amos","amount","amp","amperage","ampere","ampersand","ampex","amphetamine","amphibian"
DATA "amphibious","amphibole","amphibology","amphioxis","ample","amplifier","amplify","amplitude","amply","amputate","amputee","amra","amsterdam","amtrak","amulet","amuse","amy","amygdaloid","an","ana"
DATA "anabaptist","anabel","anachronism","anachronistic","anaconda","anaerobic","anaglyph","anagram","anaheim","analeptic","analgesic","analogous","analogue","analogy","analyses","analysis","analyst","analytic","anamorphic","anaplasmosis"
DATA "anarch","anarchic","anarchy","anastasia","anastigmat","anastigmatic","anastomosis","anastomotic","anathema","anatole","anatomic","anatomy","ancestor","ancestral","ancestry","anchor","anchorage","anchorite","anchoritism","anchovy"
DATA "ancient","ancillary","and","andean","andersen","anderson","andes","andesine","andesite","andiron","andorra","andover","andre","andrea","andrei","andrew","andrews","andromache","andromeda","andy"
DATA "anecdotal","anecdote","anemone","anent","anew","angel","angela","angeles","angelfish","angelic","angelica","angelina","angeline","angelo","anger","angie","angiosperm","angle","angles","anglican"
DATA "anglicanism","angling","anglo","anglophobia","angola","angora","angry","angst","angstrom","anguish","angular","angus","anharmonic","anheuser","anhydride","anhydrite","anhydrous","ani","aniline","animadversion"
DATA "animadvert","animal","animate","animism","animosity","anion","anionic","anise","aniseikonic","anisotropic","anisotropy","anita","ankara","ankle","ann","anna","annal","annale","annalen","annals"
DATA "annapolis","anne","anneal","annette","annex","annie","annihilate","anniversary","annotate","announce","annoy","annoyance","annual","annuity","annul","annular","annuli","annulled","annulling","annulus"
DATA "annum","annunciate","anode","anodic","anomalous","anomaly","anomie","anonymity","anonymous","anorexia","anorthic","anorthite","anorthosite","another","anselm","anselmo","ansi","answer","ant","antacid"
DATA "antaeus","antagonism","antagonist","antagonistic","antarctic","antarctica","antares","ante","anteater","antebellum","antecedent","antedate","antelope","antenna","antennae","anterior","anteroom","anthem","anther","anthology"
DATA "anthony","anthracite","anthracnose","anthropogenic","anthropology","anthropomorphic","anthropomorphism","anti","antic","anticipate","anticipatory","antietam","antigen","antigone","antigorite","antimony","antioch","antipasto","antipathy","antiperspirant"
DATA "antiphonal","antipode","antipodean","antipodes","antiquarian","antiquary","antiquated","antique","antiquity","antisemite","antisemitic","antisemitism","antithetic","antler","antoine","antoinette","anton","antonio","antony","antonym"
DATA "antwerp","anus","anvil","anxiety","anxious","any","anybody","anybody'd","anyhow","anyone","anyplace","anything","anyway","anywhere","aorta","apace","apache","apart","apartheid","apathetic"
DATA "apathy","apatite","ape","aperiodic","aperture","apex","aphasia","aphasic","aphelion","aphid","aphorism","aphrodite","apices","apiece","aplomb","apocalypse","apocalyptic","apocrypha","apocryphal","apogee"
DATA "apollo","apollonian","apologetic","apologia","apology","apostate","apostle","apostolic","apostrophe","apothecary","apothegm","apotheosis","appalachia","appall","appanage","apparatus","apparel","apparent","apparition","appeal"
DATA "appear","appearance","appeasable","appease","appellant","appellate","append","appendage","appendices","appendix","apperception","appertain","appetite","appian","applaud","applause","apple","appleby","applejack","appleton"
DATA "appliance","applicable","applicant","applicate","application","applied","applique","apply","appoint","appointe","appointee","apport","apportion","apposite","apposition","appraisal","appraise","appreciable","appreciate","apprehend"
DATA "apprehension","apprehensive","apprentice","apprise","approach","approbation","appropriable","appropriate","approval","approve","approximable","approximant","approximate","apr","apricot","april","apron","apropos","aps","apse"
DATA "apt","aptitude","aqua","aquarium","aquarius","aquatic","aqueduct","aqueous","aquila","aquinas","ar","arab","arabesque","arabia","arabic","araby","arachne","arachnid","arbiter","arbitrage"
DATA "arbitrary","arbitrate","arboreal","arboretum","arbutus","arc","arcade","arcadia","arcana","arcane","arccos","arccosine","arch","archae","archaic","archaism","archangel","archbishop","archdiocese","archenemy"
DATA "archer","archery","archetype","archetypical","archfool","archibald","archimedes","arching","archipelago","architect","architectonic","architectural","architecture","archival","archive","arcing","arclength","arcsin","arcsine","arctan"
DATA "arctangent","arctic","arcturus","arden","ardency","ardent","arduous","are","area","areaway","areawide","aren't","arena","arenaceous","arequipa","ares","argentina","argillaceous","arginine","argive"
DATA "argo","argon","argonaut","argonne","argot","argue","argument","argumentation","argumentative","argus","arhat","ariadne","arianism","arid","aries","arise","arisen","aristocracy","aristocrat","aristocratic"
DATA "aristotelean","aristotelian","aristotle","arithmetic","arizona","ark","arkansan","arkansas","arlen","arlene","arlington","arm","armada","armadillo","armageddon","armament","armata","armature","armchair","armco"
DATA "armenia","armenian","armful","armhole","armillaria","armistice","armload","armoire","armonk","armour","armpit","armstrong","army","arnold","aroma","aromatic","arose","around","arousal","arouse"
DATA "arpa","arpeggio","arrack","arragon","arraign","arrange","arrangeable","array","arrear","arrest","arrhenius","arrival","arrive","arrogant","arrogate","arrow","arrowhead","arrowroot","arroyo","arsenal"
DATA "arsenate","arsenic","arsenide","arsine","arson","art","artemis","artemisia","arterial","arteriole","arteriolosclerosis","arteriosclerosis","artery","artful","arthritis","arthur","artichoke","article","articulate","articulatory"
DATA "artie","artifact","artifice","artificial","artillery","artisan","artistry","arturo","artwork","arty","aruba","arum","aryl","as","asbestos","ascend","ascendant","ascension","ascent","ascertain"
DATA "ascetic","asceticism","ascomycetes","ascribe","ascription","aseptic","asexual","ash","ashame","ashamed","ashen","asher","asheville","ashland","ashley","ashman","ashmen","ashmolean","ashore","ashtray"
DATA "ashy","asia","asiatic","aside","asilomar","asinine","ask","askance","askew","asleep","asocial","asparagine","asparagus","aspartic","aspect","aspen","asperity","aspersion","asphalt","aspheric"
DATA "asphyxiate","aspidistra","aspirant","aspirate","aspire","aspirin","asplenium","ass","assai","assail","assailant","assam","assassin","assassinate","assault","assay","assemblage","assemble","assent","assert"
DATA "assess","assessor","asset","assiduity","assiduous","assign","assignation","assignee","assimilable","assimilate","assist","assistant","associable","associate","assonant","assort","assuage","assume","assumption","assurance"
DATA "assure","assyria","assyriology","astarte","astatine","aster","asteria","asterisk","asteroid","asteroidal","asthma","astigmat","astigmatic","astigmatism","astm","astonish","astor","astoria","astound","astraddle"
DATA "astral","astray","astride","astringent","astrology","astronaut","astronautic","astronomer","astronomic","astronomy","astrophysical","astrophysicist","astrophysics","astute","asuncion","asunder","asylum","asymmetry","asymptote","asymptotic"
DATA "asynchronous","asynchrony","at","at&t","atalanta","atavism","atavistic","atchison","ate","athabascan","atheism","atheist","athena","athenian","athens","athlete","athletic","athwart","atkins","atkinson"
DATA "atlanta","atlantes","atlantic","atlantica","atlantis","atlas","atmosphere","atmospheric","atom","atomic","atonal","atone","atop","atreus","atrium","atrocious","atrocity","atrophic","atrophy","atropos"
DATA "attach","attache","attack","attain","attainder","attempt","attend","attendant","attendee","attention","attentive","attenuate","attest","attestation","attic","attica","attire","attitude","attitudinal","attorney"
DATA "attract","attribute","attribution","attributive","attrition","attune","atwater","atwood","atypic","auberge","aubrey","auburn","auckland","auction","auctioneer","audacious","audacity","audible","audience","audio"
DATA "audiotape","audiovisual","audit","audition","auditor","auditorium","auditory","audrey","audubon","auerbach","aug","augean","augend","auger","augite","augment","augmentation","augur","august","augusta"
DATA "augustan","augustine","augustus","auk","aunt","auntie","aura","aural","aurelius","aureomycin","auric","auriga","aurochs","aurora","auschwitz","auspices","auspicious","austenite","austere","austin"
DATA "australia","australis","australite","austria","authentic","authenticate","author","authoritarian","authoritative","autism","autistic","auto","autobiography","autoclave","autocollimate","autocorrelate","autocracy","autocrat","autocratic","autograph"
DATA "automat","automata","automate","automatic","automaton","automobile","automorphic","automorphism","automotive","autonomic","autonomous","autonomy","autopsy","autosuggestible","autotransformer","autumn","autumnal","auxiliary","avail","avalanche"
DATA "avarice","avaricious","ave","avenge","aventine","avenue","aver","average","averred","averring","averse","aversion","avert","avertive","avery","avesta","aviary","aviate","aviatrix","avid"
DATA "avionic","avis","aviv","avocado","avocate","avocation","avocet","avogadro","avoid","avoidance","avon","avow","avowal","avuncular","await","awake","awaken","award","aware","awash"
DATA "away","awe","awesome","awful","awhile","awkward","awl","awn","awoke","awry","ax","axe","axes","axial","axiology","axiom","axiomatic","axis","axisymmetric","axle"
DATA "axolotl","axon","aye","ayers","aylesbury","az","azalea","azerbaijan","azimuth","azimuthal","aztec","aztecan","azure","b","b's","babbitt","babble","babcock","babe","babel"
DATA "baboon","baby","babyhood","babylon","babylonian","babysat","babysit","babysitter","babysitting","baccalaureate","baccarat","bacchus","bach","bachelor","bacilli","bacillus","back","backboard","backbone","backdrop"
DATA "backfill","backgammon","background","backhand","backlash","backlog","backorder","backpack","backplane","backplate","backscatter","backside","backspace","backstage","backstitch","backstop","backtrack","backup","backward","backwater"
DATA "backwood","backyard","bacon","bacteria","bacterial","bacterium","bad","bade","baden","badge","badinage","badland","badminton","baffin","baffle","bag","bagatelle","bagel","baggage","bagging"
DATA "baggy","baghdad","bagley","bagpipe","bah","bahama","bahrein","bail","bailey","bailiff","bainite","baird","bait","bake","bakelite","bakersfield","bakery","bakhtiari","baklava","baku"
DATA "balance","balboa","balcony","bald","baldpate","baldwin","baldy","bale","baleen","baleful","balfour","bali","balinese","balk","balkan","balky","ball","ballad","ballard","ballast"
DATA "balled","ballerina","ballet","balletic","balletomane","ballfield","balloon","ballot","ballroom","ballyhoo","balm","balmy","balsa","balsam","baltic","baltimore","baltimorean","balustrade","balzac","bam"
DATA "bamako","bamberger","bambi","bamboo","ban","banach","banal","banana","banbury","band","bandage","bandgap","bandit","bandpass","bandstand","bandstop","bandwagon","bandwidth","bandy","bane"
DATA "baneberry","baneful","bang","bangkok","bangladesh","bangle","bangor","bangui","banish","banister","banjo","bank","bankrupt","bankruptcy","banks","banquet","banshee","bantam","banter","bantu"
DATA "bantus","baptism","baptismal","baptist","baptiste","baptistery","bar","barb","barbados","barbara","barbarian","barbaric","barbarism","barbarous","barbecue","barbell","barber","barberry","barbital","barbiturate"
DATA "barbour","barbudo","barcelona","barclay","bard","bare","barefaced","barefoot","barfly","bargain","barge","baritone","barium","bark","barkeep","barley","barlow","barn","barnabas","barnacle"
DATA "barnard","barnes","barnet","barnett","barney","barnhard","barnstorm","barnyard","barometer","baron","baroness","baronet","baronial","barony","baroque","barr","barrack","barracuda","barrage","barre"
DATA "barrel","barren","barrett","barrette","barricade","barrier","barrington","barrow","barry","barrymore","barstow","bart","bartend","bartender","barter","barth","bartholomew","bartlett","bartok","barton"
DATA "barycentric","basal","basalt","base","baseball","baseband","baseboard","basel","baseline","baseman","basemen","baseplate","basepoint","bash","bashaw","bashful","basic","basidiomycetes","basil","basilar"
DATA "basilisk","basin","basis","bask","basket","basketball","basophilic","bass","bassett","bassi","bassinet","basso","basswood","bastard","baste","bastion","bat","batavia","batch","batchelder"
DATA "bate","bateau","bateman","bater","bates","bath","bathe","bathos","bathrobe","bathroom","bathtub","bathurst","batik","baton","bator","batt","battalion","battelle","batten","battery"
DATA "battle","battlefield","battlefront","battleground","batwing","bauble","baud","baudelaire","bauer","bauhaus","bausch","bauxite","bavaria","bawd","bawdy","bawl","baxter","bay","bayberry","bayda"
DATA "bayed","bayesian","baylor","bayonet","bayonne","bayou","bayport","bayreuth","bazaar","be","beach","beachcomb","beachhead","beacon","bead","beadle","beady","beak","beam","bean"
DATA "bear","bearberry","beard","beardsley","bearish","beast","beastie","beat","beaten","beater","beatific","beatify","beatitude","beatnik","beatrice","beau","beaujolais","beaumont","beauregard","beauteous"
DATA "beautiful","beautify","beauty","beaux","beaver","bebop","becalm","became","because","bechtel","beck","becker","becket","beckman","beckon","becky","becloud","become","bed","bedazzle"
DATA "bedbug","bedevil","bedfast","bedford","bedim","bedimmed","bedimming","bedlam","bedpost","bedraggle","bedridden","bedrock","bedroom","bedside","bedspread","bedspring","bedstraw","bedtime","bee","beebe"
DATA "beebread","beech","beecham","beechwood","beef","beefsteak","beefy","beehive","been","beep","beer","beet","beethoven","beetle","befall","befallen","befell","befit","befitting","befog"
DATA "befogging","before","beforehand","befoul","befuddle","beg","began","beget","begetting","beggar","beggary","begging","begin","beginner","beginning","begonia","begotten","begrudge","beguile","begun"
DATA "behalf","behave","behavioral","behead","beheld","behest","behind","behold","beige","beijing","being","beirut","bel","bela","belate","belch","belfast","belfry","belgian","belgium"
DATA "belgrade","belie","belief","belies","believe","belittle","bell","bella","belladonna","bellamy","bellatrix","bellboy","belle","bellflower","bellhop","bellicose","belligerent","bellingham","bellini","bellman"
DATA "bellmen","bellow","bellum","bellwether","belly","bellyache","bellyfull","belmont","beloit","belong","belove","below","belshazzar","belt","beltsville","belvedere","belvidere","belying","bema","bemadden"
DATA "beman","bemoan","bemuse","ben","bench","benchmark","bend","bender","bendix","beneath","benedict","benedictine","benediction","benedikt","benefactor","benefice","beneficent","beneficial","beneficiary","benefit"
DATA "benelux","benevolent","bengal","bengali","benight","benign","benjamin","bennett","bennington","benny","benson","bent","bentham","benthic","bentley","benton","benz","benzedrine","benzene","beograd"
DATA "beowulf","beplaster","bequeath","bequest","berate","berea","bereave","bereft","berenices","beresford","beret","berg","bergamot","bergen","bergland","berglund","bergman","bergson","bergstrom","beribbon"
DATA "beriberi","berkeley","berkelium","berkowitz","berkshire","berlin","berlioz","berlitz","berman","bermuda","bern","bernadine","bernard","bernardino","bernardo","berne","bernet","bernhard","bernice","bernie"
DATA "berniece","bernini","bernoulli","bernstein","berra","berry","berserk","bert","berth","bertha","bertie","bertram","bertrand","berwick","beryl","beryllium","beseech","beset","besetting","beside"
DATA "besiege","besmirch","besotted","bespeak","bespectacled","bespoke","bess","bessel","bessemer","bessie","best","bestial","bestir","bestirring","bestow","bestowal","bestseller","bestselling","bestubble","bet"
DATA "beta","betatron","betel","betelgeuse","beth","bethel","bethesda","bethlehem","bethought","betide","betoken","betony","betray","betrayal","betrayer","betroth","betrothal","betsey","betsy","bette"
DATA "bettor","betty","between","betwixt","bevel","beverage","beverly","bevy","bewail","beware","bewhisker","bewilder","bewitch","bey","beyond","bezel","bhoy","bhutan","bialystok","bianco"
DATA "bias","biaxial","bib","bibb","bible","biblical","bibliography","bibliophile","bicameral","bicarbonate","bicentennial","bicep","biceps","bichromate","bicker","biconcave","biconnected","bicycle","bid","biddable"
DATA "bidden","biddy","bide","bidiagonal","bidirectional","bien","biennial","biennium","bifocal","bifurcate","big","bigelow","biggs","bigot","bigotry","biharmonic","bijection","bijective","bijouterie","bike"
DATA "bikini","bilabial","bilateral","bilayer","bile","bilge","bilharziasis","bilinear","bilingual","bilk","bill","billboard","billet","billfold","billiard","billie","billiken","billings","billion","billionth"
DATA "billow","billy","biltmore","bimetallic","bimetallism","bimini","bimodal","bimolecular","bimonthly","bin","binary","binaural","bind","bindery","bindle","bindweed","bing","binge","bingham","binghamton"
DATA "bingle","bini","binocular","binomial","binuclear","biochemic","biography","biology","biometrika","biometry","biopsy","biota","biotic","biotite","bipartisan","bipartite","biplane","bipolar","biracial","birch"
DATA "bird","birdbath","birdie","birdlike","birdseed","birdwatch","birefringent","birgit","birmingham","birth","birthday","birthplace","birthright","biscuit","bisect","bisexual","bishop","bishopric","bismarck","bismark"
DATA "bismuth","bison","bisque","bissau","bistable","bistate","bit","bitch","bite","bitnet","bitt","bitten","bittern","bitternut","bitterroot","bittersweet","bitumen","bituminous","bitwise","bivalve"
DATA "bivariate","bivouac","biz","bizarre","bizet","blab","black","blackball","blackberry","blackbird","blackboard","blackbody","blackburn","blacken","blackfeet","blackjack","blackmail","blackman","blackout","blacksmith"
DATA "blackstone","blackwell","bladder","bladdernut","bladderwort","blade","blaine","blair","blake","blame","blameworthy","blanc","blanch","blanchard","blanche","bland","blandish","blank","blanket","blare"
DATA "blaspheme","blasphemous","blasphemy","blast","blastula","blat","blatant","blather","blatz","blaze","blazon","bleach","bleak","bleary","bleat","bled","bleed","bleeker","blemish","blend"
DATA "blenheim","bless","blest","blew","blight","blimp","blind","blindfold","blink","blinn","blip","bliss","blissful","blister","blithe","blitz","blizzard","bloat","blob","bloc"
DATA "bloch","block","blockade","blockage","blockhouse","blocky","bloke","blomberg","blomquist","blond","blonde","blood","bloodbath","bloodhound","bloodline","bloodroot","bloodshed","bloodshot","bloodstain","bloodstone"
DATA "bloodstream","bloody","bloom","bloomfield","bloomington","bloop","blossom","blot","blotch","blouse","blow","blowback","blowfish","blown","blowup","blubber","bludgeon","blue","blueback","blueberry"
DATA "bluebill","bluebird","bluebonnet","bluebook","bluebush","bluefish","bluegill","bluegrass","bluejacket","blueprint","bluestocking","bluet","bluff","bluish","blum","blumenthal","blunder","blunt","blur","blurb"
DATA "blurry","blurt","blush","bluster","blustery","blutwurst","blvd","blythe","bmw","boa","boar","board","boardinghouse","boast","boastful","boat","boathouse","boatload","boatman","boatmen"
DATA "boatswain","boatyard","bob","bobbie","bobbin","bobble","bobby","bobcat","bobolink","boca","bock","bocklogged","bode","bodhisattva","bodice","bodied","bodleian","body","bodybuild","bodybuilder"
DATA "bodybuilding","bodyguard","boeing","boeotia","boeotian","bog","bogey","bogeymen","bogging","boggle","boggy","bogota","bogus","bogy","bohemia","bohr","boil","bois","boise","boisterous"
DATA "bold","boldface","bole","boletus","bolivar","bolivia","bolo","bologna","bolometer","bolshevik","bolshevism","bolshevist","bolshoi","bolster","bolt","bolton","boltzmann","bomb","bombard","bombast"
DATA "bombastic","bombay","bombproof","bon","bona","bonanza","bonaparte","bonaventure","bond","bondage","bondholder","bondsman","bondsmen","bone","bonfire","bong","bongo","boniface","bonito","bonn"
DATA "bonnet","bonneville","bonnie","bonus","bony","bonze","boo","booby","boogie","book","bookbind","bookcase","bookend","bookie","bookish","bookkeep","booklet","bookmobile","bookplate","bookseller"
DATA "bookshelf","bookshelves","bookstore","booky","boolean","boom","boomerang","boon","boone","boor","boorish","boost","boot","bootes","booth","bootleg","bootlegged","bootlegger","bootlegging","bootstrap"
DATA "bootstrapped","bootstrapping","booty","booze","bop","borate","borax","bordeaux","bordello","borden","border","borderland","borderline","bore","borealis","boreas","boredom","borg","boric","boris"
DATA "born","borne","borneo","boron","borosilicate","borough","borroughs","borrow","bosch","bose","bosom","boson","bosonic","boss","boston","bostonian","boswell","botanic","botanist","botany"
DATA "botch","botfly","both","bothersome","botswana","bottle","bottleneck","bottom","bottommost","botulin","botulism","boucher","bouffant","bough","bought","boulder","boule","boulevard","bounce","bouncy"
DATA "bound","boundary","bounty","bouquet","bourbaki","bourbon","bourgeois","bourgeoisie","bourn","boustrophedon","bout","boutique","bovine","bow","bowditch","bowdoin","bowel","bowen","bowfin","bowie"
DATA "bowl","bowline","bowman","bowmen","bowstring","box","boxcar","boxwood","boxy","boy","boyar","boyce","boycott","boyd","boyfriend","boyhood","boyish","boyle","boylston","bp"
DATA "brace","bracelet","bracken","bracket","brackish","bract","brad","bradbury","bradford","bradley","bradshaw","brady","brae","brag","bragg","braggart","bragging","brahmaputra","brahms","brahmsian"
DATA "braid","braille","brain","brainard","brainchild","brainchildren","brainstorm","brainwash","brainy","brake","brakeman","bramble","bran","branch","brand","brandeis","brandenburg","brandish","brandon","brandt"
DATA "brandy","brandywine","braniff","brant","brash","brasilia","brass","brassiere","brassy","bratwurst","braun","bravado","brave","bravery","bravo","bravura","brawl","bray","brazen","brazier"
DATA "brazil","brazilian","brazzaville","breach","bread","breadboard","breadfruit","breadroot","breadth","breadwinner","break","breakage","breakaway","breakdown","breakfast","breakoff","breakpoint","breakthrough","breakup","breakwater"
DATA "bream","breast","breastplate","breastwork","breath","breathe","breathtaking","breathy","breccia","bred","breech","breeches","breed","breeze","breezy","bremen","bremsstrahlung","brenda","brendan","brennan"
DATA "brenner","brent","brest","brethren","breton","brett","breve","brevet","brevity","brew","brewery","brewster","brian","briar","bribe","bribery","brice","brick","brickbat","bricklay"
DATA "bricklayer","bricklaying","bridal","bride","bridegroom","bridesmaid","bridge","bridgeable","bridgehead","bridgeport","bridget","bridgetown","bridgewater","bridgework","bridle","brief","briefcase","brig","brigade","brigadier"
DATA "brigantine","briggs","brigham","bright","brighten","brighton","brilliant","brillouin","brim","brimful","brimstone","brindisi","brindle","brine","bring","brink","brinkmanship","briny","brisbane","brisk"
DATA "bristle","bristol","britain","britannic","britannica","britches","british","briton","brittany","britten","brittle","broach","broad","broadcast","broaden","broadloom","broadside","broadway","brocade","broccoli"
DATA "brochure","brock","brockle","broglie","broil","broke","broken","brokerage","bromfield","bromide","bromine","bromley","bronchi","bronchial","bronchiolar","bronchiole","bronchitis","bronchus","bronco","brontosaurus"
DATA "bronx","bronze","bronzy","brood","broody","brook","brooke","brookhaven","brookline","brooklyn","brookside","broom","broomcorn","broth","brothel","brother","brotherhood","brought","brouhaha","brow"
DATA "browbeaten","brown","browne","brownell","brownian","brownie","brownish","browse","bruce","brucellosis","bruckner","bruegel","bruise","bruit","brumidi","brunch","brunette","brunhilde","bruno","brunswick"
DATA "brunt","brush","brushfire","brushlike","brushwork","brushy","brusque","brussels","brutal","brute","bryan","bryant","bryce","bryn","bryophyta","bryophyte","bryozoa","bstj","btl","btu"
DATA "bub","bubble","buchanan","bucharest","buchenwald","buchwald","buck","buckaroo","buckboard","bucket","bucketfull","buckeye","buckhorn","buckle","buckley","bucknell","buckshot","buckskin","buckthorn","buckwheat"
DATA "bucolic","bud","budapest","budd","buddha","buddhism","buddhist","buddy","budge","budget","budgetary","budweiser","buena","buenos","buff","buffalo","buffet","bufflehead","buffoon","bug"
DATA "bugaboo","bugeyed","bugging","buggy","bugle","buick","build","buildup","built","builtin","bujumbura","bulb","bulblet","bulgaria","bulge","bulk","bulkhead","bulky","bull","bulldog"
DATA "bulldoze","bullet","bulletin","bullfinch","bullfrog","bullhead","bullhide","bullish","bullock","bullseye","bullwhack","bully","bullyboy","bulrush","bulwark","bum","bumble","bumblebee","bump","bumptious"
DATA "bun","bunch","bundestag","bundle","bundoora","bundy","bungalow","bungle","bunk","bunkmate","bunny","bunsen","bunt","bunyan","buoy","buoyant","burbank","burch","burden","burdensome"
DATA "burdock","bureau","bureaucracy","bureaucrat","bureaucratic","buret","burette","burg","burgeon","burgess","burgher","burglar","burglarproof","burglary","burgundian","burgundy","burial","buried","burke","burl"
DATA "burlap","burlesque","burley","burlington","burly","burma","burmese","burn","burnett","burnham","burnish","burnout","burnside","burnt","burp","burr","burro","burroughs","burrow","bursitis"
DATA "burst","bursty","burt","burton","burtt","burundi","bury","bus","busboy","busch","buses","bush","bushel","bushmaster","bushnell","bushwhack","bushy","business","businessman","businessmen"
DATA "buss","bust","bustard","bustle","busy","but","butadiene","butane","butch","butchery","butene","buteo","butler","butt","butte","butterball","buttercup","butterfat","butterfield","butterfly"
DATA "buttermilk","butternut","buttery","buttock","button","buttonhole","buttonweed","buttress","buttrick","butyl","butyrate","butyric","buxom","buxtehude","buxton","buy","buyer","buzz","buzzard","buzzer"
DATA "buzzing","buzzsaw","buzzword","buzzy","by","bye","byers","bygone","bylaw","byline","bypass","bypath","byproduct","byrd","byrne","byroad","byron","byronic","bystander","byte"
DATA "byway","byword","byzantine","byzantium","c","c's","ca","cab","cabal","cabana","cabaret","cabbage","cabdriver","cabin","cabinet","cabinetmake","cabinetry","cable","cabot","cacao"
DATA "cachalot","cache","cackle","cacm","cacophonist","cacophony","cacti","cactus","cadaver","cadaverous","caddis","caddy","cadent","cadenza","cadet","cadillac","cadmium","cadre","cady","caesar"
DATA "cafe","cafeteria","cage","cagey","cahill","cahoot","caiman","cain","caine","cairn","cairo","cajole","cake","cal","calais","calamitous","calamity","calamus","calcareous","calcify"
DATA "calcine","calcite","calcium","calculable","calculate","calculi","calculus","calcutta","calder","caldera","caldwell","caleb","calendar","calendrical","calf","calfskin","calgary","calhoun","caliber","calibrate"
DATA "calibre","calico","california","californium","caliper","caliph","caliphate","calisthenic","calkins","call","calla","callaghan","callahan","caller","calligraph","calligraphy","calliope","callisto","callous","callus"
DATA "calm","caloric","calorie","calorimeter","calumet","calumniate","calumny","calvary","calve","calvert","calvin","calvinist","calypso","cam","camaraderie","camber","cambodia","cambrian","cambric","cambridge"
DATA "camden","came","camel","camelback","camellia","camelopard","camelot","cameo","camera","cameraman","cameramen","cameron","cameroun","camilla","camille","camino","camouflage","camp","campaign","campanile"
DATA "campbell","campfire","campground","campion","campsite","campus","can","can't","canaan","canada","canadian","canal","canary","canaveral","canberra","cancel","cancellate","cancelled","cancelling","cancer"
DATA "cancerous","candace","candela","candelabra","candid","candidacy","candidate","candide","candle","candlelight","candlelit","candlestick","candlewick","candy","cane","canfield","canine","canis","canister","canker"
DATA "cankerworm","canna","cannabis","cannel","cannery","cannibal","cannister","cannon","cannonball","cannot","canny","canoe","canoga","canon","canonic","canopy","canst","cant","cantabrigian","cantaloupe"
DATA "canteen","canterbury","canterelle","canticle","cantilever","cantle","canto","canton","cantonese","cantor","canvas","canvasback","canvass","canyon","cap","capacious","capacitance","capacitate","capacitive","capacitor"
DATA "capacity","cape","capella","caper","capetown","capillary","capistrano","capita","capital","capitol","capitoline","capitulate","capo","caprice","capricious","capricorn","capsize","capstan","capstone","capsule"
DATA "captain","captaincy","caption","captious","captivate","captive","captor","capture","caputo","capybara","car","carabao","caracas","caramel","caravan","caraway","carbide","carbine","carbohydrate","carboloy"
DATA "carbon","carbonaceous","carbonate","carbondale","carbone","carbonic","carbonium","carbonyl","carborundum","carboxy","carboxylic","carboy","carbuncle","carburetor","carcass","carcinogen","carcinogenic","carcinoma","card","cardamom"
DATA "cardboard","cardiac","cardiff","cardinal","cardiod","cardioid","cardiology","cardiovascular","care","careen","career","carefree","careful","caress","caret","caretaker","careworn","carey","carfare","cargill"
DATA "cargo","cargoes","carib","caribbean","caribou","caricature","carl","carla","carleton","carlin","carlisle","carlo","carload","carlson","carlton","carlyle","carmela","carmen","carmichael","carmine"
DATA "carnage","carnal","carnation","carne","carnegie","carney","carnival","carob","carol","carolina","caroline","carolingian","carolinian","carolyn","carouse","carp","carpathia","carpenter","carpentry","carpet"
DATA "carport","carr","carrageen","carrara","carrel","carriage","carrie","carrion","carroll","carrot","carruthers","carry","carryover","carson","cart","carte","cartel","cartesian","carthage","carthaginian"
DATA "cartilage","cartilaginous","cartographer","cartographic","cartography","carton","cartoon","cartridge","cartwheel","caruso","carve","carven","caryatid","casanova","casbah","cascade","cascara","case","casebook","casein"
DATA "casework","casey","cash","cashew","cashier","cashmere","casino","cask","casket","caspian","cassandra","casserole","cassette","cassiopeia","cassius","cassock","cast","castanet","caste","casteth"
DATA "castigate","castillo","castle","castor","castro","casual","casualty","cat","catabolic","cataclysm","cataclysmic","catalina","catalogue","catalpa","catalysis","catalyst","catalytic","catapult","cataract","catastrophe"
DATA "catastrophic","catatonia","catatonic","catawba","catbird","catcall","catch","catchup","catchword","catchy","catechism","categoric","category","catenate","cater","caterpillar","catfish","catharsis","cathedra","cathedral"
DATA "catherine","catherwood","catheter","cathode","cathodic","catholic","catholicism","cathy","cation","cationic","catkin","catlike","catnip","catskill","catsup","cattail","cattle","cattleman","cattlemen","catv"
DATA "caucasian","caucasus","cauchy","caucus","caught","cauldron","cauliflower","caulk","causal","causate","causation","cause","caustic","caution","cautionary","cautious","cavalcade","cavalier","cavalry","cave"
DATA "caveat","caveman","cavemen","cavendish","cavern","cavernous","caviar","cavil","cavilling","caviness","cavitate","cavort","caw","cayenne","cayley","cayuga","cb","cbs","ccny","cdc"
DATA "cease","cecil","cecilia","cecropia","cedar","cede","cedilla","cedric","ceil","celandine","celanese","celebes","celebrant","celebrate","celebrity","celerity","celery","celesta","celeste","celestial"
DATA "celia","celibacy","cell","cellar","cellophane","cellular","celluloid","cellulose","celsius","celtic","cement","cemetery","cenozoic","censor","censorial","censorious","censure","census","cent","centaur"
DATA "centenary","centennial","centerline","centerpiece","centigrade","centimeter","centipede","central","centrex","centric","centrifugal","centrifugate","centrifuge","centrist","centroid","centum","century","cepheus","ceq","ceramic"
DATA "ceramium","cerberus","cereal","cerebellum","cerebral","cerebrate","ceremonial","ceremonious","ceremony","ceres","cereus","cerise","cerium","cern","certain","certainty","certificate","certified","certify","certiorari"
DATA "certitude","cerulean","cervantes","cervix","cesare","cesium","cessation","cession","cessna","cetera","cetus","ceylon","cezanne","cf","chablis","chad","chadwick","chafe","chaff","chagrin"
DATA "chain","chair","chairlady","chairman","chairmen","chairperson","chairwoman","chairwomen","chaise","chalcedony","chalcocite","chalet","chalice","chalk","chalkboard","chalkline","chalky","challenge","chalmers","chamber"
DATA "chamberlain","chambermaid","chambers","chameleon","chamfer","chamois","chamomile","champ","champagne","champaign","champion","champlain","chance","chancel","chancellor","chancery","chancy","chandelier","chandler","chang"
DATA "change","changeable","changeover","channel","chanson","chant","chantey","chantilly","chantry","chao","chaos","chaotic","chap","chaparral","chapel","chaperon","chaperone","chaplain","chaplaincy","chaplin"
DATA "chapman","chapter","char","character","characteristic","charcoal","chard","charge","chargeable","chariot","charisma","charismatic","charitable","charity","charlemagne","charles","charleston","charley","charlie","charlotte"
DATA "charlottesville","charm","charon","chart","charta","chartres","chartreuse","chartroom","charybdis","chase","chasm","chassis","chaste","chastise","chastity","chat","chateau","chateaux","chatham","chattanooga"
DATA "chattel","chatty","chaucer","chauffeur","chauncey","chautauqua","chaw","cheap","cheat","cheater","check","checkbook","checkerberry","checkerboard","checklist","checkmate","checkout","checkpoint","checksum","checksummed"
DATA "checksumming","checkup","cheek","cheekbone","cheeky","cheer","cheerful","cheerlead","cheerleader","cheery","cheese","cheesecake","cheesecloth","cheesy","cheetah","chef","chelate","chemic","chemise","chemisorb"
DATA "chemisorption","chemist","chemistry","chemotherapy","chen","cheney","chenille","cherish","cherokee","cherry","chert","cherub","cherubim","cheryl","chesapeake","cheshire","chess","chest","chester","chesterton"
DATA "chestnut","chevalier","chevrolet","chevron","chevy","chew","cheyenne","chi","chiang","chianti","chic","chicago","chicagoan","chicanery","chicano","chick","chickadee","chicken","chickweed","chicory"
DATA "chide","chief","chiefdom","chieftain","chiffon","chigger","chignon","chilblain","child","childbear","childbirth","childhood","childish","childlike","children","chile","chilean","chili","chill","chilly"
DATA "chime","chimera","chimeric","chimique","chimney","chimpanzee","chin","china","chinaman","chinamen","chinatown","chinch","chinchilla","chine","chinese","chink","chinook","chinquapin","chip","chipboard"
DATA "chipmunk","chippendale","chiropractor","chirp","chisel","chisholm","chit","chiton","chivalrous","chivalry","chive","chlorate","chlordane","chloride","chlorinate","chlorine","chloroform","chlorophyll","chloroplast","chloroplatinate"
DATA "chock","chocolate","choctaw","choice","choir","choirmaster","choke","chokeberry","cholera","cholesterol","cholinesterase","chomp","chomsky","choose","choosy","chop","chopin","choppy","choral","chorale"
DATA "chord","chordal","chordata","chordate","chore","choreograph","choreography","chorine","chortle","chorus","chose","chosen","chou","chow","chowder","chris","christ","christen","christendom","christensen"
DATA "christenson","christian","christiana","christianson","christie","christina","christine","christlike","christmas","christoffel","christoph","christopher","christy","chromate","chromatic","chromatin","chromatogram","chromatograph","chromatography","chrome"
DATA "chromic","chromium","chromosome","chromosphere","chronic","chronicle","chronograph","chronography","chronology","chrysanthemum","chrysler","chrysolite","chub","chubby","chuck","chuckle","chuckwalla","chuff","chug","chugging"
DATA "chum","chummy","chump","chungking","chunk","chunky","church","churchgo","churchgoer","churchgoing","churchill","churchillian","churchman","churchmen","churchwoman","churchwomen","churchyard","churn","chute","chutney"
DATA "cia","cicada","cicero","ciceronian","cider","cigar","cigarette","cilia","ciliate","cinch","cincinnati","cinder","cinderella","cindy","cinema","cinematic","cinerama","cinnabar","cinnamon","cinquefoil"
DATA "cipher","circa","circe","circle","circlet","circuit","circuitous","circuitry","circulant","circular","circulate","circulatory","circumcircle","circumcise","circumcision","circumference","circumferential","circumflex","circumlocution","circumpolar"
DATA "circumscribe","circumscription","circumspect","circumsphere","circumstance","circumstantial","circumvent","circumvention","circus","cistern","cit","citadel","citation","cite","citizen","citizenry","citrate","citric","citroen","citron"
DATA "citrus","city","cityscape","citywide","civet","civic","civil","civilian","clad","cladophora","claim","claimant","claire","clairvoyant","clam","clamber","clammy","clamorous","clamp","clamshell"
DATA "clan","clandestine","clang","clank","clannish","clap","clapboard","clapeyron","clara","clare","claremont","clarence","clarendon","claret","clarify","clarinet","clarity","clark","clarke","clash"
DATA "clasp","class","classic","classification","classificatory","classify","classmate","classroom","classy","clatter","clattery","claude","claudia","claudio","claus","clause","clausen","clausius","claustrophobia","claustrophobic"
DATA "claw","clay","clayton","clean","cleanse","cleanup","clear","clearance","clearheaded","clearwater","cleat","cleavage","cleave","cleft","clement","clemson","clench","clergy","clergyman","clergymen"
DATA "cleric","clerk","cleveland","clever","cliche","click","client","clientele","cliff","cliffhang","clifford","clifton","climactic","climate","climatic","climatology","climax","climb","clime","clinch"
DATA "cling","clinging","clinic","clinician","clink","clint","clinton","clio","clip","clipboard","clique","clitoris","clive","cloak","cloakroom","clobber","clock","clockwatcher","clockwise","clockwork"
DATA "clod","cloddish","clog","clogging","cloister","clomp","clone","clonic","close","closet","closeup","closure","clot","cloth","clothbound","clothe","clothesbrush","clotheshorse","clothesline","clothesman"
DATA "clothesmen","clothier","clotho","cloture","cloud","cloudburst","cloudy","clout","clove","cloven","clown","cloy","club","clubhouse","clubroom","cluck","clue","cluj","clump","clumsy"
DATA "clung","cluster","clutch","clutter","clyde","clytemnestra","co","coach","coachman","coachmen","coachwork","coadjutor","coagulable","coagulate","coal","coalesce","coalescent","coalition","coarse","coarsen"
DATA "coast","coastal","coastline","coat","coates","coattail","coauthor","coax","coaxial","cobalt","cobb","cobble","cobblestone","cobol","cobra","cobweb","coca","cocaine","coccidiosis","cochineal"
DATA "cochlea","cochran","cochrane","cock","cockatoo","cockcrow","cockeye","cockle","cocklebur","cockleshell","cockpit","cockroach","cocksure","cocktail","cocky","coco","cocoa","coconut","cocoon","cod"
DATA "coda","coddington","coddle","code","codebreak","codeposit","codetermine","codeword","codfish","codicil","codify","codomain","codon","codpiece","cody","coed","coeditor","coeducation","coefficient","coequal"
DATA "coerce","coercible","coercion","coercive","coexist","coexistent","coextensive","cofactor","coffee","coffeecup","coffeepot","coffer","coffey","coffin","coffman","cog","cogent","cogitate","cognac","cognate"
DATA "cognition","cognitive","cognizable","cognizant","cohen","cohere","coherent","cohesion","cohesive","cohn","cohomology","cohort","cohosh","coiffure","coil","coin","coinage","coincide","coincident","coincidental"
DATA "coke","col","cola","colander","colatitude","colby","cold","cole","coleman","coleridge","colette","coleus","colgate","colicky","coliform","coliseum","collaborate","collage","collagen","collapse"
DATA "collapsible","collar","collarbone","collard","collate","collateral","colleague","collect","collectible","collector","college","collegial","collegian","collegiate","collet","collide","collie","collier","collimate","collinear"
DATA "collins","collision","collocation","colloidal","colloq","colloquia","colloquial","colloquium","colloquy","collude","collusion","cologne","colombia","colombo","colon","colonel","colonial","colonist","colonnade","colony"
DATA "colorado","colorate","coloratura","colorimeter","colossal","colosseum","colossi","colossus","colt","coltish","coltsfoot","columbia","columbine","columbus","column","columnar","colza","coma","comanche","comatose"
DATA "comb","combat","combatant","combatted","combinate","combination","combinator","combinatorial","combinatoric","combine","combustible","combustion","come","comeback","comedian","comedy","comet","cometary","cometh","comfort"
DATA "comic","cominform","comma","command","commandant","commandeer","commando","commemorate","commend","commendation","commendatory","commensurable","commensurate","comment","commentary","commentator","commerce","commercial","commingle","commiserate"
DATA "commissariat","commissary","commission","commit","committable","committal","committed","committee","committeeman","committeemen","committeewoman","committeewomen","committing","commodious","commodity","commodore","common","commonality","commonplace","commonweal"
DATA "commonwealth","commotion","communal","commune","communicable","communicant","communicate","communion","communique","commutate","commute","compact","compacter","compactify","compagnie","companion","companionway","company","comparative","comparator"
DATA "compare","comparison","compartment","compass","compassion","compassionate","compatible","compatriot","compel","compellable","compelled","compelling","compendia","compendium","compensable","compensate","compensatory","compete","competent","competition"
DATA "competitive","competitor","compilation","compile","complacent","complain","complainant","complaint","complaisant","compleat","complement","complementarity","complementary","complementation","complete","completion","complex","complexion","compliant","complicate"
DATA "complicity","compliment","complimentary","compline","comply","component","componentry","comport","compose","composite","composition","compositor","compost","composure","compote","compound","comprehend","comprehensible","comprehension","comprehensive"
DATA "compress","compressible","compression","compressive","compressor","comprise","compromise","compton","comptroller","compulsion","compulsive","compulsory","compunction","computation","compute","comrade","con","conakry","conant","concatenate"
DATA "concave","conceal","concede","conceit","conceive","concentrate","concentric","concept","conception","conceptual","concern","concert","concerti","concertina","concertmaster","concerto","concession","concessionaire","conch","concierge"
DATA "conciliate","conciliatory","concise","concision","conclave","conclude","conclusion","conclusive","concoct","concocter","concomitant","concord","concordant","concourse","concrete","concretion","concubine","concur","concurred","concurrent"
DATA "concurring","concussion","condemn","condemnate","condemnatory","condensate","condense","condensible","condescend","condescension","condiment","condition","condolence","condominium","condone","conduce","conducive","conduct","conductance","conductor"
DATA "conduit","cone","coneflower","conestoga","coney","confabulate","confect","confectionery","confederacy","confederate","confer","conferee","conference","conferrable","conferred","conferring","confess","confession","confessor","confidant"
DATA "confidante","confide","confident","confidential","configuration","configure","confine","confirm","confirmation","confirmatory","confiscable","confiscate","confiscatory","conflagrate","conflagration","conflict","confluent","confocal","conform","conformal"
DATA "conformance","conformation","confound","confrere","confront","confrontation","confucian","confucianism","confucius","confuse","confusion","confute","congeal","congener","congenial","congenital","congest","congestion","congestive","conglomerate"
DATA "congo","congolese","congratulate","congratulatory","congregate","congress","congressional","congressman","congressmen","congresswoman","congresswomen","congruent","conic","conifer","coniferous","conjectural","conjecture","conjoin","conjoint","conjugacy"
DATA "conjugal","conjugate","conjunct","conjuncture","conjure","conklin","conley","conn","connally","connect","connecticut","connector","conner","connie","connivance","connive","connoisseur","connors","connotation","connotative"
DATA "connote","connubial","conquer","conqueror","conquest","conquistador","conrad","conrail","consanguine","consanguineous","conscience","conscientious","conscionable","conscious","conscript","conscription","consecrate","consecutive","consensus","consent"
DATA "consequent","consequential","conservation","conservatism","conservative","conservator","conservatory","conserve","consider","considerate","consign","consignee","consignor","consist","consistent","consolation","console","consolidate","consonant","consonantal"
DATA "consort","consortium","conspicuous","conspiracy","conspirator","conspiratorial","conspire","constance","constant","constantine","constantinople","constellate","consternate","constipate","constituent","constitute","constitution","constitutive","constrain","constraint"
DATA "constrict","constrictor","construct","constructible","constructor","construe","consul","consular","consulate","consult","consultant","consultation","consultative","consume","consummate","consumption","consumptive","contact","contagion","contagious"
DATA "contain","contaminant","contaminate","contemplate","contemporaneous","contemporary","contempt","contemptible","contemptuous","contend","content","contention","contentious","contest","contestant","context","contextual","contiguity","contiguous","continent"
DATA "continental","contingent","continua","continual","continuant","continuation","continue","continued","continuity","continuo","continuous","continuum","contort","contour","contraband","contrabass","contraception","contraceptive","contract","contractor"
DATA "contractual","contradict","contradictory","contradistinct","contradistinction","contradistinguish","contralateral","contralto","contraption","contrariety","contrariwise","contrary","contrast","contravariant","contravene","contravention","contretemps","contribute","contribution","contributor"
DATA "contributory","contrite","contrition","contrivance","contrive","control","controllable","controlled","controller","controlling","controversial","controversy","controvertible","contumacy","contusion","conundrum","convair","convalesce","convalescent","convect"
DATA "convene","convenient","convent","convention","converge","convergent","conversant","conversation","converse","conversion","convert","convertible","convex","convey","conveyance","conveyor","convict","convince","convivial","convocate"
DATA "convocation","convoke","convolute","convolution","convolve","convoy","convulse","convulsion","convulsive","conway","cony","coo","cook","cookbook","cooke","cookery","cookie","cooky","cool","coolant"
DATA "cooley","coolheaded","coolidge","coon","coop","cooperate","coordinate","coors","coot","cop","cope","copeland","copenhagen","copernican","copernicus","copious","coplanar","copolymer","copperas","copperfield"
DATA "copperhead","coppery","copra","coprinus","coproduct","copter","copy","copybook","copyright","copywriter","coquette","coquina","coral","coralberry","coralline","corbel","corbett","corcoran","cord","cordage"
DATA "cordial","cordite","cordon","corduroy","core","corey","coriander","corinth","corinthian","coriolanus","cork","corkscrew","cormorant","corn","cornbread","cornea","cornelia","cornelius","cornell","cornerstone"
DATA "cornet","cornfield","cornflower","cornish","cornmeal","cornstarch","cornucopia","cornwall","corny","corollary","corona","coronado","coronary","coronate","coroner","coronet","coroutine","corp","corpora","corporal"
DATA "corporate","corporeal","corps","corpse","corpsman","corpsmen","corpulent","corpus","corpuscular","corral","corralled","correct","corrector","correlate","correspond","correspondent","corridor","corrigenda","corrigendum","corrigible"
DATA "corroborate","corroboree","corrode","corrodible","corrosion","corrosive","corrugate","corrupt","corruptible","corruption","corsage","corset","cortege","cortex","cortical","cortland","corundum","coruscate","corvallis","corvette"
DATA "corvus","cos","cosec","coset","cosgrove","cosh","cosine","cosmetic","cosmic","cosmology","cosmopolitan","cosmos","cosponsor","cossack","cost","costa","costello","costume","cosy","cot"
DATA "cotangent","cotillion","cotman","cotoneaster","cotta","cottage","cotton","cottonmouth","cottonseed","cottonwood","cottony","cottrell","cotty","cotyledon","couch","cougar","cough","could","couldn't","coulomb"
DATA "coulter","council","councilman","councilmen","councilwoman","councilwomen","counsel","counselor","count","countdown","countenance","counteract","counterargument","counterattack","counterbalance","counterclockwise","counterexample","counterfeit","counterflow","counterintuitive"
DATA "counterman","countermen","counterpart","counterpoint","counterpoise","counterproductive","counterproposal","countersink","countersunk","countervail","countrify","country","countryman","countrymen","countryside","countrywide","county","countywide","coup","coupe"
DATA "couple","coupon","courage","courageous","courier","course","court","courteous","courtesan","courtesy","courthouse","courtier","courtney","courtroom","courtyard","couscous","cousin","couturier","covalent","covariant"
DATA "covariate","covary","cove","coven","covenant","coventry","cover","coverage","coverall","coverlet","covert","covet","covetous","cow","cowan","coward","cowardice","cowbell","cowbird","cowboy"
DATA "cowgirl","cowhand","cowherd","cowhide","cowl","cowlick","cowman","cowmen","coworker","cowpea","cowpoke","cowpony","cowpox","cowpunch","cowry","cowslip","cox","coxcomb","coy","coyote"
DATA "coypu","cozen","cozy","cpa","cpu","crab","crabapple","crabmeat","crack","crackle","crackpot","cradle","craft","craftsman","craftsmen","craftspeople","craftsperson","crafty","crag","craggy"
DATA "craig","cram","cramer","cramp","cranberry","crandall","crane","cranelike","cranford","crania","cranium","crank","crankcase","crankshaft","cranky","cranny","cranston","crap","crappie","crash"
DATA "crass","crate","crater","cravat","crave","craven","craw","crawford","crawl","crawlspace","crayfish","crayon","craze","crazy","creak","creaky","cream","creamery","creamy","crease"
DATA "create","creating","creature","creche","credent","credential","credenza","credible","credit","creditor","credo","credulity","credulous","creed","creedal","creek","creekside","creep","creepy","cremate"
DATA "crematory","creole","creon","creosote","crepe","crept","crescendo","crescent","cress","crest","crestfallen","crestview","cretaceous","cretan","crete","cretin","cretinous","crevice","crew","crewcut"
DATA "crewel","crewman","crewmen","crib","cricket","cried","crime","crimea","criminal","crimp","crimson","cringe","crinkle","cripple","crises","crisis","crisp","crispin","criss","crisscross"
DATA "criteria","criterion","critic","critique","critter","croak","croatia","crochet","crock","crockery","crockett","crocodile","crocodilian","crocus","croft","croix","cromwell","cromwellian","crone","crony"
DATA "crook","croon","crop","croquet","crosby","cross","crossarm","crossbar","crossbill","crossbow","crosscut","crosshatch","crosslink","crossover","crosspoint","crossroad","crosstalk","crosswalk","crossway","crosswise"
DATA "crossword","crosswort","crotch","crotchety","crouch","croupier","crow","crowbait","crowberry","crowd","crowfoot","crowley","crown","croydon","crt","crucial","crucible","crucifix","crucifixion","crucify"
DATA "crud","cruddy","crude","cruel","cruelty","cruickshank","cruise","crumb","crumble","crummy","crump","crumple","crunch","crupper","crusade","crush","crusoe","crust","crusty","crutch"
DATA "crux","cruz","cry","cryogenic","cryostat","crypt","cryptanalysis","cryptanalyst","cryptanalytic","cryptanalyze","cryptic","cryptogram","cryptographer","cryptography","cryptology","crystal","crystalline","crystallite","crystallographer","crystallography"
DATA "csnet","ct","cub","cuba","cubbyhole","cube","cubic","cuckoo","cucumber","cud","cuddle","cuddly","cudgel","cue","cuff","cufflink","cuisine","culbertson","culinary","cull"
DATA "culminate","culpa","culpable","culprit","cult","cultivable","cultivate","cultural","culture","culver","culvert","cumberland","cumbersome","cumin","cummings","cummins","cumulate","cumulus","cunard","cunning"
DATA "cunningham","cuny","cup","cupboard","cupful","cupid","cupidity","cupric","cuprous","cur","curate","curb","curbside","curd","curdle","cure","curfew","curia","curie","curio"
DATA "curiosity","curious","curium","curl","curlew","curlicue","curran","currant","current","curricula","curricular","curriculum","curry","curse","cursive","cursor","cursory","curt","curtail","curtain"
DATA "curtis","curtsey","curvaceous","curvature","curve","curvilinear","cushing","cushion","cushman","cusp","custer","custodial","custodian","custody","custom","customary","customhouse","cut","cutaneous","cutback"
DATA "cute","cutesy","cutlass","cutler","cutlet","cutoff","cutout","cutover","cutset","cutthroat","cuttlebone","cuttlefish","cutworm","cyanamid","cyanate","cyanic","cyanide","cybernetic","cybernetics","cycad"
DATA "cyclades","cycle","cyclic","cyclist","cyclone","cyclopean","cyclops","cyclorama","cyclotomic","cyclotron","cygnus","cylinder","cylindric","cynic","cynthia","cypress","cyprian","cypriot","cyprus","cyril"
DATA "cyrillic","cyrus","cyst","cysteine","cytochemistry","cytology","cytolysis","cytoplasm","cytosine","cz","czar","czarina","czech","czechoslovakia","czerniak","d","d'art","d'etat","d'oeuvre","d's"
DATA "dab","dabble","dacca","dachshund","dactyl","dactylic","dad","dada","dadaism","dadaist","daddy","dade","daedalus","daffodil","daffy","dagger","dahl","dahlia","dahomey","dailey"
DATA "daimler","dainty","dairy","dairylea","dairyman","dairymen","dais","daisy","dakar","dakota","dale","daley","dalhousie","dallas","dally","dalton","daly","dalzell","dam","damage"
DATA "damascus","damask","dame","damn","damnation","damon","damp","dampen","damsel","dan","dana","danbury","dance","dandelion","dandy","dane","dang","danger","dangerous","dangle"
DATA "daniel","danielson","danish","dank","danny","dante","danube","danubian","danzig","daphne","dapper","dapple","dar","dare","daredevil","darius","dark","darken","darkle","darlene"
DATA "darling","darn","darpa","darrell","darry","dart","dartmouth","darwin","darwinian","dash","dashboard","dastard","data","database","date","dateline","dater","datsun","datum","daub"
DATA "daugherty","daughter","daunt","dauphin","dauphine","dave","davenport","david","davidson","davies","davis","davison","davit","davy","dawn","dawson","day","daybed","daybreak","daydream"
DATA "daylight","daytime","dayton","daytona","daze","dazzle","dc","de","deacon","deaconess","deactivate","dead","deaden","deadhead","deadline","deadlock","deadwood","deaf","deafen","deal"
DATA "deallocate","dealt","dean","deane","deanna","dear","dearborn","dearie","dearth","death","deathbed","deathward","debacle","debar","debarring","debase","debate","debater","debauch","debauchery"
DATA "debbie","debby","debenture","debilitate","debility","debit","debonair","deborah","debra","debrief","debris","debt","debtor","debug","debugged","debugger","debugging","debunk","debussy","debut"
DATA "debutante","dec","decade","decadent","decaffeinate","decal","decant","decathlon","decatur","decay","decca","decease","decedent","deceit","deceitful","deceive","decelerate","december","decennial","decent"
DATA "deception","deceptive","decertify","decibel","decide","deciduous","decile","decimal","decimate","decipher","decision","decisional","decisionmake","decisive","deck","decker","declaim","declamation","declamatory","declaration"
DATA "declarative","declarator","declaratory","declare","declassify","declination","decline","declivity","decode","decolletage","decollimate","decolonize","decommission","decompile","decomposable","decompose","decomposition","decompress","decompression","decontrol"
DATA "decontrolled","decontrolling","deconvolution","deconvolve","decor","decorate","decorous","decorticate","decorum","decouple","decoy","decrease","decree","decreeing","decrement","decry","decrypt","decryption","dedicate","deduce"
DATA "deducible","deduct","deductible","dee","deed","deem","deemphasize","deep","deepen","deer","deere","deerskin","deerstalker","deface","default","defeat","defecate","defect","defector","defend"
DATA "defendant","defensible","defensive","defer","deferent","deferrable","deferral","deferred","deferring","defiant","deficient","deficit","define","definite","definition","definitive","deflate","deflater","deflect","deflector"
DATA "defocus","deforest","deforestation","deform","deformation","defraud","defray","defrock","defrost","deft","defunct","defuse","defy","degas","degassing","degeneracy","degenerate","degradation","degrade","degrease"
DATA "degree","degum","degumming","dehumidify","dehydrate","deify","deign","deity","deja","deject","del","delaney","delano","delaware","delay","delectable","delectate","delegable","delegate","delete"
DATA "deleterious","deletion","delft","delhi","delia","deliberate","delicacy","delicate","delicatessen","delicious","delicti","delight","delightful","delilah","delimit","delimitation","delineament","delineate","delinquent","deliquesce"
DATA "deliquescent","delirious","delirium","deliver","deliverance","delivery","dell","della","delmarva","delouse","delphi","delphic","delphine","delphinium","delphinus","delta","deltoid","delude","deluge","delusion"
DATA "delusive","deluxe","delve","demagnify","demagogue","demand","demarcate","demark","demean","demented","dementia","demerit","demigod","demijohn","demiscible","demise","demit","demitted","demitting","demo"
DATA "democracy","democrat","democratic","demodulate","demography","demolish","demolition","demon","demoniac","demonic","demonstrable","demonstrate","demote","demountable","dempsey","demultiplex","demur","demure","demurred","demurrer"
DATA "demurring","demystify","den","denature","dendrite","dendritic","deneb","denebola","deniable","denial","denigrate","denizen","denmark","dennis","denny","denominate","denotation","denotative","denote","denouement"
DATA "denounce","dense","densitometer","dent","dental","dentistry","denton","denture","denudation","denude","denumerable","denunciate","denunciation","denver","deny","deodorant","deoxyribonucleic","deoxyribose","depart","department"
DATA "departure","depend","dependent","depict","deplete","depletion","deplore","deploy","deport","deportation","deportee","depose","deposit","depositary","deposition","depositor","depository","depot","deprave","deprecate"
DATA "deprecatory","depreciable","depreciate","depredate","depress","depressant","depressible","depression","depressive","depressor","deprivation","deprive","depth","deputation","depute","deputy","derail","derange","derate","derby"
DATA "derbyshire","dereference","deregulate","deregulatory","derek","derelict","deride","derision","derisive","derivate","derive","derogate","derogatory","derrick","derriere","dervish","des","descant","descartes","descend"
DATA "descendant","descendent","descent","describe","description","descriptive","descriptor","desecrate","desecrater","desegregate","desert","deserve","desicate","desiderata","desideratum","design","designate","desire","desirous","desist"
DATA "desk","desmond","desolate","desolater","desorption","despair","desperado","desperate","despicable","despise","despite","despoil","despond","despondent","despot","despotic","dessert","dessicate","destabilize","destinate"
DATA "destine","destiny","destitute","destroy","destruct","destructor","desuetude","desultory","detach","detail","detain","detect","detector","detent","detente","detention","deter","detergent","deteriorate","determinant"
DATA "determinate","determine","deterred","deterrent","deterring","detest","detestation","detonable","detonate","detour","detoxify","detract","detractor","detriment","detroit","deuce","deus","deuterate","deuterium","deuteron"
DATA "devastate","develop","deviant","deviate","device","devil","devilish","devious","devise","devisee","devoid","devolution","devolve","devon","devonshire","devote","devotee","devotion","devour","devout"
DATA "dew","dewar","dewdrop","dewey","dewitt","dewy","dexter","dexterity","dextrose","dextrous","dey","dhabi","dharma","diabase","diabetes","diabetic","diabolic","diachronic","diacritic","diacritical"
DATA "diadem","diagnosable","diagnose","diagnoses","diagnosis","diagnostic","diagnostician","diagonal","diagram","diagrammatic","dial","dialect","dialectic","dialogue","dialup","dialysis","diamagnetic","diamagnetism","diameter","diamond"
DATA "diana","diane","dianne","diaper","diaphanous","diaphragm","diary","diathermy","diathesis","diatom","diatomaceous","diatomic","diatonic","diatribe","dibble","dice","dichloride","dichondra","dichotomize","dichotomous"
DATA "dichotomy","dick","dickcissel","dickens","dickerson","dickey","dickinson","dickson","dicotyledon","dicta","dictate","dictatorial","diction","dictionary","dictum","did","didactic","diddle","didn't","dido"
DATA "die","diebold","died","diego","diehard","dieldrin","dielectric","diem","diesel","diet","dietary","dietetic","diethylstilbestrol","dietician","dietrich","diety","dietz","diffeomorphic","diffeomorphism","differ"
DATA "different","differentiable","differential","differentiate","difficult","difficulty","diffident","diffract","diffractometer","diffuse","diffusible","diffusion","diffusive","difluoride","dig","digest","digestible","digestion","digestive","digging"
DATA "digit","digital","digitalis","digitate","dignify","dignitary","dignity","digram","digress","digression","dihedral","dilapidate","dilatation","dilate","dilatory","dilemma","dilettante","diligent","dill","dillon"
DATA "dilogarithm","diluent","dilute","dilution","dim","dime","dimension","dimethyl","diminish","diminution","diminutive","dimple","din","dinah","dine","ding","dinghy","dingo","dingy","dinnertime"
DATA "dinnerware","dinosaur","dint","diocesan","diocese","diode","dionysian","dionysus","diophantine","diopter","diorama","diorite","dioxide","dip","diphtheria","diphthong","diploid","diploidy","diploma","diplomacy"
DATA "diplomat","diplomatic","dipole","dirac","dire","direct","director","directorate","directorial","directory","directrices","directrix","dirge","dirichlet","dirt","dirty","dis","disaccharide","disambiguate","disastrous"
DATA "disburse","disc","discern","discernible","disciple","disciplinarian","disciplinary","discipline","disco","discoid","discomfit","discordant","discovery","discreet","discrepant","discrete","discretion","discretionary","discriminable","discriminant"
DATA "discriminate","discriminatory","discus","discuss","discussant","discussion","disdain","disdainful","disembowel","disgruntle","disgustful","dish","dishes","dishevel","dishwasher","dishwater","disjunct","disk","dismal","dismissal"
DATA "disney","disneyland","disparage","disparate","dispel","dispelled","dispelling","dispensable","dispensary","dispensate","dispense","dispersal","disperse","dispersible","dispersion","dispersive","disposable","disposal","disputant","dispute"
DATA "disquietude","disquisition","disrupt","disruption","disruptive","dissemble","disseminate","dissension","dissertation","dissident","dissipate","dissociable","dissociate","dissonant","dissuade","distaff","distal","distant","distillate","distillery"
DATA "distinct","distinguish","distort","distortion","distraught","distribution","distributive","distributor","district","disturb","disturbance","disulfide","disyllable","ditch","dither","ditto","ditty","ditzel","diurnal","diva"
DATA "divalent","divan","dive","diverge","divergent","diverse","diversify","diversion","diversionary","divert","divest","divestiture","divide","dividend","divination","divine","divisible","division","divisional","divisive"
DATA "divisor","divorce","divorcee","divulge","dixie","dixieland","dixon","dizzy","djakarta","dna","dnieper","do","dobbin","dobbs","doberman","dobson","docile","dock","docket","dockside"
DATA "dockyard","doctor","doctoral","doctorate","doctrinaire","doctrinal","doctrine","document","documentary","documentation","dod","dodd","dodecahedra","dodecahedral","dodecahedron","dodge","dodo","dodson","doe","doesn't"
DATA "doff","dog","dogbane","dogberry","doge","dogfish","dogging","doggone","doghouse","dogleg","dogma","dogmatic","dogmatism","dogtooth","dogtrot","dogwood","doherty","dolan","dolce","doldrum"
DATA "doldrums","dole","doleful","doll","dollar","dollop","dolly","dolomite","dolomitic","dolores","dolphin","dolt","doltish","domain","dome","domenico","domesday","domestic","domesticate","domicile"
DATA "dominant","dominate","domineer","domingo","dominic","dominican","dominick","dominion","dominique","domino","don","don't","donahue","donald","donaldson","donate","done","doneck","donkey","donna"
DATA "donnelly","donner","donnybrook","donor","donovan","doodle","dooley","doolittle","doom","doomsday","door","doorbell","doorkeep","doorkeeper","doorknob","doorman","doormen","doorstep","doorway","dopant"
DATA "dope","doppler","dora","dorado","dorcas","dorchester","doreen","doria","doric","doris","dormant","dormitory","dorothea","dorothy","dorset","dortmund","dosage","dose","dosimeter","dossier"
DATA "dostoevsky","dot","dote","double","doubleday","doubleheader","doublet","doubleton","doubloon","doubt","doubtful","douce","doug","dough","dougherty","doughnut","douglas","douglass","dour","douse"
DATA "dove","dovekie","dovetail","dow","dowager","dowel","dowitcher","dowling","down","downbeat","downcast","downdraft","downey","downfall","downgrade","downhill","downing","downplay","downpour","downright"
DATA "downriver","downs","downside","downslope","downspout","downstairs","downstate","downstream","downtown","downtrend","downtrodden","downturn","downward","downwind","dowry","doyle","doze","dozen","dr","drab"
DATA "draco","draft","draftee","draftsman","draftsmen","draftsperson","drafty","drag","dragging","dragnet","dragon","dragonfly","dragonhead","dragoon","drain","drainage","drake","dram","drama","dramatic"
DATA "dramatist","dramaturgy","drank","drape","drapery","drastic","draw","drawback","drawbridge","drawl","drawn","dread","dreadful","dreadnought","dream","dreamboat","dreamlike","dreamt","dreamy","dreary"
DATA "dredge","dreg","drench","dress","dressmake","dressy","drew","drexel","dreyfuss","drib","dribble","dried","drier","drift","drill","drink","drip","drippy","driscoll","drive"
DATA "driven","driveway","drizzle","drizzly","droll","dromedary","drone","drool","droop","droopy","drop","drophead","droplet","dropout","drosophila","dross","drought","drove","drown","drowse"
DATA "drowsy","drub","drudge","drudgery","drug","drugging","drugstore","druid","drum","drumhead","drumlin","drummond","drunk","drunkard","drunken","drury","dry","dryad","dryden","du"
DATA "dual","dualism","duane","dub","dubhe","dubious","dubitable","dublin","ducat","duchess","duck","duckling","duct","ductile","ductwork","dud","dudley","due","duel","duet"
DATA "duff","duffel","duffy","dug","dugan","dugout","duke","dukedom","dulcet","dull","dully","dulse","duluth","duly","duma","dumb","dumbbell","dummy","dump","dumpty"
DATA "dumpy","dun","dunbar","duncan","dunce","dune","dunedin","dung","dungeon","dunham","dunk","dunkirk","dunlap","dunlop","dunn","duopolist","duopoly","dupe","duplex","duplicable"
DATA "duplicate","duplicity","dupont","duquesne","durable","durance","durango","duration","durer","duress","durham","during","durkee","durkin","durrell","durward","dusenberg","dusenbury","dusk","dusky"
DATA "dusseldorf","dust","dustbin","dusty","dutch","dutchess","dutchman","dutchmen","dutiable","dutiful","dutton","duty","dwarf","dwarves","dwell","dwelt","dwight","dwindle","dwyer","dyad"
DATA "dyadic","dye","dyeing","dyer","dying","dyke","dylan","dynamic","dynamism","dynamite","dynamo","dynast","dynastic","dynasty","dyne","dysentery","dyspeptic","dysplasia","dysprosium","dystrophy"
DATA "e","e'er","e's","e.g","each","eagan","eager","eagle","ear","eardrum","earl","earmark","earn","earnest","earphone","earring","earsplitting","earth","earthen","earthenware"
DATA "earthmen","earthmove","earthmover","earthmoving","earthquake","earthshaking","earthworm","earthy","earwig","ease","easel","east","eastbound","eastern","easternmost","eastland","eastman","eastward","eastwood","easy"
DATA "easygoing","eat","eaten","eater","eaton","eave","eavesdrop","eavesdropped","eavesdropper","eavesdropping","ebb","eben","ebony","ebullient","eccentric","eccles","ecclesiastic","echelon","echidna","echinoderm"
DATA "echo","echoes","eclat","eclectic","eclipse","ecliptic","eclogue","ecole","ecology","econometric","econometrica","economic","economist","economy","ecosystem","ecstasy","ecstatic","ectoderm","ectopic","ecuador"
DATA "ecumenic","ecumenist","ed","eddie","eddy","edelweiss","edematous","eden","edgar","edge","edgerton","edgewise","edging","edgy","edible","edict","edifice","edify","edinburgh","edison"
DATA "edit","edith","edition","editor","editorial","edmonds","edmondson","edmonton","edmund","edna","edt","eduardo","educable","educate","edward","edwardian","edwardine","edwards","edwin","edwina"
DATA "eel","eelgrass","eeoc","eerie","eerily","efface","effaceable","effect","effectual","effectuate","effeminate","efferent","effete","efficacious","efficacy","efficient","effie","effloresce","efflorescent","effluent"
DATA "effluvia","effluvium","effort","effusion","effusive","eft","egalitarian","egan","egg","egghead","eggplant","eggshell","ego","egocentric","egotism","egotist","egregious","egress","egret","egypt"
DATA "egyptian","eh","ehrlich","eider","eidetic","eigenfunction","eigenspace","eigenstate","eigenvalue","eigenvector","eight","eighteen","eighteenth","eightfold","eighth","eightieth","eighty","eileen","einstein","einsteinian"
DATA "einsteinium","eire","eisenhower","eisner","either","ejaculate","eject","ejector","eke","ekstrom","ektachrome","el","elaborate","elaine","elan","elapse","elastic","elastomer","elate","elba"
DATA "elbow","elder","eldest","eldon","eleanor","eleazar","elect","elector","electoral","electorate","electra","electress","electret","electric","electrician","electrify","electro","electrocardiogram","electrocardiograph","electrode"
DATA "electroencephalogram","electroencephalograph","electroencephalography","electrolysis","electrolyte","electrolytic","electron","electronic","electrophoresis","electrophorus","elegant","elegiac","elegy","element","elementary","elena","elephant","elephantine","elevate","eleven"
DATA "eleventh","elfin","elgin","eli","elicit","elide","eligible","elijah","eliminate","elinor","eliot","elisabeth","elisha","elision","elite","elizabeth","elizabethan","elk","elkhart","ell"
DATA "ella","ellen","elliot","elliott","ellipse","ellipsis","ellipsoid","ellipsoidal","ellipsometer","elliptic","ellis","ellison","ellsworth","ellwood","elm","elmer","elmhurst","elmira","elmsford","eloise"
DATA "elongate","elope","eloquent","else","elsevier","elsewhere","elsie","elsinore","elton","eluate","elucidate","elude","elusive","elute","elution","elves","ely","elysee","elysian","em"
DATA "emaciate","emanate","emancipate","emanuel","emasculate","embalm","embank","embarcadero","embargo","embargoes","embark","embarrass","embassy","embattle","embed","embeddable","embedded","embedder","embedding","embellish"
DATA "ember","embezzle","emblazon","emblem","emblematic","embodiment","embody","embolden","emboss","embouchure","embower","embrace","embraceable","embrittle","embroider","embroidery","embroil","embryo","embryology","embryonic"
DATA "emcee","emendable","emerald","emerge","emergent","emeriti","emeritus","emerson","emery","emigrant","emigrate","emil","emile","emilio","emily","eminent","emirate","emissary","emission","emissivity"
DATA "emit","emittance","emitted","emitter","emitting","emma","emmanuel","emmett","emolument","emory","emotion","emotional","empathy","emperor","emphases","emphasis","emphatic","emphysema","emphysematous","empire"
DATA "empiric","emplace","employ","employed","employee","employer","employing","emporium","empower","empress","empty","emulate","emulsify","emulsion","en","enable","enamel","encapsulate","encephalitis","enchantress"
DATA "enclave","encomia","encomium","encore","encroach","encryption","encumber","encumbrance","encyclopedic","end","endemic","endgame","endicott","endoderm","endogamous","endogamy","endogenous","endomorphism","endorse","endosperm"
DATA "endothelial","endothermic","endow","endpoint","endurance","endure","enemy","energetic","energy","enervate","enfant","enfield","enforceable","enforcible","eng","engage","engel","engine","engineer","england"
DATA "englander","engle","englewood","english","englishman","englishmen","enhance","enid","enigma","enigmatic","enjoinder","enlargeable","enliven","enmity","enoch","enol","enormity","enormous","enos","enough"
DATA "enquire","enquiry","enrico","enrollee","ensconce","ensemble","enstatite","entendre","enter","enterprise","entertain","enthalpy","enthrall","enthusiasm","enthusiast","enthusiastic","entice","entire","entirety","entity"
DATA "entomology","entourage","entranceway","entrant","entrepreneur","entrepreneurial","entropy","entry","enumerable","enumerate","enunciable","enunciate","envelop","envelope","enviable","envious","environ","envoy","envy","enzymatic"
DATA "enzyme","enzymology","eocene","eohippus","eosine","epa","epaulet","ephemeral","ephemerides","ephemeris","ephesian","ephesus","ephraim","epic","epicure","epicurean","epicycle","epicyclic","epidemic","epidemiology"
DATA "epidermic","epidermis","epigenetic","epigram","epigrammatic","epigraph","epileptic","epilogue","epimorphism","epiphany","epiphyseal","epiphysis","episcopal","episcopalian","episcopate","episode","episodic","epistemology","epistle","epistolatory"
DATA "epitaph","epitaxial","epitaxy","epithelial","epithelium","epithet","epitome","epoch","epochal","epoxy","epsilon","epsom","epstein","equable","equal","equanimity","equate","equatorial","equestrian","equidistant"
DATA "equilateral","equilibrate","equilibria","equilibrium","equine","equinoctial","equinox","equip","equipoise","equipotent","equipped","equipping","equitable","equitation","equity","equivalent","equivocal","equivocate","era","eradicable"
DATA "eradicate","erasable","erase","erasmus","erastus","erasure","erato","eratosthenes","erbium","erda","ere","erect","erg","ergative","ergodic","eric","erich","erickson","ericsson","erie"
DATA "erik","erlenmeyer","ernest","ernestine","ernie","ernst","erode","erodible","eros","erosible","erosion","erosive","erotic","erotica","err","errancy","errand","errant","errantry","errata"
DATA "erratic","erratum","errol","erroneous","error","ersatz","erskine","erudite","erudition","erupt","eruption","ervin","erwin","escadrille","escalate","escapade","escape","escapee","escheat","escherichia"
DATA "eschew","escort","escritoire","escrow","escutcheon","eskimo","esmark","esophagi","esoteric","especial","espionage","esplanade","esposito","espousal","espouse","esprit","esquire","essay","essen","essence"
DATA "essential","essex","est","establish","estate","esteem","estella","ester","estes","esther","estimable","estimate","estonia","estop","estoppal","estrange","estuarine","estuary","et","eta"
DATA "etc","etch","eternal","eternity","ethan","ethane","ethanol","ethel","ether","ethereal","ethic","ethiopia","ethnic","ethnography","ethnology","ethology","ethos","ethyl","ethylene","etiology"
DATA "etiquette","etruscan","etude","etymology","eucalyptus","eucharist","euclid","euclidean","eucre","eugene","eugenia","eugenic","eukaryote","euler","eulerian","eulogy","eumenides","eunice","euphemism","euphemist"
DATA "euphorbia","euphoria","euphoric","euphrates","eurasia","eureka","euridyce","euripides","europa","europe","european","europium","eurydice","eutectic","euterpe","euthanasia","eva","evacuate","evade","evaluable"
DATA "evaluate","evanescent","evangel","evangelic","evans","evanston","evansville","evaporate","evasion","evasive","eve","evelyn","even","evenhanded","evensong","event","eventful","eventide","eventual","eventuate"
DATA "eveready","everett","everglades","evergreen","everhart","everlasting","every","everybody","everyday","everyman","everyone","everything","everywhere","evict","evident","evidential","evil","evildoer","evince","evocable"
DATA "evocate","evocation","evoke","evolution","evolutionary","evolve","evzone","ewe","ewing","ex","exacerbate","exact","exacter","exaggerate","exalt","exaltation","exam","examination","examine","example"
DATA "exasperate","exasperater","excavate","exceed","excel","excelled","excellent","excelling","excelsior","except","exception","exceptional","excerpt","excess","excessive","exchange","exchangeable","exchequer","excisable","excise"
DATA "excision","excitation","excitatory","excite","exciton","exclaim","exclamation","exclamatory","exclude","exclusion","exclusionary","exclusive","excommunicate","excoriate","excrescent","excrete","excretion","excretory","excruciate","exculpate"
DATA "exculpatory","excursion","excursus","excusable","excuse","execrable","execrate","execute","execution","executive","executor","executrix","exegesis","exegete","exemplar","exemplary","exemplify","exempt","exemption","exercisable"
DATA "exercise","exert","exeter","exhale","exhaust","exhaustible","exhaustion","exhaustive","exhibit","exhibition","exhibitor","exhilarate","exhort","exhortation","exhumation","exhume","exigent","exile","exist","existent"
DATA "existential","exit","exodus","exogamous","exogamy","exogenous","exonerate","exorbitant","exorcise","exorcism","exorcist","exoskeleton","exothermic","exotic","exotica","expand","expanse","expansible","expansion","expansive"
DATA "expatiate","expect","expectant","expectation","expectorant","expectorate","expedient","expedite","expedition","expeditious","expel","expellable","expelled","expelling","expend","expenditure","expense","expensive","experience","experiential"
DATA "experiment","experimentation","expert","expertise","expiable","expiate","expiration","expire","explain","explanation","explanatory","expletive","explicable","explicate","explicit","explode","exploit","exploitation","exploration","exploratory"
DATA "explore","explosion","explosive","exponent","exponential","exponentiate","export","exportation","expose","exposit","exposition","expositor","expository","exposure","expound","express","expressible","expression","expressive","expressway"
DATA "expropriate","expulsion","expunge","expurgate","exquisite","extant","extemporaneous","extempore","extend","extendible","extensible","extension","extensive","extensor","extent","extenuate","exterior","exterminate","external","extinct"
DATA "extinguish","extirpate","extol","extolled","extoller","extolling","extort","extra","extracellular","extract","extractor","extracurricular","extraditable","extradite","extradition","extralegal","extralinguistic","extramarital","extramural","extraneous"
DATA "extraordinary","extrapolate","extraterrestrial","extravagant","extravaganza","extrema","extremal","extreme","extremis","extremum","extricable","extricate","extrinsic","extroversion","extrovert","extrude","extrusion","extrusive","exuberant","exudate"
DATA "exudation","exude","exult","exultant","exultation","exxon","eye","eyeball","eyebright","eyebrow","eyed","eyeful","eyeglass","eyelash","eyelet","eyelid","eyepiece","eyesight","eyesore","eyewitness"
DATA "ezekiel","ezra","f","f's","faa","faber","fabian","fable","fabric","fabricate","fabulous","facade","face","faceplate","facet","facetious","facial","facile","facilitate","facsimile"
DATA "fact","factious","facto","factor","factorial","factory","factual","facultative","faculty","fad","fade","fadeout","faery","fafnir","fag","fahey","fahrenheit","fail","failsafe","failsoft"
DATA "failure","fain","faint","fair","fairchild","fairfax","fairfield","fairgoer","fairport","fairway","fairy","faith","faithful","fake","falcon","falconry","fall","fallacious","fallacy","fallen"
DATA "fallible","falloff","fallout","fallow","falmouth","false","falsehood","falsify","falstaff","falter","fame","familial","familiar","familiarly","familism","family","famine","famish","famous","fan"
DATA "fanatic","fanciful","fancy","fanfare","fanfold","fang","fangled","fanny","fanout","fantasia","fantasist","fantastic","fantasy","fantod","far","farad","faraday","farber","farce","farcical"
DATA "fare","farewell","farfetched","fargo","farina","farkas","farley","farm","farmhouse","farmington","farmland","farnsworth","faro","farrell","farsighted","farther","farthest","fascicle","fasciculate","fascinate"
DATA "fascism","fascist","fashion","fast","fasten","fastidious","fat","fatal","fate","fateful","father","fathom","fatigue","fatima","fatten","fatty","fatuous","faucet","faulkner","fault"
DATA "faulty","faun","fauna","faust","faustian","faustus","fawn","fay","fayette","fayetteville","faze","fbi","fcc","fda","fe","fealty","fear","fearful","fearsome","feasible"
DATA "feast","feat","feather","featherbed","featherbedding","featherbrain","feathertop","featherweight","feathery","feature","feb","febrile","february","fecund","fed","fedders","federal","federate","fedora","fee"
DATA "feeble","feed","feedback","feel","feeney","feet","feign","feint","feldman","feldspar","felice","felicia","felicitous","felicity","feline","felix","fell","fellow","felon","felonious"
DATA "felony","felsite","felt","female","feminine","feminism","feminist","femur","fence","fencepost","fend","fennel","fenton","fenugreek","ferber","ferdinand","ferguson","fermat","ferment","fermentation"
DATA "fermi","fermion","fermium","fern","fernando","fernery","ferocious","ferocity","ferreira","ferrer","ferret","ferric","ferris","ferrite","ferroelectric","ferromagnet","ferromagnetic","ferromagnetism","ferrous","ferruginous"
DATA "ferrule","ferry","fertile","fervent","fescue","fest","festival","festive","fetal","fetch","fete","fetid","fetish","fetter","fettle","fetus","feud","feudal","feudatory","fever"
DATA "feverish","few","fiance","fiancee","fiasco","fiat","fib","fiberboard","fiberglas","fibonacci","fibration","fibrin","fibrosis","fibrous","fiche","fickle","fiction","fictitious","fictive","fiddle"
DATA "fiddlestick","fide","fidelity","fidget","fiducial","fiduciary","fief","fiefdom","field","fields","fieldstone","fieldwork","fiend","fiendish","fierce","fiery","fiesta","fife","fifo","fifteen"
DATA "fifteenth","fifth","fiftieth","fifty","fig","figaro","fight","figural","figurate","figure","figurine","filament","filamentary","filbert","filch","file","filet","filial","filibuster","filigree"
DATA "filipino","fill","filled","filler","fillet","fillip","filly","film","filmdom","filmmake","filmstrip","filmy","filter","filth","filthy","filtrate","fin","final","finale","finance"
DATA "financial","financier","finch","find","fine","finery","finesse","finessed","finessing","finger","fingernail","fingerprint","fingertip","finial","finicky","finish","finitary","finite","fink","finland"
DATA "finley","finn","finnegan","finnish","finny","fir","fire","firearm","fireboat","firebreak","firebug","firecracker","firefly","firehouse","firelight","fireman","firemen","fireplace","firepower","fireproof"
DATA "fireside","firestone","firewall","firewood","firework","firm","firmware","first","firsthand","fiscal","fischbein","fischer","fish","fisherman","fishermen","fishery","fishmonger","fishpond","fishy","fisk"
DATA "fiske","fissile","fission","fissure","fist","fisticuff","fit","fitch","fitchburg","fitful","fitzgerald","fitzpatrick","fitzroy","five","fivefold","fix","fixate","fixture","fizeau","fizzle"
DATA "fjord","fl","flabbergast","flabby","flack","flag","flagellate","flageolet","flagging","flagler","flagpole","flagrant","flagstaff","flagstone","flail","flair","flak","flake","flaky","flam"
DATA "flamboyant","flame","flamingo","flammable","flanagan","flanders","flange","flank","flannel","flap","flare","flash","flashback","flashlight","flashy","flask","flat","flatbed","flathead","flatiron"
DATA "flatland","flatten","flattery","flatulent","flatus","flatware","flatworm","flaunt","flautist","flaw","flax","flaxen","flaxseed","flea","fleabane","fleawort","fleck","fled","fledge","fledgling"
DATA "flee","fleece","fleeing","fleet","fleming","flemish","flesh","fleshy","fletch","fletcher","flew","flex","flexible","flexural","flexure","flick","flier","flight","flimsy","flinch"
DATA "fling","flint","flintlock","flinty","flip","flipflop","flippant","flirt","flirtation","flirtatious","flit","flo","float","floc","flocculate","flock","floe","flog","flogging","flood"
DATA "floodgate","floodlight","floodlit","floor","floorboard","flop","floppy","flora","floral","florence","florentine","florican","florid","florida","floridian","florin","florist","flotation","flotilla","flounce"
DATA "flounder","flour","flourish","floury","flout","flow","flowchart","flowerpot","flowery","flown","floyd","flu","flub","fluctuate","flue","fluency","fluent","fluff","fluffy","fluid"
DATA "fluke","flung","flunk","fluoresce","fluorescein","fluorescent","fluoridate","fluoride","fluorine","fluorite","fluorocarbon","fluorspar","flurry","flush","fluster","flute","flutter","fluvial","flux","fly"
DATA "flycatcher","flyer","flynn","flyway","fm","fmc","foal","foam","foamflower","foamy","fob","focal","foci","focus","focussed","fodder","foe","fog","fogarty","fogging"
DATA "foggy","fogy","foible","foil","foist","fold","foldout","foley","foliage","foliate","folio","folk","folklore","folksong","folksy","follicle","follicular","follow","followeth","folly"
DATA "fomalhaut","fond","fondle","fondly","font","fontaine","fontainebleau","food","foodstuff","fool","foolhardy","foolish","foolproof","foot","footage","football","footbridge","foote","footfall","foothill"
DATA "footman","footmen","footnote","footpad","footpath","footprint","footstep","footstool","footwear","footwork","fop","foppish","for","forage","foray","forbade","forbear","forbearance","forbes","forbid"
DATA "forbidden","forbidding","forbore","forborne","force","forceful","forcible","ford","fordham","fore","foregoing","foreign","forensic","forest","forestry","forever","forfeit","forfeiture","forfend","forgave"
DATA "forge","forgery","forget","forgetful","forgettable","forgetting","forgive","forgiven","forgo","forgot","forgotten","fork","forklift","forlorn","form","formal","formaldehyde","formant","format","formate"
DATA "formatted","formatting","formic","formica","formidable","formosa","formula","formulae","formulaic","formulate","forrest","forsake","forsaken","forsook","forswear","forsythe","fort","forte","fortescue","forth"
DATA "forthcome","forthright","forthwith","fortieth","fortify","fortin","fortiori","fortitude","fortnight","fortran","fortress","fortuitous","fortunate","fortune","forty","forum","forward","forwent","foss","fossil"
DATA "fossiliferous","foster","fosterite","fought","foul","foulmouth","found","foundation","foundling","foundry","fount","fountain","fountainhead","four","fourfold","fourier","foursome","foursquare","fourteen","fourteenth"
DATA "fourth","fovea","fowl","fox","foxglove","foxhall","foxhole","foxhound","foxtail","foxy","foyer","fpc","fraction","fractionate","fractious","fracture","fragile","fragment","fragmentary","fragmentation"
DATA "fragrant","frail","frailty","frambesia","frame","framework","fran","franc","franca","france","frances","franchise","francine","francis","franciscan","francisco","francium","franco","francoise","frangipani"
DATA "frank","frankel","frankfort","frankfurt","frankfurter","franklin","frantic","franz","fraser","fraternal","fraternity","frau","fraud","fraudulent","fraught","fray","frayed","frazier","frazzle","freak"
DATA "freakish","freckle","fred","freddie","freddy","frederic","frederick","fredericks","fredericksburg","fredericton","fredholm","fredrickson","free","freeboot","freed","freedman","freedmen","freedom","freehand","freehold"
DATA "freeing","freeman","freemen","freeport","freer","freest","freestone","freethink","freetown","freeway","freewheel","freeze","freight","french","frenchman","frenchmen","frenetic","frenzy","freon","frequent"
DATA "fresco","frescoes","fresh","freshen","freshman","freshmen","freshwater","fresnel","fresno","fret","freud","freudian","frey","freya","friable","friar","fricative","frick","friction","frictional"
DATA "friday","fried","friedman","friedrich","friend","frieze","frigate","frigga","fright","frighten","frightful","frigid","frigidaire","frill","frilly","fringe","frisky","fritillary","fritter","fritz"
DATA "frivolity","frivolous","frizzle","fro","frock","frog","frolic","from","front","frontage","frontal","frontier","frontiersman","frontiersmen","frost","frostbite","frostbitten","frosty","froth","frothy"
DATA "frown","frowzy","froze","frozen","fructify","fructose","fruehauf","frugal","fruit","fruitful","fruition","frustrate","frustrater","frustum","fry","frye","ft","ftc","fuchs","fuchsia"
DATA "fudge","fuel","fugal","fugitive","fugue","fuji","fujitsu","fulcrum","fulfill","full","fullback","fullerton","fully","fulminate","fulsome","fulton","fum","fumble","fume","fumigant"
DATA "fumigate","fun","function","functionary","functor","functorial","fund","fundamental","fundraise","funeral","funereal","fungal","fungi","fungible","fungicide","fungoid","fungus","funk","funnel","funny"
DATA "fur","furbish","furious","furl","furlong","furlough","furman","furnace","furnish","furniture","furrier","furrow","furry","further","furtherance","furthermore","furthermost","furthest","furtive","fury"
DATA "furze","fuse","fuselage","fusible","fusiform","fusillade","fusion","fuss","fussy","fusty","futile","future","fuzz","fuzzy","g","g's","ga","gab","gabardine","gabble"
DATA "gabbro","gaberones","gable","gabon","gabriel","gabrielle","gad","gadfly","gadget","gadgetry","gadolinium","gadwall","gaelic","gaff","gaffe","gag","gage","gagging","gaggle","gagwriter"
DATA "gaiety","gail","gaillardia","gain","gaines","gainesville","gainful","gait","gaithersburg","gal","gala","galactic","galactose","galapagos","galatea","galatia","galaxy","galbreath","gale","galen"
DATA "galena","galenite","galilee","gall","gallagher","gallant","gallantry","gallberry","gallery","galley","gallinule","gallium","gallivant","gallon","gallonage","gallop","galloway","gallows","gallstone","gallup"
DATA "gallus","galois","galt","galvanic","galvanism","galvanometer","galveston","galway","gam","gambia","gambit","gamble","gambol","game","gamecock","gamesman","gamin","gamma","gamut","gander"
DATA "gang","ganges","gangland","gangling","ganglion","gangplank","gangster","gangway","gannet","gannett","gantlet","gantry","ganymede","gao","gap","gape","gar","garage","garb","garbage"
DATA "garble","garcia","garden","gardenia","gardner","garfield","gargantuan","gargle","garibaldi","garish","garland","garlic","garner","garnet","garrett","garrison","garrisonian","garrulous","garry","garter"
DATA "garth","garvey","gary","gas","gascony","gaseous","gases","gash","gasify","gasket","gaslight","gasohol","gasoline","gasp","gaspee","gassy","gaston","gastrointestinal","gastronome","gastronomy"
DATA "gate","gatekeep","gates","gateway","gather","gatlinburg","gator","gauche","gaucherie","gaudy","gauge","gaugeable","gauguin","gaul","gauleiter","gaulle","gaunt","gauntlet","gaur","gauss"
DATA "gaussian","gauze","gave","gavel","gavin","gavotte","gawk","gawky","gay","gaylord","gaze","gazelle","gazette","ge","gear","gecko","gedanken","gee","geese","gegenschein"
DATA "geiger","geigy","geisha","gel","gelable","gelatin","gelatine","gelatinous","geld","gem","geminate","gemini","gemlike","gemma","gemstone","gender","gene","genealogy","genera","general"
DATA "generate","generic","generosity","generous","genesco","genesis","genetic","geneva","genevieve","genial","genie","genii","genital","genitive","genius","genoa","genotype","genre","gent","genteel"
DATA "gentian","gentile","gentility","gentle","gentleman","gentlemen","gentry","genuine","genus","geocentric","geochemical","geochemistry","geochronology","geodesic","geodesy","geodetic","geoduck","geoffrey","geographer","geography"
DATA "geology","geometer","geometrician","geophysical","geophysics","geopolitic","george","georgetown","georgia","gerald","geraldine","geranium","gerard","gerber","gerbil","gerhard","gerhardt","geriatric","germ","german"
DATA "germane","germanic","germanium","germantown","germany","germicidal","germicide","germinal","germinate","gerontology","gerry","gershwin","gertrude","gerund","gerundial","gerundive","gestalt","gestapo","gesticulate","gesture"
DATA "get","getaway","getty","gettysburg","geyser","ghana","ghastly","ghent","gherkin","ghetto","ghost","ghostlike","ghostly","ghoul","ghoulish","giacomo","giant","giantess","gibberish","gibbet"
DATA "gibbon","gibbons","gibbous","gibbs","gibby","gibe","giblet","gibraltar","gibson","giddap","giddy","gideon","gifford","gift","gig","gigabit","gigabyte","gigacycle","gigahertz","gigaherz"
DATA "gigantic","gigavolt","gigawatt","gigging","giggle","gil","gila","gilbert","gilbertson","gilchrist","gild","gilead","giles","gill","gillespie","gillette","gilligan","gilmore","gilt","gimbal"
DATA "gimbel","gimmick","gimmickry","gimpy","gin","gina","ginger","gingham","gingko","ginkgo","ginmill","ginn","gino","ginsberg","ginsburg","ginseng","giovanni","giraffe","gird","girdle"
DATA "girl","girlie","girlish","girth","gist","giuliano","giuseppe","give","giveaway","given","giveth","glacial","glaciate","glacier","glacis","glad","gladden","gladdy","glade","gladiator"
DATA "gladiolus","gladstone","gladys","glamor","glamorous","glamour","glance","gland","glandular","glans","glare","glasgow","glass","glassine","glassware","glasswort","glassy","glaswegian","glaucoma","glaucous"
DATA "glaze","gleam","glean","gleason","glee","gleeful","glen","glenda","glendale","glenn","glib","glidden","glide","glimmer","glimpse","glint","glissade","glisten","glitch","glitter"
DATA "gloat","glob","global","globe","globular","globule","globulin","glom","glomerular","gloom","gloomy","gloria","gloriana","glorify","glorious","glory","gloss","glossary","glossed","glossolalia"
DATA "glossy","glottal","glottis","gloucester","glove","glow","glucose","glue","glued","gluey","gluing","glum","glut","glutamate","glutamic","glutamine","glutinous","glutton","glyceride","glycerin"
DATA "glycerinate","glycerine","glycerol","glycine","glycogen","glycol","glyph","gm","gmt","gnarl","gnash","gnat","gnaw","gneiss","gnome","gnomon","gnomonic","gnostic","gnp","gnu"
DATA "go","goa","goad","goal","goat","goatherd","gob","gobble","gobbledygook","goblet","god","goddard","goddess","godfather","godfrey","godhead","godkin","godlike","godmother","godparent"
DATA "godsend","godson","godwin","godwit","goer","goes","goethe","goff","gog","goggle","gogh","gogo","gold","goldberg","golden","goldeneye","goldenrod","goldenseal","goldfinch","goldfish"
DATA "goldman","goldsmith","goldstein","goldstine","goldwater","goleta","golf","goliath","golly","gondola","gone","gong","goniometer","gonzales","gonzalez","goober","good","goodbye","goode","goodman"
DATA "goodrich","goodwill","goodwin","goody","goodyear","goof","goofy","goose","gooseberry","gop","gopher","gordian","gordon","gore","goren","gorge","gorgeous","gorgon","gorham","gorilla"
DATA "gorky","gorse","gorton","gory","gosh","goshawk","gosling","gospel","gossamer","gossip","got","gotham","gothic","gotten","gottfried","goucher","gouda","gouge","gould","gourd"
DATA "gourmet","gout","govern","governance","governess","governor","gown","gpo","grab","grace","graceful","gracious","grackle","grad","gradate","grade","gradient","gradual","graduate","grady"
DATA "graff","graft","graham","grail","grain","grainy","grammar","grammarian","grammatic","granary","grand","grandchild","grandchildren","granddaughter","grandeur","grandfather","grandiloquent","grandiose","grandma","grandmother"
DATA "grandnephew","grandniece","grandpa","grandparent","grandson","grandstand","granite","granitic","granny","granola","grant","grantee","grantor","granular","granulate","granule","granville","grape","grapefruit","grapevine"
DATA "graph","grapheme","graphic","graphite","grapple","grasp","grass","grassland","grassy","grata","grate","grateful","grater","gratify","gratis","gratitude","gratuitous","gratuity","grave","gravel"
DATA "graven","graves","gravestone","graveyard","gravid","gravitate","gravy","gray","graybeard","grayish","grayson","graywacke","graze","grease","greasy","great","greatcoat","greater","grebe","grecian"
DATA "greece","greed","greedy","greek","green","greenbelt","greenberg","greenblatt","greenbriar","greene","greenery","greenfield","greengrocer","greenhouse","greenish","greenland","greensboro","greensward","greenware","greenwich"
DATA "greenwood","greer","greet","greg","gregarious","gregg","gregory","gremlin","grenade","grendel","grenoble","gresham","greta","gretchen","grew","grey","greyhound","greylag","grid","griddle"
DATA "gridiron","grief","grievance","grieve","grievous","griffin","griffith","grill","grille","grilled","grillwork","grim","grimace","grimaldi","grime","grimes","grimm","grin","grind","grindstone"
DATA "grip","gripe","grippe","grisly","grist","gristmill","griswold","grit","gritty","grizzle","grizzly","groan","groat","grocer","grocery","groggy","groin","grommet","groom","groove"
DATA "grope","grosbeak","gross","grosset","grossman","grosvenor","grotesque","groton","ground","groundsel","groundskeep","groundwork","group","groupoid","grout","grove","grovel","grover","grow","growl"
DATA "grown","grownup","growth","grub","grubby","grudge","gruesome","gruff","grumble","grumman","grunt","gryphon","gsa","gu","guam","guanidine","guanine","guano","guarantee","guaranteeing"
DATA "guarantor","guaranty","guard","guardhouse","guardia","guardian","guatemala","gubernatorial","guelph","guenther","guerdon","guernsey","guerrilla","guess","guesswork","guest","guffaw","guggenheim","guiana","guidance"
DATA "guide","guidebook","guideline","guidepost","guiding","guignol","guild","guildhall","guile","guilford","guillemot","guillotine","guilt","guilty","guinea","guise","guitar","gules","gulf","gull"
DATA "gullah","gullet","gullible","gully","gulp","gum","gumbo","gumdrop","gummy","gumption","gumshoe","gun","gunderson","gunfight","gunfire","gunflint","gunk","gunky","gunman","gunmen"
DATA "gunnery","gunny","gunplay","gunpowder","gunshot","gunsling","gunther","gurgle","gurkha","guru","gus","gush","gusset","gust","gustafson","gustav","gustave","gustavus","gusto","gusty"
DATA "gut","gutenberg","guthrie","gutsy","guttural","guy","guyana","guzzle","gwen","gwyn","gym","gymnasium","gymnast","gymnastic","gymnosperm","gyp","gypsite","gypsum","gypsy","gyrate"
DATA "gyrfalcon","gyro","gyrocompass","gyroscope","h","h's","ha","haag","haas","habeas","haberdashery","haberman","habib","habit","habitant","habitat","habitation","habitual","habituate","hacienda"
DATA "hack","hackberry","hackett","hackle","hackmatack","hackney","hackneyed","hacksaw","had","hadamard","haddad","haddock","hades","hadley","hadn't","hadrian","hadron","hafnium","hagen","hager"
DATA "haggard","haggle","hagstrom","hague","hahn","haifa","haiku","hail","hailstone","hailstorm","haines","hair","haircut","hairdo","hairpin","hairy","haiti","haitian","hal","halcyon"
DATA "hale","haley","half","halfback","halfhearted","halfway","halibut","halide","halifax","halite","hall","hallelujah","halley","hallmark","hallow","halloween","hallucinate","hallway","halma","halo"
DATA "halocarbon","halogen","halpern","halsey","halstead","halt","halvah","halve","halverson","ham","hamal","hamburg","hamburger","hamilton","hamlet","hamlin","hammerhead","hammock","hammond","hamper"
DATA "hampshire","hampton","hamster","han","hancock","hand","handbag","handbook","handclasp","handcuff","handel","handful","handgun","handhold","handicap","handicapped","handicapper","handicapping","handicraft","handicraftsman"
DATA "handicraftsmen","handiwork","handkerchief","handle","handleable","handlebar","handline","handmade","handmaiden","handout","handset","handshake","handsome","handspike","handstand","handwaving","handwrite","handwritten","handy","handyman"
DATA "handymen","haney","hanford","hang","hangable","hangar","hangman","hangmen","hangout","hangover","hank","hankel","hanley","hanlon","hanna","hannah","hannibal","hanoi","hanover","hanoverian"
DATA "hans","hansel","hansen","hansom","hanson","hanukkah","hap","haphazard","haploid","haploidy","haplology","happen","happenstance","happy","hapsburg","harangue","harass","harbin","harbinger","harcourt"
DATA "hard","hardbake","hardboard","hardboiled","hardcopy","harden","hardhat","hardin","harding","hardscrabble","hardtack","hardtop","hardware","hardwood","hardworking","hardy","hare","harelip","harem","hark"
DATA "harlan","harlem","harley","harm","harmful","harmon","harmonic","harmonica","harmonious","harmony","harness","harold","harp","harpoon","harpsichord","harpy","harriet","harriman","harrington","harris"
DATA "harrisburg","harrison","harrow","harry","harsh","harshen","hart","hartford","hartley","hartman","harvard","harvest","harvestman","harvey","hash","hashish","hasn't","hasp","hassle","hast"
DATA "haste","hasten","hastings","hasty","hat","hatch","hatchet","hatchway","hate","hateful","hater","hatfield","hath","hathaway","hatred","hatteras","hattie","hattiesburg","haugen","haughty"
DATA "haul","haulage","haunch","haunt","hausdorff","havana","have","haven","haven't","havilland","havoc","haw","hawaii","hawaiian","hawk","hawkins","hawley","hawthorn","hawthorne","hay"
DATA "hayden","haydn","hayes","hayfield","haynes","hays","haystack","hayward","hazard","hazardous","haze","hazel","hazelnut","hazy","he","he'd","he'll","head","headache","headboard"
DATA "headdress","headland","headlight","headline","headmaster","headphone","headquarter","headquarters","headroom","headset","headsman","headsmen","headstand","headstone","headstrong","headwall","headwater","headway","headwind","heady"
DATA "heal","healey","health","healthful","healthy","healy","heap","hear","heard","hearken","hearsay","hearse","hearst","heart","heartbeat","heartbreak","hearten","heartfelt","hearth","hearty"
DATA "heat","heater","heath","heathen","heathenish","heathkit","heave","heaven","heavenward","heavy","heavyweight","hebe","hebephrenic","hebraic","hebrew","hecate","hecatomb","heck","heckle","heckman"
DATA "hectic","hector","hecuba","hedge","hedgehog","hedonism","hedonist","heed","heel","heft","hefty","hegelian","hegemony","heidelberg","heigh","height","heighten","heine","heinrich","heinz"
DATA "heir","heiress","heisenberg","held","helen","helena","helene","helga","helical","helicopter","heliocentric","heliotrope","helium","helix","hell","hellbender","hellebore","hellenic","hellfire","hellgrammite"
DATA "hellish","hello","helm","helmet","helmholtz","helmsman","helmsmen","helmut","help","helpful","helpmate","helsinki","helvetica","hem","hematite","hemingway","hemisphere","hemispheric","hemlock","hemoglobin"
DATA "hemolytic","hemorrhage","hemorrhoid","hemosiderin","hemp","hempstead","hen","henbane","hence","henceforth","henchman","henchmen","henderson","hendrick","hendricks","hendrickson","henequen","henley","henpeck","henri"
DATA "henrietta","henry","hepatica","hepatitis","hepburn","heptane","her","hera","heraclitus","herald","herb","herbert","herculean","hercules","herd","herdsman","here","hereabout","hereafter","hereby"
DATA "hereditary","heredity","hereford","herein","hereinabove","hereinafter","hereinbelow","hereof","heresy","heretic","hereto","heretofore","hereunder","hereunto","herewith","heritable","heritage","herkimer","herman","hermann"
DATA "hermeneutic","hermes","hermetic","hermite","hermitian","hermosa","hernandez","hero","herodotus","heroes","heroic","heroin","heroine","heroism","heron","herpes","herpetology","herr","herringbone","herschel"
DATA "herself","hershel","hershey","hertz","hertzog","hesitant","hesitate","hesitater","hesperus","hess","hesse","hessian","hester","heterocyclic","heterodyne","heterogamous","heterogeneity","heterogeneous","heterosexual","heterostructure"
DATA "heterozygous","hetman","hettie","hetty","heublein","heuristic","heusen","heuser","hew","hewett","hewitt","hewlett","hewn","hex","hexachloride","hexadecimal","hexafluoride","hexagon","hexagonal","hexameter"
DATA "hexane","hey","heyday","hi","hiatt","hiatus","hiawatha","hibachi","hibbard","hibernate","hibernia","hick","hickey","hickman","hickory","hicks","hid","hidalgo","hidden","hide"
DATA "hideaway","hideous","hideout","hierarchal","hierarchic","hierarchy","hieratic","hieroglyphic","hieronymus","hifalutin","higgins","high","highball","highboy","highest","highfalutin","highhanded","highland","highlight","highroad"
DATA "hightail","highway","highwayman","highwaymen","hijack","hijinks","hike","hilarious","hilarity","hilbert","hildebrand","hill","hillbilly","hillcrest","hillel","hillman","hillmen","hillock","hillside","hilltop"
DATA "hilly","hilt","hilton","hilum","him","himalaya","himself","hind","hindmost","hindrance","hindsight","hindu","hinduism","hines","hinge","hinman","hint","hinterland","hip","hippo"
DATA "hippocrates","hippocratic","hippodrome","hippopotamus","hippy","hipster","hiram","hire","hireling","hiroshi","hiroshima","hirsch","hirsute","his","hispanic","hiss","histamine","histidine","histochemic","histochemistry"
DATA "histogram","histology","historian","historic","historiography","history","histrionic","hit","hitachi","hitch","hitchcock","hither","hitherto","hitler","hive","ho","hoagie","hoagland","hoagy","hoar"
DATA "hoard","hoarfrost","hoarse","hob","hobart","hobbes","hobble","hobbs","hobby","hobbyhorse","hobgoblin","hobo","hoboken","hoc","hock","hockey","hocus","hodge","hodgepodge","hodges"
DATA "hodgkin","hoe","hoff","hoffman","hog","hogan","hogging","hoi","hokan","holbrook","holcomb","hold","holden","holdout","holdover","holdup","hole","holeable","holiday","holland"
DATA "hollandaise","holler","hollerith","hollingsworth","hollister","hollow","holloway","hollowware","holly","hollyhock","hollywood","holm","holman","holmdel","holmes","holmium","holocaust","holocene","hologram","holography"
DATA "holst","holstein","holster","holt","holyoke","holystone","hom","homage","home","homebound","homebuild","homebuilder","homebuilding","homecome","homecoming","homeland","homemade","homemake","homeomorph","homeomorphic"
DATA "homeopath","homeostasis","homeown","homeowner","homeric","homesick","homestead","homeward","homework","homicidal","homicide","homily","homo","homogenate","homogeneity","homogeneous","homologous","homologue","homology","homomorphic"
DATA "homomorphism","homonym","homophobia","homosexual","homotopy","homozygous","homunculus","honda","hondo","honduras","hone","honest","honesty","honey","honeybee","honeycomb","honeydew","honeymoon","honeysuckle","honeywell"
DATA "hong","honk","honolulu","honoraria","honorarium","honorary","honoree","honorific","honshu","hooch","hood","hoodlum","hoof","hoofmark","hook","hookup","hookworm","hooligan","hoop","hoopla"
DATA "hoosegow","hoosier","hoot","hoover","hooves","hop","hope","hopeful","hopkins","hopkinsian","hopple","hopscotch","horace","horatio","horde","horehound","horizon","horizontal","hormone","horn"
DATA "hornbeam","hornblende","hornblower","hornet","hornmouth","horntail","hornwort","horny","horology","horoscope","horowitz","horrendous","horrible","horrid","horrify","horror","horse","horseback","horsedom","horseflesh"
DATA "horsefly","horsehair","horseman","horsemen","horseplay","horsepower","horseshoe","horsetail","horsewoman","horsewomen","horticulture","horton","horus","hose","hosiery","hospice","hospitable","hospital","host","hostage"
DATA "hostelry","hostess","hostile","hostler","hot","hotbed","hotbox","hotel","hotelman","hothead","hothouse","hotrod","hotshot","houdaille","houdini","hough","houghton","hound","hour","hourglass"
DATA "house","houseboat","housebreak","housebroken","housefly","household","housekeep","housewares","housewife","housewives","housework","houston","hove","hovel","hover","how","howard","howdy","howe","howell"
DATA "however","howl","howsoever","howsomever","hoy","hoyden","hoydenish","hoyt","hrothgar","hub","hubbard","hubbell","hubbub","hubby","huber","hubert","hubris","huck","huckleberry","huckster"
DATA "huddle","hudson","hue","hued","huff","huffman","hug","huge","hugging","huggins","hugh","hughes","hugo","huh","hulk","hull","hum","human","humane","humanitarian"
DATA "humanoid","humble","humboldt","humerus","humid","humidify","humidistat","humiliate","humility","hummel","hummingbird","hummock","humorous","hump","humpback","humphrey","humpty","humus","hun","hunch"
DATA "hundred","hundredfold","hundredth","hung","hungarian","hungary","hungry","hunk","hunt","hunter","huntington","huntley","huntsville","hurd","hurdle","hurl","hurley","huron","hurrah","hurray"
DATA "hurricane","hurry","hurst","hurt","hurtle","hurty","hurwitz","husband","husbandman","husbandmen","husbandry","hush","husky","hustle","huston","hut","hutch","hutchins","hutchinson","hutchison"
DATA "huxley","huxtable","huzzah","hyacinth","hyades","hyaline","hyannis","hybrid","hyde","hydra","hydrangea","hydrant","hydrate","hydraulic","hydride","hydro","hydrocarbon","hydrochemistry","hydrochloric","hydrochloride"
DATA "hydrodynamic","hydroelectric","hydrofluoric","hydrogen","hydrogenate","hydrology","hydrolysis","hydrometer","hydronium","hydrophilic","hydrophobia","hydrophobic","hydrosphere","hydrostatic","hydrothermal","hydrous","hydroxide","hydroxy","hydroxyl","hydroxylate"
DATA "hyena","hygiene","hygrometer","hygroscopic","hying","hyman","hymen","hymn","hymnal","hyperbola","hyperbolic","hyperboloid","hyperboloidal","hypertensive","hyphen","hyphenate","hypnosis","hypnotic","hypoactive","hypochlorite"
DATA "hypochlorous","hypocrisy","hypocrite","hypocritic","hypocritical","hypocycloid","hypodermic","hypophyseal","hypotenuse","hypothalamic","hypothalamus","hypotheses","hypothesis","hypothetic","hypothyroid","hysterectomy","hysteresis","hysteria","hysteric","hysteron"
DATA "i","i'd","i'll","i'm","i's","i've","i.e","ia","iambic","ian","iberia","ibex","ibid","ibis","ibm","ibn","icarus","icc","ice","iceberg"
DATA "icebox","iceland","icelandic","ichneumon","icicle","icky","icon","iconic","iconoclasm","iconoclast","icosahedra","icosahedral","icosahedron","icy","id","ida","idaho","idea","ideal","ideate"
DATA "idempotent","identical","identify","identity","ideolect","ideologue","ideology","idiocy","idiom","idiomatic","idiosyncrasy","idiosyncratic","idiot","idiotic","idle","idol","idolatry","idyll","idyllic","ieee"
DATA "if","iffy","ifni","igloo","igneous","ignite","ignition","ignoble","ignominious","ignoramus","ignorant","ignore","igor","ii","iii","ike","il","ileum","iliac","iliad"
DATA "ill","illegal","illegible","illegitimacy","illegitimate","illicit","illimitable","illinois","illiteracy","illiterate","illogic","illume","illuminate","illumine","illusion","illusionary","illusive","illusory","illustrate","illustrious"
DATA "ilona","ilyushin","image","imagen","imagery","imaginary","imaginate","imagine","imbalance","imbecile","imbibe","imbrium","imbroglio","imbrue","imbue","imitable","imitate","immaculate","immanent","immaterial"
DATA "immature","immeasurable","immediacy","immediate","immemorial","immense","immerse","immersion","immigrant","immigrate","imminent","immiscible","immobile","immobility","immoderate","immodest","immodesty","immoral","immortal","immovable"
DATA "immune","immunization","immunoelectrophoresis","immutable","imp","impact","impair","impale","impalpable","impart","impartation","impartial","impassable","impasse","impassion","impassive","impatient","impeach","impeccable","impedance"
DATA "impede","impediment","impel","impelled","impeller","impelling","impend","impenetrable","imperate","imperative","imperceivable","imperceptible","imperfect","imperial","imperil","imperious","imperishable","impermeable","impermissible","impersonal"
DATA "impersonate","impertinent","imperturbable","impervious","impetuous","impetus","impiety","impinge","impious","impish","implacable","implant","implantation","implausible","implement","implementation","implementer","implementor","implicant","implicate"
DATA "implicit","implode","implore","implosion","impolite","impolitic","imponderable","import","important","importation","importunate","importune","impose","imposition","impossible","impost","imposture","impotent","impound","impoverish"
DATA "impracticable","impractical","imprecate","imprecise","imprecision","impregnable","impregnate","impresario","impress","impressible","impression","impressive","imprimatur","imprint","imprison","improbable","impromptu","improper","impropriety","improve"
DATA "improvident","improvisate","improvisation","improvise","imprudent","impudent","impugn","impulse","impulsive","impunity","impure","imputation","impute","in","inability","inaccessible","inaccuracy","inaccurate","inaction","inactivate"
DATA "inactive","inadequacy","inadequate","inadmissible","inadvertent","inadvisable","inalienable","inalterable","inane","inanimate","inappeasable","inapplicable","inappreciable","inapproachable","inappropriate","inapt","inaptitude","inarticulate","inasmuch","inattention"
DATA "inattentive","inaudible","inaugural","inaugurate","inauspicious","inboard","inborn","inbred","inbreed","inc","inca","incalculable","incandescent","incant","incantation","incapable","incapacitate","incapacity","incarcerate","incarnate"
DATA "incaution","incautious","incendiary","incense","incentive","inception","inceptor","incessant","incest","incestuous","inch","incident","incidental","incinerate","incipient","incise","incisive","incite","inclement","inclination"
DATA "incline","inclose","include","inclusion","inclusive","incoherent","incombustible","income","incommensurable","incommensurate","incommunicable","incommutable","incomparable","incompatible","incompetent","incomplete","incompletion","incomprehensible","incomprehension","incompressible"
DATA "incomputable","inconceivable","inconclusive","incondensable","incongruity","incongruous","inconsequential","inconsiderable","inconsiderate","inconsistent","inconsolable","inconspicuous","inconstant","incontestable","incontrollable","incontrovertible","inconvenient","inconvertible","incorporable","incorporate"
DATA "incorrect","incorrigible","incorruptible","increasable","increase","incredible","incredulity","incredulous","increment","incriminate","incubate","incubi","incubus","inculcate","inculpable","incumbent","incur","incurred","incurrer","incurring"
DATA "incursion","indebted","indecent","indecipherable","indecision","indecisive","indecomposable","indeed","indefatigable","indefensible","indefinable","indefinite","indelible","indelicate","indemnify","indemnity","indent","indentation","indenture","independent"
DATA "indescribable","indestructible","indeterminable","indeterminacy","indeterminate","index","india","indian","indiana","indianapolis","indicant","indicate","indices","indict","indicter","indies","indifferent","indigene","indigenous","indigent"
DATA "indigestible","indigestion","indignant","indignation","indignity","indigo","indira","indirect","indiscernible","indiscoverable","indiscreet","indiscretion","indiscriminate","indispensable","indispose","indisposition","indisputable","indissoluble","indistinct","indistinguishable"
DATA "indium","individual","individualism","individuate","indivisible","indochina","indochinese","indoctrinate","indoeuropean","indolent","indomitable","indonesia","indoor","indorse","indubitable","induce","inducible","induct","inductance","inductee"
DATA "inductor","indulge","indulgent","industrial","industrialism","industrious","industry","indwell","indy","ineducable","ineffable","ineffective","ineffectual","inefficacy","inefficient","inelastic","inelegant","ineligible","ineluctable","inept"
DATA "inequality","inequitable","inequity","inequivalent","ineradicable","inert","inertance","inertia","inertial","inescapable","inestimable","inevitable","inexact","inexcusable","inexhaustible","inexorable","inexpedient","inexpensive","inexperience","inexpert"
DATA "inexpiable","inexplainable","inexplicable","inexplicit","inexpressible","inextinguishable","inextricable","infallible","infamous","infamy","infancy","infant","infantile","infantry","infantryman","infantrymen","infarct","infatuate","infeasible","infect"
DATA "infectious","infelicitous","infelicity","infer","inference","inferential","inferior","infernal","inferno","inferred","inferring","infertile","infest","infestation","infidel","infield","infight","infighting","infiltrate","infima"
DATA "infimum","infinite","infinitesimal","infinitive","infinitude","infinitum","infinity","infirm","infirmary","infix","inflame","inflammable","inflammation","inflammatory","inflate","inflater","inflationary","inflect","inflexible","inflict"
DATA "inflicter","inflow","influence","influent","influential","influenza","influx","info","inform","informal","informant","informatica","information","informative","infra","infract","infrared","infrastructure","infrequent","infringe"
DATA "infuriate","infuse","infusible","infusion","ingather","ingenious","ingenuity","ingenuous","ingersoll","ingest","ingestible","ingestion","inglorious","ingot","ingram","ingrate","ingratiate","ingratitude","ingredient","ingrown"
DATA "inhabit","inhabitant","inhabitation","inhalation","inhale","inharmonious","inhere","inherent","inherit","inheritance","inheritor","inhibit","inhibition","inhibitor","inhibitory","inholding","inhomogeneity","inhomogeneous","inhospitable","inhuman"
DATA "inhumane","inimical","inimitable","iniquitous","iniquity","initial","initiate","inject","injudicious","injun","injunct","injunction","injure","injurious","injury","injustice","ink","inkling","inlaid","inland"
DATA "inlay","inlet","inman","inmate","inn","innards","innate","inner","innermost","innkeeper","innocent","innocuous","innovate","innuendo","innumerable","inoculate","inoffensive","inoperable","inoperative","inopportune"
DATA "inordinate","inorganic","input","inputting","inquest","inquire","inquiry","inquisition","inquisitive","inquisitor","inroad","insane","insatiable","inscribe","inscription","inscrutable","insect","insecticide","insecure","inseminate"
DATA "insensible","insensitive","inseparable","insert","inset","inshore","inside","insidious","insight","insightful","insignia","insignificant","insincere","insinuate","insipid","insist","insistent","insofar","insolent","insoluble"
DATA "insolvable","insolvent","insomnia","insomniac","insouciant","inspect","inspector","inspiration","inspire","instable","install","installation","instalment","instance","instant","instantaneous","instantiate","instead","instep","instigate"
DATA "instill","instillation","instinct","instinctual","institute","institution","instruct","instructor","instrument","instrumentation","insubordinate","insubstantial","insufferable","insufficient","insular","insulate","insulin","insult","insuperable","insupportable"
DATA "insuppressible","insurance","insure","insurgent","insurmountable","insurrect","insurrection","intact","intake","intangible","integer","integrable","integral","integrand","integrate","integrity","integument","intellect","intellectual","intelligent"
DATA "intelligentsia","intelligible","intemperance","intemperate","intend","intendant","intense","intensify","intensive","intent","intention","inter","intercalate","intercept","interception","interceptor","intercom","interdict","interest","interfere"
DATA "interference","interferometer","interim","interior","interject","interlude","intermediary","intermit","intermittent","intern","internal","internecine","internescine","interpol","interpolant","interpolate","interpolatory","interpret","interpretation","interpretive"
DATA "interregnum","interrogate","interrogatory","interrupt","interruptible","interruption","intersect","intersperse","interstice","interstitial","interval","intervene","intervenor","intervention","interviewee","intestate","intestinal","intestine","intimacy","intimal"
DATA "intimate","intimater","intimidate","into","intolerable","intolerant","intonate","intone","intoxicant","intoxicate","intractable","intramolecular","intransigent","intransitive","intrepid","intricacy","intricate","intrigue","intrinsic","introduce"
DATA "introduction","introductory","introit","introject","introspect","introversion","introvert","intrude","intrusion","intrusive","intuit","intuitable","intuition","intuitive","inundate","inure","invade","invalid","invalidate","invaluable"
DATA "invariable","invariant","invasion","invasive","invective","inveigh","inveigle","invent","invention","inventive","inventor","inventory","inverness","inverse","inversion","invert","invertebrate","invertible","invest","investigate"
DATA "investigatory","investor","inveterate","inviable","invidious","invigorate","invincible","inviolable","inviolate","invisible","invitation","invite","invitee","invocate","invoice","invoke","involuntary","involute","involution","involutorial"
DATA "involutory","involve","invulnerable","inward","io","iodate","iodide","iodinate","iodine","ion","ionic","ionosphere","ionospheric","iota","iowa","ipecac","ipsilateral","ipso","iq","ir"
DATA "ira","iran","iranian","iraq","irate","ire","ireland","irene","iridium","iris","irish","irishman","irishmen","irk","irksome","irma","iron","ironic","ironside","ironstone"
DATA "ironwood","irony","iroquois","irradiate","irrational","irrawaddy","irreclaimable","irreconcilable","irrecoverable","irredeemable","irredentism","irredentist","irreducible","irrefutable","irregular","irrelevancy","irrelevant","irremediable","irremovable","irreparable"
DATA "irreplaceable","irrepressible","irreproachable","irreproducible","irresistible","irresolute","irresolution","irresolvable","irrespective","irresponsible","irretrievable","irreverent","irreversible","irrevocable","irrigate","irritable","irritant","irritate","irruption","irs"
DATA "irvin","irvine","irving","irwin","is","isaac","isaacson","isabel","isabella","isadore","isaiah","isentropic","isfahan","ising","isinglass","isis","islam","islamabad","islamic","island"
DATA "isle","isn't","isochronal","isochronous","isocline","isolate","isolde","isomer","isomorph","isomorphic","isopleth","isotherm","isothermal","isotope","isotopic","isotropic","isotropy","israel","israeli","israelite"
DATA "issuance","issuant","issue","istanbul","istvan","it","it&t","it'd","it'll","italian","italic","italy","itch","item","iterate","ithaca","itinerant","itinerary","ito","itself"
DATA "itt","iv","ivan","ivanhoe","iverson","ivory","ivy","ix","izvestia","j","j's","jab","jablonsky","jack","jackanapes","jackass","jackboot","jackdaw","jacket","jackie"
DATA "jackknife","jackman","jackpot","jackson","jacksonian","jacksonville","jacky","jacm","jacob","jacobean","jacobi","jacobian","jacobite","jacobs","jacobsen","jacobson","jacobus","jacqueline","jacques","jade"
DATA "jaeger","jag","jagging","jaguar","jail","jaime","jakarta","jake","jalopy","jam","jamaica","jamboree","james","jamestown","jan","jane","janeiro","janet","jangle","janice"
DATA "janissary","janitor","janitorial","janos","jansenist","january","janus","japan","japanese","jar","jargon","jarvin","jason","jasper","jaundice","jaunty","java","javelin","jaw","jawbone"
DATA "jawbreak","jay","jazz","jazzy","jealous","jealousy","jean","jeannie","jed","jeep","jeff","jefferson","jeffersonian","jeffrey","jehovah","jejune","jejunum","jelly","jellyfish","jenkins"
DATA "jennie","jennifer","jennings","jenny","jensen","jeopard","jeopardy","jeremiah","jeremy","jeres","jericho","jerk","jerky","jeroboam","jerome","jerry","jersey","jerusalem","jess","jesse"
DATA "jessica","jessie","jest","jesuit","jesus","jet","jetliner","jettison","jew","jewel","jewell","jewelry","jewett","jewish","jibe","jiffy","jig","jigging","jiggle","jigsaw"
DATA "jill","jilt","jim","jimenez","jimmie","jimmy","jingle","jinx","jitter","jitterbug","jitterbugger","jitterbugging","jittery","jive","jo","joan","joanna","joanne","joaquin","job"
DATA "jobholder","jock","jockey","jockstrap","jocose","jocular","jocund","joe","joel","joey","jog","jogging","joggle","johann","johannes","johannesburg","johansen","johanson","john","johnny"
DATA "johns","johnsen","johnson","johnston","johnstown","join","joint","joke","joliet","jolla","jolly","jolt","jon","jonas","jonathan","jones","jonquil","jordan","jorge","jorgensen"
DATA "jorgenson","jose","josef","joseph","josephine","josephson","josephus","joshua","josiah","joss","jostle","jot","joule","jounce","journal","journalese","journey","journeyman","journeymen","joust"
DATA "jovanovich","jove","jovial","jovian","jowl","jowly","joy","joyce","joyful","joyous","joyride","joystick","jr","juan","juanita","jubilant","jubilate","jubilee","judaism","judas"
DATA "judd","jude","judge","judicable","judicatory","judicature","judicial","judiciary","judicious","judith","judo","judson","judy","jug","jugate","jugging","juggle","jugoslavia","juice","juicy"
DATA "juju","jujube","juke","jukes","julep","jules","julia","julie","juliet","julio","julius","july","jumble","jumbo","jump","jumpy","junco","junction","junctor","juncture"
DATA "june","juneau","jungle","junior","juniper","junk","junkerdom","junketeer","junky","juno","junta","jupiter","jura","jurassic","jure","juridic","jurisdiction","jurisprudent","jurisprudential","juror"
DATA "jury","just","justice","justiciable","justify","justine","justinian","jut","jute","jutish","juvenile","juxtapose","juxtaposition","k","k's","kabuki","kabul","kaddish","kafka","kafkaesque"
DATA "kahn","kaiser","kajar","kalamazoo","kale","kaleidescope","kaleidoscope","kalmia","kalmuk","kamchatka","kamikaze","kampala","kane","kangaroo","kankakee","kansas","kant","kaolin","kaolinite","kaplan"
DATA "kapok","kappa","karachi","karamazov","karate","karen","karl","karma","karol","karp","karyatid","kaskaskia","kate","katharine","katherine","kathleen","kathy","katie","katmandu","katowice"
DATA "katz","kauffman","kaufman","kava","kay","kayo","kazoo","keaton","keats","keddah","keel","keelson","keen","keenan","keep","keeshond","keg","keith","keller","kelley"
DATA "kellogg","kelly","kelp","kelsey","kelvin","kemp","ken","kendall","kennan","kennecott","kennedy","kennel","kenneth","kenney","keno","kensington","kent","kenton","kentucky","kenya"
DATA "kenyon","kepler","kept","kerchief","kermit","kern","kernel","kernighan","kerosene","kerr","kerry","kerygma","kessler","kestrel","ketch","ketchup","ketone","ketosis","kettering","kettle"
DATA "kevin","key","keyboard","keyed","keyes","keyhole","keynes","keynesian","keynote","keypunch","keys","keystone","keyword","khaki","khan","khartoum","khmer","khrushchev","kibbutzim","kibitz"
DATA "kick","kickback","kickoff","kid","kidde","kiddie","kidnap","kidnapped","kidnapping","kidney","kieffer","kiev","kiewit","kigali","kikuyu","kilgore","kill","killdeer","killjoy","kilo"
DATA "kilohm","kim","kimball","kimberly","kimono","kin","kind","kindergarten","kindle","kindred","kinematic","kinesic","kinesthesis","kinetic","king","kingbird","kingdom","kingfisher","kinglet","kingpin"
DATA "kingsbury","kingsley","kingston","kink","kinky","kinney","kinshasha","kiosk","kiowa","kipling","kirby","kirchner","kirchoff","kirk","kirkland","kirkpatrick","kirov","kiss","kissing","kit"
DATA "kitakyushu","kitchen","kitchenette","kite","kitten","kittenish","kittle","kitty","kiva","kivu","kiwanis","kiwi","klan","klaus","klaxon","kleenex","klein","kline","klux","klystron"
DATA "knack","knapp","knapsack","knauer","knead","knee","kneecap","kneel","knell","knelt","knew","knick","knickerbocker","knife","knifelike","knight","knightsbridge","knit","knives","knob"
DATA "knobby","knock","knockdown","knockout","knoll","knot","knott","knotty","know","knoweth","knowhow","knowledge","knowledgeable","knowles","knowlton","known","knox","knoxville","knuckle","knuckleball"
DATA "knudsen","knudson","knurl","knutsen","knutson","koala","kobayashi","koch","kochab","kodachrome","kodak","kodiak","koenig","koenigsberg","kohlrabi","koinonia","kola","kolkhoz","kombu","kong"
DATA "konrad","koppers","koran","korea","kosher","kovacs","kowalewski","kowalski","kowloon","kraft","krakatoa","krakow","kramer","krause","kraut","krebs","kremlin","kresge","krieger","krishna"
DATA "kristin","kronecker","krueger","kruger","kruse","krypton","ks","ku","kudo","kudzu","kuhn","kulak","kumquat","kurd","kurt","kuwait","kwashiorkor","ky","kyle","kyoto"
DATA "l","l'oeil","l's","l'vov","la","lab","laban","label","labia","labial","labile","lability","laboratory","laborious","labour","labrador","labradorite","labyrinth","lac","lace"
DATA "lacerate","lacerta","lacewing","lachesis","lack","lackadaisic","lackey","lackluster","laconic","lacquer","lacrosse","lactate","lactose","lacuna","lacunae","lacustrine","lacy","lad","laden","ladle"
DATA "lady","ladyfern","ladylike","lafayette","lag","lager","lagging","lagoon","lagos","lagrange","lagrangian","laguerre","lahore","laid","laidlaw","lain","lair","laissez","laity","lake"
DATA "lakehurst","lakeside","lam","lamar","lamarck","lamb","lambda","lambert","lame","lamellar","lament","lamentation","laminar","laminate","lamp","lampblack","lamplight","lampoon","lamprey","lana"
DATA "lancashire","lancaster","lance","land","landau","landfill","landhold","landis","landlord","landmark","landowner","landscape","landslide","lane","lang","lange","langley","langmuir","language","languid"
DATA "languish","lank","lanka","lanky","lansing","lantern","lanthanide","lanthanum","lao","laocoon","laos","laotian","lap","lapel","lapelled","lapidary","laplace","laplacian","lappet","lapse"
DATA "laramie","larceny","larch","lard","laredo","lares","large","largemouth","largesse","lariat","lark","larkin","larkspur","larry","lars","larsen","larson","larva","larvae","larval"
DATA "laryngeal","larynges","larynx","lascar","lascivious","lase","lash","lass","lasso","last","laszlo","latch","late","latent","later","latera","lateral","lateran","laterite","latex"
DATA "lath","lathe","lathrop","latin","latinate","latitude","latitudinal","latitudinary","latrobe","latter","lattice","latus","latvia","laud","laudanum","laudatory","lauderdale","laue","laugh","laughingstock"
DATA "laughlin","laughter","launch","launder","laundry","laura","laureate","laurel","lauren","laurence","laurent","laurentian","laurie","lausanne","lava","lavabo","lavatory","lavender","lavish","lavoisier"
DATA "law","lawbreak","lawbreaker","lawbreaking","lawful","lawgive","lawgiver","lawgiving","lawmake","lawman","lawmen","lawn","lawrence","lawrencium","lawson","lawsuit","lawyer","lax","laxative","lay"
DATA "layette","layman","laymen","layoff","layout","layton","layup","lazarus","laze","lazy","lazybones","lea","leach","leachate","lead","leaden","leadeth","leadsman","leadsmen","leaf"
DATA "leaflet","leafy","league","leak","leakage","leaky","lean","leander","leap","leapfrog","leapt","lear","learn","lease","leasehold","leash","least","leather","leatherback","leatherneck"
DATA "leatherwork","leathery","leave","leaven","leavenworth","lebanese","lebanon","lebensraum","lebesgue","lecher","lechery","lectern","lectionary","lecture","led","ledge","lee","leech","leeds","leek"
DATA "leer","leery","leeuwenhoek","leeward","leeway","left","leftmost","leftover","leftward","lefty","leg","legacy","legal","legate","legatee","legato","legend","legendary","legendre","legerdemain"
DATA "legging","leggy","leghorn","legible","legion","legislate","legislature","legitimacy","legitimate","legume","leguminous","lehigh","lehman","leigh","leighton","leila","leisure","leitmotif","leitmotiv","leland"
DATA "lemma","lemming","lemon","lemonade","lemuel","len","lena","lend","length","lengthen","lengthwise","lengthy","lenient","lenin","leningrad","leninism","leninist","lennox","lenny","lenore"
DATA "lens","lent","lenten","lenticular","lentil","leo","leon","leona","leonard","leonardo","leone","leonid","leonine","leopard","leopold","leper","lepidolite","leprosy","leroy","lesbian"
DATA "lesion","leslie","lesotho","less","lessee","lessen","lesson","lessor","lest","lester","let","lethal","lethargic","lethargy","lethe","letitia","letterhead","letterman","lettermen","lettuce"
DATA "leucine","leukemia","lev","levee","level","lever","leverage","levi","levin","levine","levis","levitate","leviticus","levitt","levity","levulose","levy","lew","lewd","lewis"
DATA "lexical","lexicography","lexicon","lexington","leyden","liable","liaison","liar","libation","libel","libelous","liberal","liberate","liberia","libertarian","libertine","liberty","libidinous","libido","librarian"
DATA "library","librate","librettist","libretto","libreville","libya","lice","licensable","licensee","licensor","licentious","lichen","lick","licorice","lid","lie","liechtenstein","lied","lien","lieu"
DATA "lieutenant","life","lifeblood","lifeboat","lifeguard","lifelike","lifelong","lifespan","lifestyle","lifetime","lifo","lift","ligament","ligand","ligature","ligget","liggett","light","lighten","lightface"
DATA "lighthearted","lighthouse","lightning","lightproof","lightweight","lignite","lignum","like","liken","likewise","lila","lilac","lilian","lillian","lilliputian","lilly","lilt","lily","lim","lima"
DATA "limb","limbic","limbo","lime","limelight","limerick","limestone","limit","limitate","limitation","limousine","limp","limpet","limpid","limpkin","lin","lincoln","lind","linda","lindberg"
DATA "lindbergh","linden","lindholm","lindquist","lindsay","lindsey","lindstrom","line","lineage","lineal","linear","linebacker","lineman","linemen","linen","lineprinter","lineup","linger","lingerie","lingo"
DATA "lingua","lingual","linguist","liniment","link","linkage","linoleum","linotype","linseed","lint","linus","lion","lionel","lioness","lip","lipid","lippincott","lipread","lipschitz","lipscomb"
DATA "lipstick","lipton","liquefaction","liquefy","liqueur","liquid","liquidate","liquidus","liquor","lisa","lisbon","lise","lisle","lisp","lissajous","list","listen","lit","litany","literacy"
DATA "literal","literary","literate","literature","lithe","lithic","lithium","lithograph","lithography","lithology","lithosphere","lithospheric","lithuania","litigant","litigate","litigious","litmus","litterbug","little","littleneck"
DATA "littleton","litton","littoral","liturgic","liturgy","live","liven","livermore","liverpool","liverpudlian","liverwort","livery","livestock","liveth","livid","livingston","livre","liz","lizard","lizzie"
DATA "lloyd","lo","load","loaf","loam","loamy","loan","loath","loathe","loathsome","loaves","lob","lobar","lobby","lobe","loblolly","lobo","lobotomy","lobscouse","lobster"
DATA "lobular","lobule","local","locale","locate","loci","lock","locke","lockhart","lockheed","lockian","locknut","lockout","locksmith","lockstep","lockup","lockwood","locomote","locomotion","locomotive"
DATA "locomotor","locomotory","locoweed","locus","locust","locution","locutor","lodestone","lodge","lodgepole","lodowick","loeb","loess","loft","lofty","log","logan","logarithm","logarithmic","loge"
DATA "loggerhead","logging","logic","logician","logistic","logjam","logo","loin","loincloth","loire","lois","loiter","loki","lola","loll","lollipop","lolly","lomb","lombard","lombardy"
DATA "lome","london","lone","lonesome","long","longevity","longfellow","longhand","longhorn","longish","longitude","longitudinal","longleg","longstanding","longtime","longue","look","lookout","lookup","loom"
DATA "loomis","loon","loop","loophole","loose","looseleaf","loosen","loosestrife","loot","lop","lope","lopez","lopseed","lopsided","loquacious","loquacity","loquat","lord","lordosis","lore"
DATA "lorelei","loren","lorenz","loretta","lorinda","lorraine","los","losable","lose","loss","lossy","lost","lot","lotion","lotte","lottery","lottie","lotus","lou","loud"
DATA "loudspeak","loudspeaker","loudspeaking","louis","louisa","louise","louisiana","louisville","lounge","lounsbury","lourdes","louse","lousewort","lousy","louver","louvre","love","lovebird","lovelace","loveland"
DATA "lovelorn","low","lowboy","lowdown","lowe","lowell","lower","lowland","lowry","loy","loyal","loyalty","lozenge","lsi","ltd","ltv","lubbock","lubell","lubricant","lubricate"
DATA "lubricious","lubricity","lucas","lucerne","lucia","lucian","lucid","lucifer","lucille","lucius","luck","lucky","lucrative","lucre","lucretia","lucretius","lucy","ludicrous","ludlow","ludwig"
DATA "lufthansa","luftwaffe","lug","luge","luger","luggage","lugging","luis","luke","lukemia","lukewarm","lull","lullaby","lulu","lumbar","lumber","lumberman","lumbermen","lumen","luminance"
DATA "luminary","luminescent","luminosity","luminous","lummox","lump","lumpish","lumpur","lumpy","lunacy","lunar","lunary","lunate","lunatic","lunch","luncheon","lunchroom","lunchtime","lund","lundberg"
DATA "lundquist","lung","lunge","lupine","lura","lurch","lure","lurid","lurk","lusaka","luscious","lush","lust","lustful","lustrous","lusty","lutanist","lute","lutetium","luther"
DATA "lutheran","lutz","lux","luxe","luxembourg","luxuriant","luxuriate","luxurious","luxury","luzon","lycopodium","lydia","lye","lying","lykes","lyle","lyman","lymph","lymphocyte","lymphoma"
DATA "lynch","lynchburg","lynn","lynx","lyon","lyons","lyra","lyric","lyricism","lysenko","lysergic","lysine","m","m's","ma","mabel","mac","macabre","macaque","macarthur"
DATA "macassar","macbeth","macdonald","macdougall","mace","macedon","macedonia","macgregor","mach","machiavelli","machination","machine","machinelike","machinery","machismo","macho","macintosh","mack","mackenzie","mackerel"
DATA "mackey","mackinac","mackinaw","mackintosh","macmillan","macon","macrame","macro","macromolecular","macromolecule","macrophage","macroprocessor","macroscopic","macrostructure","mad","madagascar","madam","madame","madcap","madden"
DATA "maddox","made","madeira","madeleine","madeline","madhouse","madison","madman","madmen","madonna","madras","madrid","madrigal","madsen","madstone","mae","maelstrom","maestro","mafia","magazine"
DATA "magdalene","magenta","maggie","maggot","maggoty","magi","magic","magician","magisterial","magistrate","magma","magna","magnanimity","magnanimous","magnate","magnesia","magnesite","magnesium","magnet","magnetic"
DATA "magnetite","magneto","magnetron","magnificent","magnify","magnitude","magnolia","magnum","magnuson","magog","magpie","magruder","mahayana","mahayanist","mahogany","mahoney","maid","maiden","maidenhair","maidservant"
DATA "maier","mail","mailbox","mailman","mailmen","maim","main","maine","mainland","mainline","mainstay","mainstream","maintain","maintenance","maitre","majestic","majesty","major","make","makeshift"
DATA "makeup","malabar","maladapt","maladaptive","maladjust","maladroit","malady","malagasy","malaise","malaprop","malaria","malarial","malawi","malay","malaysia","malcolm","malconduct","malcontent","malden","maldistribute"
DATA "maldive","male","maledict","malefactor","malevolent","malfeasant","malformation","malformed","malfunction","mali","malice","malicious","malign","malignant","mall","mallard","malleable","mallet","mallory","mallow"
DATA "malnourished","malnutrition","malocclusion","malone","maloney","malposed","malpractice","malraux","malt","malta","maltese","malton","maltose","maltreat","mambo","mamma","mammal","mammalian","mammoth","man"
DATA "mana","manage","manageable","managerial","managua","manama","manatee","manchester","mandamus","mandarin","mandate","mandatory","mandrake","mandrel","mandrill","mane","maneuver","manfred","manganese","mange"
DATA "mangel","mangle","manhattan","manhole","manhood","mania","maniac","maniacal","manic","manifest","manifestation","manifold","manikin","manila","manipulable","manipulate","manitoba","mankind","manley","mann"
DATA "manna","mannequin","mannerism","manometer","manor","manpower","mans","manse","manservant","mansfield","mansion","manslaughter","mantel","mantic","mantis","mantissa","mantle","mantlepiece","mantrap","manual"
DATA "manuel","manufacture","manumission","manumit","manumitted","manure","manuscript","manville","many","manzanita","mao","maori","map","maple","mar","marathon","maraud","marble","marc","marceau"
DATA "marcel","marcello","march","marcia","marco","marcus","marcy","mardi","mare","margaret","margarine","margery","margin","marginal","marginalia","margo","marguerite","maria","marianne","marie"
DATA "marietta","marigold","marijuana","marilyn","marimba","marin","marina","marinade","marinate","marine","marino","mario","marion","marionette","marital","maritime","marjoram","marjorie","marjory","mark"
DATA "market","marketeer","marketplace","marketwise","markham","markov","markovian","marks","marksman","marksmen","marlboro","marlborough","marlene","marlin","marlowe","marmalade","marmot","maroon","marque","marquee"
DATA "marquess","marquette","marquis","marriage","marriageable","married","marrietta","marriott","marrow","marrowbone","marry","mars","marseilles","marsh","marsha","marshal","marshall","marshland","marshmallow","marsupial"
DATA "mart","marten","martensite","martha","martial","martian","martin","martinez","martingale","martini","martinique","martinson","marty","martyr","martyrdom","marvel","marvelous","marvin","marx","mary"
DATA "maryland","mascara","masculine","maser","maseru","mash","mask","masochism","masochist","mason","masonic","masonite","masonry","masque","masquerade","mass","massachusetts","massacre","massage","masseur"
DATA "massey","massif","massive","mast","masterful","mastermind","masterpiece","mastery","mastic","mastiff","mastodon","masturbate","mat","match","matchbook","matchmake","mate","mateo","mater","material"
DATA "materiel","maternal","maternity","math","mathematic","mathematician","mathematik","mathews","mathewson","mathias","mathieu","matilda","matinal","matinee","matins","matisse","matriarch","matriarchal","matrices","matriculate"
DATA "matrimonial","matrimony","matrix","matroid","matron","matson","matsumoto","matte","matthew","matthews","mattock","mattress","mattson","maturate","mature","maudlin","maul","maureen","maurice","mauricio"
DATA "maurine","mauritania","mauritius","mausoleum","mauve","maverick","mavis","maw","mawkish","mawr","max","maxim","maxima","maximal","maximilian","maximum","maxine","maxwell","maxwellian","may"
DATA "maya","mayapple","maybe","mayer","mayfair","mayflower","mayhem","maynard","mayo","mayonnaise","mayor","mayoral","mayst","mazda","maze","mazurka","mba","mbabane","mcadams","mcallister"
DATA "mcbride","mccabe","mccall","mccallum","mccann","mccarthy","mccarty","mccauley","mcclain","mcclellan","mcclure","mccluskey","mcconnel","mcconnell","mccormick","mccoy","mccracken","mccullough","mcdaniel","mcdermott"
DATA "mcdonald","mcdonnell","mcdougall","mcdowell","mcelroy","mcfadden","mcfarland","mcgee","mcgill","mcginnis","mcgovern","mcgowan","mcgrath","mcgraw","mcgregor","mcguire","mchugh","mcintosh","mcintyre","mckay"
DATA "mckee","mckenna","mckenzie","mckeon","mckesson","mckinley","mckinney","mcknight","mclaughlin","mclean","mcleod","mcmahon","mcmillan","mcmullen","mcnally","mcnaughton","mcneil","mcnulty","mcpherson","md"
DATA "me","mead","meadow","meadowland","meadowsweet","meager","meal","mealtime","mealy","mean","meander","meaningful","meant","meantime","meanwhile","measle","measure","meat","meaty","mecca"
DATA "mechanic","mechanism","mechanist","mecum","medal","medallion","meddle","medea","medford","media","medial","median","mediate","medic","medicate","medici","medicinal","medicine","medico","mediocre"
DATA "mediocrity","meditate","mediterranean","medium","medlar","medley","medusa","meek","meet","meetinghouse","meg","megabit","megabyte","megahertz","megalomania","megalomaniac","megaton","megavolt","megawatt","megaword"
DATA "megohm","meier","meiosis","meistersinger","mekong","mel","melamine","melancholy","melanesia","melange","melanie","melanin","melanoma","melbourne","melcher","meld","melee","melinda","meliorate","melissa"
DATA "mellon","mellow","melodic","melodious","melodrama","melodramatic","melody","melon","melpomene","melt","meltdown","meltwater","melville","melvin","member","membrane","memento","memo","memoir","memorabilia"
DATA "memorable","memoranda","memorandum","memorial","memory","memphis","men","menace","menagerie","menarche","mend","mendacious","mendacity","mendel","mendelevium","mendelssohn","menelaus","menfolk","menhaden","menial"
DATA "meningitis","meniscus","menlo","mennonite","menopause","menstruate","mensurable","mensuration","mental","mention","mentor","menu","menzies","mephistopheles","mercantile","mercator","mercedes","mercenary","mercer","merchandise"
DATA "merchant","merciful","mercilessly","merck","mercurial","mercuric","mercury","mercy","mere","meredith","meretricious","merganser","merge","meridian","meridional","meringue","merit","meritorious","merle","merlin"
DATA "mermaid","merriam","merrill","merrimack","merriment","merritt","merry","merrymake","mervin","mesa","mescal","mescaline","mesenteric","mesh","mesmeric","mesoderm","meson","mesopotamia","mesozoic","mesquite"
DATA "mess","message","messenger","messiah","messieurs","messrs","messy","met","metabole","metabolic","metabolism","metabolite","metal","metallic","metalliferous","metallography","metalloid","metallurgic","metallurgist","metallurgy"
DATA "metalwork","metamorphic","metamorphism","metamorphose","metamorphosis","metaphor","metaphoric","metcalf","mete","meteor","meteoric","meteorite","meteoritic","meteorology","meter","methacrylate","methane","methanol","methionine","method"
DATA "methodic","methodism","methodist","methodology","methuen","methuselah","methyl","methylene","meticulous","metier","metric","metro","metronome","metropolis","metropolitan","mettle","mettlesome","metzler","mew","mexican"
DATA "mexico","meyer","meyers","mezzanine","mezzo","mi","miami","miasma","miasmal","mica","mice","michael","michaelangelo","michel","michelangelo","michele","michelin","michelson","michigan","mickelson"
DATA "mickey","micky","micro","microbial","microcosm","microfiche","micrography","microjoule","micron","micronesia","microscopy","mid","midas","midband","midday","middle","middlebury","middleman","middlemen","middlesex"
DATA "middleton","middletown","middleweight","midge","midget","midland","midmorn","midnight","midpoint","midrange","midscale","midsection","midshipman","midshipmen","midspan","midst","midstream","midterm","midway","midweek"
DATA "midwest","midwestern","midwife","midwinter","midwives","mien","miff","mig","might","mightn't","mighty","mignon","migrant","migrate","migratory","miguel","mike","mila","milan","milch"
DATA "mild","mildew","mildred","mile","mileage","miles","milestone","milieu","militant","militarism","militarist","military","militate","militia","militiamen","milk","milkweed","milky","mill","millard"
DATA "millenarian","millenia","millennia","millennium","miller","millet","millie","millikan","millinery","million","millionaire","millions","millionth","millipede","mills","millstone","milord","milt","milton","miltonic"
DATA "milwaukee","mimeograph","mimesis","mimetic","mimi","mimic","mimicked","mimicking","min","minaret","mince","mincemeat","mind","mindanao","mindful","mine","minefield","mineral","mineralogy","minerva"
DATA "minestrone","minesweeper","mingle","mini","miniature","minibike","minicomputer","minim","minima","minimal","minimax","minimum","minion","ministerial","ministry","mink","minneapolis","minnesota","minnie","minnow"
DATA "minoan","minor","minos","minot","minsk","minsky","minstrel","minstrelsy","mint","minuend","minuet","minus","minuscule","minute","minuteman","minutemen","minutiae","miocene","mira","miracle"
DATA "miraculous","mirage","miranda","mire","mirfak","miriam","mirror","mirth","misanthrope","misanthropic","miscegenation","miscellaneous","miscellany","mischievous","miscible","miscreant","miser","misery","misnomer","misogynist"
DATA "misogyny","mispronunciation","miss","misshapen","missile","mission","missionary","mississippi","mississippian","missive","missoula","missouri","missy","mist","mistletoe","mistress","misty","mit","mitchell","mite"
DATA "miterwort","mitigate","mitochondria","mitosis","mitral","mitre","mitt","mitten","mix","mixture","mixup","mizar","mn","mnemonic","mo","moan","moat","mob","mobcap","mobil"
DATA "mobile","mobility","mobster","moccasin","mock","mockernut","mockery","mockingbird","mockup","modal","mode","model","modem","moderate","modern","modest","modesto","modesty","modicum","modify"
DATA "modish","modular","modulate","module","moduli","modulo","modulus","modus","moe","moen","mogadiscio","mohammedan","mohawk","mohr","moiety","moines","moire","moiseyev","moist","moisten"
DATA "moisture","molal","molar","molasses","mold","moldavia","moldboard","mole","molecular","molecule","molehill","molest","moliere","moline","moll","mollie","mollify","mollusk","molly","mollycoddle"
DATA "moloch","molt","molten","moluccas","molybdate","molybdenite","molybdenum","moment","momenta","momentary","momentous","momentum","mommy","mona","monaco","monad","monadic","monarch","monarchic","monarchy"
DATA "monash","monastery","monastic","monaural","monday","monel","monetarism","monetarist","monetary","money","moneymake","moneywort","mongolia","mongoose","monic","monica","monies","monitor","monitory","monk"
DATA "monkey","monkeyflower","monkish","monmouth","monoceros","monochromatic","monochromator","monocotyledon","monocular","monogamous","monogamy","monoid","monolith","monologist","monologue","monomer","monomeric","monomial","monongahela","monopoly"
DATA "monotonous","monotreme","monoxide","monroe","monrovia","monsanto","monsieur","monsoon","monster","monstrosity","monstrous","mont","montage","montague","montana","montclair","monte","montenegrin","monterey","monteverdi"
DATA "montevideo","montgomery","month","monticello","montmartre","montpelier","montrachet","montreal","monty","monument","moo","mood","moody","moon","mooney","moonlight","moonlit","moor","moore","moorish"
DATA "moose","moot","mop","moraine","moral","morale","moran","morass","moratorium","moravia","morbid","more","morel","moreland","moreover","moresby","morgan","morgen","morgue","moriarty"
DATA "moribund","morley","mormon","morn","moroccan","morocco","moron","morose","morpheme","morphemic","morphine","morphism","morphology","morphophonemic","morrill","morris","morrison","morrissey","morristown","morrow"
DATA "morse","morsel","mort","mortal","mortar","mortem","mortgage","mortgagee","mortgagor","mortician","mortify","mortise","morton","mosaic","moscow","moser","moses","moslem","mosque","mosquito"
DATA "moss","mossy","most","mot","motel","motet","moth","mothball","mother","motherhood","motherland","motif","motion","motivate","motive","motley","motor","motorcycle","motorola","mottle"
DATA "motto","mould","moulton","mound","mount","mountain","mountaineer","mountainous","mountainside","mourn","mournful","mouse","moustache","mousy","mouth","mouthful","mouthpiece","mouton","move","movie"
DATA "mow","moyer","mozart","mph","mr","mrs","ms","mt","mu","much","mucilage","muck","mucosa","mucus","mud","mudd","muddle","muddlehead","muddy","mudguard"
DATA "mudsling","mueller","muezzin","muff","muffin","muffle","mug","mugging","muggy","mugho","muir","mukden","mulatto","mulberry","mulch","mulct","mule","mulish","mull","mullah"
DATA "mullein","mullen","mulligan","mulligatawny","mullion","multi","multifarious","multinomial","multiple","multiplet","multiplex","multiplexor","multipliable","multiplicand","multiplication","multiplicative","multiplicity","multiply","multitude","multitudinous"
DATA "mum","mumble","mumford","mummy","munch","muncie","mundane","mung","munich","municipal","munificent","munition","munson","muon","muong","mural","murder","murderous","muriatic","muriel"
DATA "murk","murky","murmur","murphy","murray","murre","muscat","muscle","muscovite","muscovy","muscular","musculature","muse","museum","mush","mushroom","mushy","music","musicale","musician"
DATA "musicology","musk","muskegon","muskellunge","musket","muskmelon","muskox","muskoxen","muskrat","muslim","muslin","mussel","must","mustache","mustachio","mustang","mustard","mustn't","musty","mutagen"
DATA "mutandis","mutant","mutate","mutatis","mute","mutilate","mutineer","mutiny","mutt","mutter","mutton","mutual","mutuel","muzak","muzo","muzzle","my","mycenae","mycenaean","mycobacteria"
DATA "mycology","myel","myeline","myeloid","myers","mylar","mynah","mynheer","myocardial","myocardium","myofibril","myoglobin","myopia","myopic","myosin","myra","myriad","myron","myrrh","myrtle"
DATA "myself","mysterious","mystery","mystic","mystify","mystique","myth","mythic","mythology","n","n's","naacp","nab","nabisco","nabla","nadia","nadine","nadir","nag","nagasaki"
DATA "nagging","nagoya","nagy","naiad","nail","nair","nairobi","naive","naivete","nakayama","naked","name","nameable","nameplate","namesake","nan","nancy","nanette","nanking","nanometer"
DATA "nanosecond","nantucket","naomi","nap","nape","napkin","naples","napoleon","napoleonic","narbonne","narcissism","narcissist","narcissus","narcosis","narcotic","narragansett","narrate","narrow","nary","nasa"
DATA "nasal","nascent","nash","nashua","nashville","nassau","nasturtium","nasty","nat","natal","natalie","natchez","nate","nathan","nathaniel","nation","nationhood","nationwide","native","nato"
DATA "natty","natural","nature","naturopath","naughty","nausea","nauseate","nauseum","nautical","nautilus","navajo","naval","nave","navel","navigable","navigate","navy","nay","nazarene","nazareth"
DATA "nazi","nazism","nbc","nbs","nc","ncaa","ncar","nco","ncr","nd","ndjamena","ne","neal","neanderthal","neap","neapolitan","near","nearby","nearest","nearsighted"
DATA "neat","neater","neath","nebraska","nebula","nebulae","nebular","nebulous","necessary","necessitate","necessity","neck","necklace","neckline","necktie","necromancer","necromancy","necromantic","necropsy","necrosis"
DATA "necrotic","nectar","nectareous","nectarine","nectary","ned","nee","need","needful","needham","needle","needlepoint","needlework","needn't","needy","neff","negate","neglect","neglecter","negligee"
DATA "negligent","negligible","negotiable","negotiate","negro","negroes","negroid","nehru","neil","neither","nell","nellie","nelsen","nelson","nemesis","neoclassic","neoconservative","neodymium","neolithic","neologism"
DATA "neon","neonatal","neonate","neophyte","neoprene","nepal","nepenthe","nephew","neptune","neptunium","nereid","nero","nerve","nervous","ness","nest","nestle","nestor","net","nether"
DATA "netherlands","netherworld","nettle","nettlesome","network","neumann","neural","neuralgia","neurasthenic","neuritis","neuroanatomic","neuroanatomy","neuroanotomy","neurology","neuromuscular","neuron","neuronal","neuropathology","neurophysiology","neuropsychiatric"
DATA "neuroses","neurosis","neurotic","neuter","neutral","neutrino","neutron","neva","nevada","neve","never","nevertheless","nevins","new","newark","newbold","newborn","newcastle","newcomer","newel"
DATA "newell","newfound","newfoundland","newline","newlywed","newman","newport","newsboy","newscast","newsletter","newsman","newsmen","newspaper","newspaperman","newspapermen","newsreel","newsstand","newsweek","newt","newton"
DATA "newtonian","next","nguyen","nh","niacin","niagara","niamey","nib","nibble","nibelung","nibs","nicaragua","nice","nicety","niche","nicholas","nicholls","nichols","nicholson","nichrome"
DATA "nick","nickel","nickname","nicodemus","nicosia","nicotinamide","nicotine","niece","nielsen","nielson","nietzsche","niger","nigeria","niggardly","nigger","niggle","nigh","night","nightcap","nightclub"
DATA "nightdress","nightfall","nightgown","nighthawk","nightingale","nightmare","nightmarish","nightshirt","nighttime","nih","nihilism","nihilist","nikko","nikolai","nil","nile","nilpotent","nimble","nimbus","nimh"
DATA "nina","nine","ninebark","ninefold","nineteen","nineteenth","ninetieth","ninety","nineveh","ninth","niobe","niobium","nip","nipple","nippon","nirvana","nit","nitpick","nitrate","nitric"
DATA "nitride","nitrite","nitrogen","nitrogenous","nitroglycerine","nitrous","nitty","nixon","nj","nm","nne","nnw","no","noaa","noah","nob","nobel","nobelium","noble","nobleman"
DATA "noblemen","noblesse","nobody","nobody'd","nocturnal","nocturne","nod","nodal","node","nodular","nodule","noel","noetherian","noise","noisemake","noisy","nolan","noll","nolo","nomad"
DATA "nomadic","nomenclature","nominal","nominate","nominee","nomogram","nomograph","non","nonagenarian","nonce","nonchalant","nondescript","none","nonetheless","nonogenarian","nonsensic","nonsensical","noodle","nook","noon"
DATA "noontime","noose","nor","nora","nordhoff","nordstrom","noreen","norfolk","norm","norma","normal","normalcy","norman","normandy","normative","norris","north","northampton","northbound","northeast"
DATA "northeastern","northerly","northern","northernmost","northland","northrop","northrup","northumberland","northward","northwest","northwestern","norton","norwalk","norway","norwegian","norwich","nose","nosebag","nosebleed","nostalgia"
DATA "nostalgic","nostradamus","nostrand","nostril","not","notary","notate","notch","note","notebook","noteworthy","nothing","notice","noticeable","notify","notion","notocord","notoriety","notorious","notre"
DATA "nottingham","notwithstanding","nouakchott","noun","nourish","nouveau","nov","nova","novak","novel","novelty","november","novice","novitiate","novo","novosibirsk","now","nowaday","nowadays","nowhere"
DATA "nowise","noxious","nozzle","nrc","nsf","ntis","nu","nuance","nubia","nubile","nucleant","nuclear","nucleate","nuclei","nucleic","nucleoli","nucleolus","nucleotide","nucleus","nuclide"
DATA "nude","nudge","nugatory","nugget","nuisance","null","nullify","nullstellensatz","numb","numerable","numeral","numerate","numeric","numerische","numerology","numerous","numinous","numismatic","numismatist","nun"
DATA "nuptial","nurse","nursery","nurture","nut","nutate","nutcrack","nuthatch","nutmeg","nutria","nutrient","nutrition","nutritious","nutritive","nutshell","nuzzle","nv","nw","ny","nyc"
DATA "nylon","nymph","nymphomania","nymphomaniac","nyquist","nyu","o","o'brien","o'clock","o'connell","o'connor","o'dell","o'donnell","o'dwyer","o'er","o'hare","o'leary","o'neill","o's","o'shea"
DATA "o'sullivan","oaf","oak","oaken","oakland","oakley","oakwood","oar","oases","oasis","oat","oath","oatmeal","obduracy","obdurate","obedient","obeisant","obelisk","oberlin","obese"
DATA "obey","obfuscate","obfuscatory","obituary","object","objectify","objectivity","objector","objet","oblate","obligate","obligatory","oblige","oblique","obliterate","oblivion","oblivious","oblong","obnoxious","oboe"
DATA "oboist","obscene","obscure","obsequious","obsequy","observant","observation","observatory","observe","obsess","obsession","obsessive","obsidian","obsolescent","obsolete","obstacle","obstetric","obstinacy","obstinate","obstruct"
DATA "obstruent","obtain","obtrude","obtrusion","obtrusive","obverse","obviate","obvious","ocarina","occasion","occident","occidental","occipital","occlude","occlusion","occlusive","occult","occultate","occultation","occupant"
DATA "occupation","occupy","occur","occurred","occurrent","occurring","ocean","oceania","oceanic","oceanographer","oceanography","oceanside","ocelot","oct","octagon","octagonal","octahedra","octahedral","octahedron","octal"
DATA "octane","octant","octave","octavia","octennial","octet","octile","octillion","october","octogenarian","octopus","octoroon","ocular","odd","ode","odessa","odin","odious","odium","odometer"
DATA "odorous","odysseus","odyssey","oedipal","oedipus","oersted","of","off","offal","offbeat","offenbach","offend","offensive","offer","offertory","offhand","office","officeholder","officemate","official"
DATA "officialdom","officiate","officio","officious","offload","offprint","offsaddle","offset","offsetting","offshoot","offshore","offspring","offstage","oft","often","oftentimes","ogden","ogle","ogre","ogress"
DATA "oh","ohio","ohm","ohmic","ohmmeter","oil","oilcloth","oilman","oilmen","oilseed","oily","oint","ointment","ok","okay","okinawa","oklahoma","olaf","olav","old"
DATA "olden","oldenburg","oldsmobile","oldster","oldy","oleander","olefin","oleomargarine","olfactory","olga","oligarchic","oligarchy","oligoclase","oligopoly","olin","olive","oliver","olivetti","olivia","olivine"
DATA "olsen","olson","olympia","olympic","omaha","oman","ombudsman","ombudsperson","omega","omelet","omen","omicron","ominous","omission","omit","omitted","omitting","omnibus","omnipotent","omnipresent"
DATA "omniscient","on","once","oncology","oncoming","one","oneida","onerous","oneself","onetime","oneupmanship","ongoing","onion","onlook","onlooker","onlooking","only","onomatopoeia","onomatopoeic","onondaga"
DATA "onrush","onrushing","onset","onslaught","ontario","onto","ontogeny","ontology","onus","onward","onyx","oocyte","oodles","ooze","opacity","opal","opalescent","opaque","opec","opel"
DATA "open","opera","operable","operand","operant","operate","operatic","operetta","operon","ophiuchus","ophthalmic","ophthalmology","opiate","opine","opinion","opinionate","opium","opossum","oppenheimer","opponent"
DATA "opportune","opposable","oppose","opposite","opposition","oppress","oppression","oppressive","oppressor","opprobrium","opt","optic","optima","optimal","optimism","optimist","optimistic","optimum","option","optoacoustic"
DATA "optoelectronic","optoisolate","optometrist","optometry","opulent","opus","or","oracle","oracular","oral","orange","orangeroot","orangutan","orate","oratoric","oratorical","oratorio","oratory","orb","orbit"
DATA "orbital","orchard","orchestra","orchestral","orchestrate","orchid","orchis","ordain","ordeal","order","orderly","ordinal","ordinance","ordinary","ordinate","ordnance","ore","oregano","oregon","oresteia"
DATA "orestes","organ","organdy","organic","organismic","organometallic","orgasm","orgiastic","orgy","orient","oriental","orifice","origin","original","originate","orin","orinoco","oriole","orion","orkney"
DATA "orlando","orleans","ornament","ornamentation","ornate","ornately","ornery","orographic","orography","orono","orphan","orphanage","orpheus","orphic","orr","ortega","orthant","orthicon","orthoclase","orthodontic"
DATA "orthodontist","orthodox","orthodoxy","orthogonal","orthography","orthonormal","orthopedic","orthophosphate","orthorhombic","orville","orwell","orwellian","osaka","osborn","osborne","oscar","oscillate","oscillatory","oscilloscope","osgood"
DATA "osha","oshkosh","osier","osiris","oslo","osmium","osmosis","osmotic","osprey","osseous","ossify","ostensible","ostentatious","osteology","osteopath","osteopathic","osteopathy","osteoporosis","ostracism","ostracod"
DATA "ostrander","ostrich","oswald","othello","other","otherwise","otherworld","otherworldly","otiose","otis","ott","ottawa","otter","otto","ottoman","ouagadougou","ouch","ought","oughtn't","ounce"
DATA "our","ourselves","oust","out","outermost","outlandish","outlawry","outrageous","ouvre","ouzel","ouzo","ova","oval","ovary","ovate","oven","ovenbird","over","overhang","overt"
DATA "overture","ovid","oviform","ovum","ow","owe","owens","owing","owl","owly","own","ox","oxalate","oxalic","oxcart","oxen","oxeye","oxford","oxidant","oxidate"
DATA "oxide","oxnard","oxonian","oxygen","oxygenate","oyster","ozark","ozone","p","p's","pa","pablo","pabst","pace","pacemake","pacesetting","pacific","pacifism","pacifist","pacify"
DATA "pack","package","packard","packet","pact","pad","paddle","paddock","paddy","padlock","padre","paean","pagan","page","pageant","pageantry","paginate","pagoda","paid","pail"
DATA "pain","paine","painful","painstaking","paint","paintbrush","pair","pairwise","pakistan","pakistani","pal","palace","palate","palatine","palazzi","palazzo","pale","paleolithic","paleozoic","palermo"
DATA "palestine","palestinian","palette","palfrey","palindrome","palindromic","palisade","pall","palladia","palladian","palladium","pallet","palliate","pallid","palm","palmate","palmetto","palmolive","palmyra","palo"
DATA "palomar","palpable","palsy","pam","pamela","pampa","pamper","pamphlet","pan","panacea","panama","pancake","pancho","pancreas","pancreatic","panda","pandanus","pandemic","pandemonium","pander"
DATA "pandora","pane","panel","pang","panhandle","panic","panicked","panicky","panicle","panjandrum","panoply","panorama","panoramic","pansy","pant","pantheism","pantheist","pantheon","panther","pantomime"
DATA "pantomimic","pantry","panty","paoli","pap","papa","papacy","papal","papaw","paper","paperback","paperbound","paperweight","paperwork","papery","papillary","papoose","pappas","pappy","paprika"
DATA "papua","papyri","papyrus","par","parabola","parabolic","paraboloid","paraboloidal","parachute","parade","paradigm","paradigmatic","paradise","paradox","paradoxic","paraffin","paragon","paragonite","paragraph","paraguay"
DATA "parakeet","paralinguistic","parallax","parallel","parallelepiped","parallelogram","paralysis","paramagnet","paramagnetic","paramedic","parameter","paramilitary","paramount","paramus","paranoia","paranoiac","paranoid","paranormal","parapet","paraphernalia"
DATA "paraphrase","parapsychology","parasite","parasitic","parasol","parasympathetic","paratroop","paraxial","parboil","parcel","parch","pardon","pare","paregoric","parent","parentage","parental","parentheses","parenthesis","parenthetic"
DATA "parenthood","pareto","pariah","parimutuel","paris","parish","parishioner","parisian","park","parke","parkinson","parkish","parkland","parks","parkway","parlance","parlay","parley","parliament","parliamentarian"
DATA "parliamentary","parochial","parody","parole","parolee","parquet","parr","parrish","parrot","parry","parse","parsifal","parsimonious","parsimony","parsley","parsnip","parson","parsonage","parsons","part"
DATA "partake","parthenon","partial","participant","participate","participle","particle","particular","particulate","partisan","partition","partner","partook","partridge","party","parvenu","pasadena","pascal","paschal","pasha"
DATA "paso","pass","passage","passageway","passaic","passband","passe","passenger","passer","passerby","passion","passionate","passivate","passive","passover","passport","password","past","paste","pasteboard"
DATA "pastel","pasteup","pasteur","pastiche","pastime","pastor","pastoral","pastry","pasture","pasty","pat","patagonia","patch","patchwork","patchy","pate","patent","patentee","pater","paternal"
DATA "paternoster","paterson","path","pathetic","pathfind","pathogen","pathogenesis","pathogenic","pathology","pathos","pathway","patient","patina","patio","patriarch","patriarchal","patriarchy","patrice","patricia","patrician"
DATA "patrick","patrimonial","patrimony","patriot","patriotic","patristic","patrol","patrolled","patrolling","patrolman","patrolmen","patron","patronage","patroness","patsy","pattern","patterson","patti","patton","patty"
DATA "paucity","paul","paula","paulette","pauli","pauline","paulo","paulsen","paulson","paulus","paunch","paunchy","pauper","pause","pavanne","pave","pavilion","pavlov","paw","pawn"
DATA "pawnshop","pawtucket","pax","pay","paycheck","payday","paymaster","payne","payoff","payroll","paz","pbs","pdp","pea","peabody","peace","peaceable","peaceful","peacemake","peacetime"
DATA "peach","peachtree","peacock","peafowl","peak","peaky","peal","peale","peanut","pear","pearce","pearl","pearlite","pearlstone","pearson","peasant","peasanthood","pease","peat","pebble"
DATA "pecan","peccary","peck","pecos","pectoral","pectoralis","peculate","peculiar","pecuniary","pedagogic","pedagogue","pedagogy","pedal","pedant","pedantic","pedantry","peddle","pedestal","pedestrian","pediatric"
DATA "pediatrician","pedigree","pediment","pedro","pee","peed","peek","peel","peep","peephole","peepy","peer","peg","pegasus","pegboard","pegging","peggy","pejorative","peking","pelham"
DATA "pelican","pellagra","pellet","pelt","peltry","pelvic","pelvis","pembroke","pemmican","pen","penal","penalty","penance","penates","pence","penchant","pencil","pend","pendant","pendulum"
DATA "penelope","penetrable","penetrate","penguin","penh","penicillin","peninsula","penis","penitent","penitential","penitentiary","penman","penmen","penn","penna","pennant","pennsylvania","penny","pennyroyal","penrose"
DATA "pensacola","pension","pensive","pent","pentagon","pentagonal","pentagram","pentane","pentecost","pentecostal","penthouse","penultimate","penumbra","penurious","penury","peony","people","peoria","pep","peppergrass"
DATA "peppermint","pepperoni","peppery","peppy","pepsi","pepsico","peptide","per","perceive","percent","percentage","percentile","percept","perceptible","perception","perceptive","perceptual","perch","perchance","perchlorate"
DATA "percival","percolate","percussion","percussive","percy","perdition","peregrine","peremptory","perennial","perez","perfect","perfecter","perfectible","perfidious","perfidy","perforate","perforce","perform","performance","perfume"
DATA "perfumery","perfunctory","perfuse","perfusion","pergamon","perhaps","periclean","pericles","peridotite","perihelion","peril","perilla","perilous","perimeter","period","periodic","peripatetic","peripheral","periphery","periphrastic"
DATA "periscope","perish","peritectic","periwinkle","perjure","perjury","perk","perkins","perky","perle","permalloy","permanent","permeable","permeate","permian","permissible","permission","permissive","permit","permitted"
DATA "permitting","permutation","permute","pernicious","peroxide","perpendicular","perpetrate","perpetual","perpetuate","perpetuity","perplex","perquisite","perry","persecute","persecution","persecutory","perseus","perseverance","perseverant","persevere"
DATA "pershing","persia","persian","persiflage","persimmon","persist","persistent","person","persona","personage","personal","personify","personnel","perspective","perspicacious","perspicuity","perspicuous","perspiration","perspire","persuade"
DATA "persuasion","persuasive","pert","pertain","perth","pertinacious","pertinent","perturb","perturbate","perturbation","peru","perusal","peruse","peruvian","pervade","pervasion","pervasive","perverse","perversion","pervert"
DATA "pessimal","pessimism","pessimist","pessimum","pest","peste","pesticide","pestilent","pestilential","pestle","pet","petal","pete","petersburg","petersen","peterson","petit","petite","petition","petrel"
DATA "petri","petrifaction","petrify","petrochemical","petroglyph","petrol","petroleum","petrology","petticoat","petty","petulant","petunia","peugeot","pew","pewee","pewter","pfennig","pfizer","ph.d","phage"
DATA "phagocyte","phalanger","phalanx","phalarope","phantasy","phantom","pharaoh","pharmaceutic","pharmacist","pharmacology","pharmacopoeia","pharmacy","phase","phd","pheasant","phelps","phenol","phenolic","phenomena","phenomenal"
DATA "phenomenology","phenomenon","phenotype","phenyl","phenylalanine","phi","phil","philadelphia","philanthrope","philanthropic","philanthropy","philharmonic","philip","philippine","philistine","phillip","phillips","philodendron","philology","philosoph"
DATA "philosopher","philosophic","philosophy","phipps","phloem","phlox","phobic","phoebe","phoenicia","phoenix","phon","phone","phoneme","phonemic","phonetic","phonic","phonograph","phonology","phonon","phony"
DATA "phosgene","phosphate","phosphide","phosphine","phosphor","phosphoresce","phosphorescent","phosphoric","phosphorus","phosphorylate","photo","photogenic","photography","photolysis","photolytic","photometry","photon","phrase","phrasemake","phraseology"
DATA "phthalate","phycomycetes","phyla","phyllis","phylogeny","physic","physician","physik","physiochemical","physiognomy","physiology","physiotherapist","physiotherapy","physique","phytoplankton","pi","pianissimo","pianist","piano","piazza"
DATA "pica","picasso","picayune","piccadilly","piccolo","pick","pickaxe","pickerel","pickering","picket","pickett","pickford","pickle","pickman","pickoff","pickup","picky","picnic","picnicked","picnicker"
DATA "picnicking","picofarad","picojoule","picosecond","pictorial","picture","picturesque","piddle","pidgin","pie","piece","piecemeal","piecewise","piedmont","pier","pierce","pierre","pierson","pietism","piety"
DATA "piezoelectric","pig","pigeon","pigeonberry","pigeonfoot","pigeonhole","pigging","piggish","piggy","piggyback","pigment","pigmentation","pigpen","pigroot","pigskin","pigtail","pike","pilate","pile","pilewort"
DATA "pilfer","pilferage","pilgrim","pilgrimage","pill","pillage","pillar","pillory","pillow","pillsbury","pilot","pimp","pimple","pin","pinafore","pinball","pinch","pincushion","pine","pineapple"
DATA "pinehurst","ping","pinhead","pinhole","pinion","pink","pinkie","pinkish","pinnacle","pinnate","pinochle","pinpoint","pinscher","pinsky","pint","pintail","pinto","pinwheel","pinxter","pion"
DATA "pioneer","piotr","pious","pip","pipe","pipeline","piper","pipette","pipsissewa","piquant","pique","piracy","piraeus","pirate","pirogue","pirouette","piscataway","pisces","piss","pistachio"
DATA "pistol","pistole","piston","pit","pitch","pitchblende","pitchfork","pitchstone","piteous","pitfall","pith","pithy","pitiable","pitiful","pitilessly","pitman","pitney","pitt","pittsburgh","pittsfield"
DATA "pittston","pituitary","pity","pius","pivot","pivotal","pixel","pixy","pizza","pizzeria","pizzicato","pl","placate","placater","place","placeable","placebo","placeholder","placenta","placental"
DATA "placid","plagiarism","plagiarist","plagioclase","plague","plagued","plaguey","plaid","plain","plainfield","plaintiff","plaintive","plan","planar","planck","plane","planeload","planet","planetaria","planetarium"
DATA "planetary","planetesimal","planetoid","plank","plankton","planoconcave","planoconvex","plant","plantain","plantation","plaque","plasm","plasma","plasmon","plaster","plastic","plastisol","plastron","plat","plate"
DATA "plateau","platelet","platen","platform","platinum","platitude","platitudinous","plato","platonic","platonism","platonist","platoon","platte","platypus","plausible","play","playa","playback","playboy","playful"
DATA "playground","playhouse","playmate","playoff","playroom","plaything","playtime","playwright","playwriting","plaza","plea","plead","pleasant","please","pleasure","pleat","plebeian","plebian","pledge","pleiades"
DATA "pleistocene","plenary","plenipotentiary","plenitude","plentiful","plenty","plenum","plethora","pleura","pleural","plexiglas","pliable","pliancy","pliant","pliers","plight","pliny","pliocene","plod","plop"
DATA "plot","plover","plowman","plowshare","pluck","plucky","plug","plugboard","pluggable","plugging","plum","plumage","plumb","plumbago","plumbate","plume","plummet","plump","plunder","plunge"
DATA "plunk","pluperfect","plural","plus","plush","plushy","plutarch","pluto","pluton","plutonium","ply","plymouth","plyscore","plywood","pm","pneumatic","pneumococcus","pneumonia","po","poach"
DATA "pobox","pocket","pocketbook","pocketful","pocono","pocus","pod","podge","podia","podium","poe","poem","poesy","poet","poetic","poetry","pogo","pogrom","poi","poignant"
DATA "poincare","poinsettia","point","pointwise","poise","poison","poisonous","poisson","poke","pokerface","pol","poland","polar","polarimeter","polaris","polariscope","polariton","polarogram","polarograph","polarography"
DATA "polaroid","polaron","pole","polecat","polemic","police","policeman","policemen","policy","polio","poliomyelitis","polis","polish","politburo","polite","politic","politician","politicking","politico","polity"
DATA "polk","polka","polkadot","poll","pollard","pollen","pollinate","pollock","polloi","pollster","pollutant","pollute","pollution","pollux","polo","polonaise","polonium","polopony","polyglot","polygon"
DATA "polygonal","polygynous","polyhedra","polyhedral","polyhedron","polyhymnia","polymer","polymerase","polymeric","polymorph","polymorphic","polynomial","polyphemus","polyphony","polyploidy","polypropylene","polysaccharide","polytechnic","polytope","polytypy"
DATA "pomade","pomegranate","pomona","pomp","pompadour","pompano","pompeii","pompey","pompon","pomposity","pompous","ponce","ponchartrain","poncho","pond","ponder","ponderous","pong","pont","pontiac"
DATA "pontiff","pontific","pontificate","pony","pooch","poodle","pooh","pool","poole","poop","poor","pop","popcorn","pope","popish","poplar","poplin","poppy","populace","popular"
DATA "populate","populism","populist","populous","porcelain","porch","porcine","porcupine","pore","pork","pornographer","pornography","porosity","porous","porphyry","porpoise","porridge","port","portage","portal"
DATA "porte","portend","portent","portentous","porterhouse","portfolio","portia","portico","portland","portmanteau","porto","portrait","portraiture","portray","portrayal","portsmouth","portugal","portuguese","portulaca","posable"
DATA "pose","poseidon","poseur","posey","posh","posit","position","positive","positron","posner","posse","posseman","possemen","possess","possession","possessive","possessor","possible","possum","post"
DATA "postage","postal","postcard","postcondition","postdoctoral","posterior","posteriori","posterity","postfix","postgraduate","posthumous","postlude","postman","postmark","postmaster","postmen","postmortem","postmultiply","postoperative","postorder"
DATA "postpaid","postpone","postposition","postprocess","postprocessor","postscript","postulate","posture","postwar","posy","pot","potable","potash","potassium","potato","potatoes","potbelly","potboil","potent","potentate"
DATA "potential","potentiometer","pothole","potion","potlatch","potomac","potpourri","pottery","potts","pouch","poughkeepsie","poultice","poultry","pounce","pound","pour","pout","poverty","pow","powder"
DATA "powderpuff","powdery","powell","power","powerful","powerhouse","powers","poynting","ppm","pr","practicable","practical","practice","practise","practitioner","prado","praecox","pragmatic","pragmatism","pragmatist"
DATA "prague","prairie","praise","praiseworthy","pram","prance","prank","praseodymium","pratt","pravda","pray","prayer","prayerful","preach","preachy","preamble","precambrian","precarious","precaution","precautionary"
DATA "precede","precedent","precept","precess","precession","precinct","precious","precipice","precipitable","precipitate","precipitous","precis","precise","precision","preclude","precocious","precocity","precursor","predatory","predecessor"
DATA "predicament","predicate","predict","predictor","predilect","predispose","predisposition","predominant","predominate","preeminent","preempt","preemption","preemptive","preemptor","preen","prefab","prefabricate","preface","prefatory","prefect"
DATA "prefecture","prefer","preference","preferential","preferred","preferring","prefix","pregnant","prehistoric","prejudice","prejudicial","preliminary","prelude","premature","premeditate","premier","premiere","premise","premium","premonition"
DATA "premonitory","prentice","preoccupy","prep","preparation","preparative","preparatory","prepare","preponderant","preponderate","preposition","preposterous","prerequisite","prerogative","presage","presbyterian","presbytery","prescott","prescribe","prescript"
DATA "prescription","prescriptive","presence","present","presentation","presentational","preservation","preserve","preside","president","presidential","press","pressure","prestidigitate","prestige","prestigious","presto","preston","presume","presumed"
DATA "presuming","presumption","presumptive","presumptuous","presuppose","presupposition","pretend","pretense","pretension","pretentious","pretext","pretoria","pretty","prevail","prevalent","prevent","prevention","preventive","preview","previous"
DATA "prexy","prey","priam","price","prick","prickle","pride","priest","priestley","prig","priggish","prim","prima","primacy","primal","primary","primate","prime","primeval","primitive"
DATA "primitivism","primordial","primp","primrose","prince","princess","princeton","principal","principia","principle","print","printmake","printout","prior","priori","priory","priscilla","prism","prismatic","prison"
DATA "prissy","pristine","pritchard","privacy","private","privet","privilege","privy","prize","prizewinning","pro","probabilist","probate","probe","probity","problem","problematic","procaine","procedural","procedure"
DATA "proceed","process","procession","processor","proclaim","proclamation","proclivity","procrastinate","procreate","procrustean","procrustes","procter","proctor","procure","procyon","prod","prodigal","prodigious","prodigy","produce"
DATA "producible","product","productivity","prof","profane","profess","profession","professional","professor","professorial","proffer","proficient","profile","profit","profiteer","profligacy","profligate","profound","profundity","profuse"
DATA "profusion","progenitor","progeny","prognosis","prognosticate","programmable","programmed","programmer","programming","progress","progression","progressive","prohibit","prohibition","prohibitive","prohibitory","project","projectile","projector","prokaryote"
DATA "prokofieff","prolate","prolegomena","proletariat","proliferate","prolific","proline","prolix","prologue","prolong","prolongate","prolusion","prom","promenade","promethean","prometheus","promethium","prominent","promiscuity","promiscuous"
DATA "promise","promote","promotion","prompt","promptitude","promulgate","prone","prong","pronoun","pronounce","pronounceable","pronto","pronunciation","proof","proofread","prop","propaganda","propagandist","propagate","propane"
DATA "propel","propellant","propelled","propeller","propelling","propensity","proper","property","prophecy","prophesy","prophet","prophetic","prophylactic","propionate","propitiate","propitious","proponent","proportion","proportionate","propos"
DATA "proposal","propose","proposition","propound","proprietary","proprietor","propriety","proprioception","proprioceptive","propulsion","propyl","propylene","prorate","prorogue","prosaic","proscenium","proscribe","proscription","prose","prosecute"
DATA "prosecution","prosecutor","proserpine","prosodic","prosody","prosopopoeia","prospect","prospector","prospectus","prosper","prosperous","prostate","prostheses","prosthesis","prosthetic","prostitute","prostitution","prostrate","protactinium","protagonist"
DATA "protean","protease","protect","protector","protectorate","protege","protein","proteolysis","proteolytic","protest","protestant","protestation","prothonotary","protocol","proton","protophyta","protoplasm","protoplasmic","prototype","prototypic"
DATA "protozoa","protozoan","protract","protrude","protrusion","protrusive","protuberant","proud","proust","prove","proven","provenance","proverb","proverbial","provide","provident","providential","province","provincial","provision"
DATA "provisional","proviso","provocateur","provocation","provocative","provoke","provost","prow","prowess","prowl","proximal","proximate","proximity","proxy","prudent","prudential","prune","prurient","prussia","pry"
DATA "psalm","psalter","psaltery","pseudo","psi","psych","psyche","psychiatric","psychiatrist","psychiatry","psychic","psycho","psychoacoustic","psychoanalysis","psychoanalyst","psychoanalytic","psychobiology","psychology","psychometry","psychopath"
DATA "psychopathic","psychophysic","psychophysiology","psychopomp","psychoses","psychosis","psychosomatic","psychotherapeutic","psychotherapist","psychotherapy","psychotic","psyllium","pta","ptarmigan","pterodactyl","ptolemaic","ptolemy","pub","puberty","pubescent"
DATA "public","publication","publish","puc","puccini","puck","puckish","pudding","puddingstone","puddle","puddly","pueblo","puerile","puerto","puff","puffball","puffed","puffery","puffin","puffy"
DATA "pug","pugh","pugnacious","puissant","puke","pulaski","pulitzer","pull","pullback","pulley","pullman","pullover","pulmonary","pulp","pulpit","pulsar","pulsate","pulse","pulverable","puma"
DATA "pumice","pummel","pump","pumpkin","pumpkinseed","pun","punch","punctual","punctuate","puncture","pundit","punditry","pungent","punic","punish","punitive","punk","punky","punster","punt"
DATA "puny","pup","pupal","pupate","pupil","puppet","puppeteer","puppy","puppyish","purcell","purchasable","purchase","purdue","pure","purgation","purgative","purgatory","purge","purify","purina"
DATA "purine","puritan","puritanic","purl","purloin","purple","purport","purpose","purposeful","purposive","purr","purse","purslane","pursuant","pursue","pursuer","pursuit","purvey","purveyor","purview"
DATA "pus","pusan","pusey","push","pushbutton","pushout","pushpin","pussy","pussycat","put","putative","putnam","putt","putty","puzzle","pvc","pygmalion","pygmy","pyhrric","pyknotic"
DATA "pyle","pyongyang","pyracanth","pyramid","pyramidal","pyre","pyrex","pyridine","pyrimidine","pyrite","pyroelectric","pyrolyse","pyrolysis","pyrometer","pyrophosphate","pyrotechnic","pyroxene","pyroxenite","pyrrhic","pythagoras"
DATA "pythagorean","python","q","q's","qatar","qed","qua","quack","quackery","quad","quadrangle","quadrangular","quadrant","quadratic","quadrature","quadrennial","quadric","quadriceps","quadrilateral","quadrille"
DATA "quadrillion","quadripartite","quadrivium","quadruple","quadrupole","quaff","quagmire","quahog","quail","quaint","quake","quakeress","qualified","qualify","qualitative","quality","qualm","quandary","quanta","quantico"
DATA "quantify","quantile","quantitative","quantity","quantum","quarantine","quark","quarrel","quarrelsome","quarry","quarryman","quarrymen","quart","quarterback","quartermaster","quartet","quartic","quartile","quartz","quartzite"
DATA "quasar","quash","quasi","quasicontinuous","quasiorder","quasiparticle","quasiperiodic","quasistationary","quaternary","quatrain","quaver","quay","queasy","quebec","queen","queer","quell","quench","querulous","query"
DATA "quest","question","questionnaire","quetzal","queue","quezon","quibble","quick","quicken","quickie","quicklime","quicksand","quicksilver","quickstep","quid","quiescent","quiet","quietus","quill","quillwort"
DATA "quilt","quince","quinine","quinn","quint","quintessence","quintessential","quintet","quintic","quintillion","quintus","quip","quipping","quirinal","quirk","quirky","quirt","quit","quite","quito"
DATA "quitting","quiver","quixote","quixotic","quiz","quizzes","quizzical","quo","quod","quonset","quorum","quota","quotation","quote","quotient","r","r&d","r's","rabat","rabbet"
DATA "rabbi","rabbit","rabble","rabid","rabies","rabin","raccoon","race","racetrack","raceway","rachel","rachmaninoff","racial","rack","racket","racketeer","rackety","racy","radar","radcliffe"
DATA "radial","radian","radiant","radiate","radical","radices","radii","radio","radioactive","radioastronomy","radiocarbon","radiochemical","radiochemistry","radiogram","radiography","radiology","radiometer","radiophysics","radiosonde","radiotelegraph"
DATA "radiotelephone","radiotherapy","radish","radium","radius","radix","radon","rae","rafael","rafferty","raffia","raffish","raffle","raft","rag","rage","ragging","ragout","ragweed","raid"
DATA "rail","railbird","railhead","raillery","railroad","railway","rain","rainbow","raincoat","raindrop","rainfall","rainstorm","rainy","raise","raisin","raj","rajah","rake","rakish","raleigh"
DATA "rally","ralph","ralston","ram","ramada","raman","ramble","ramify","ramo","ramp","rampage","rampant","rampart","ramrod","ramsey","ran","ranch","rancho","rancid","rancorous"
DATA "rand","randall","randolph","random","randy","rang","range","rangeland","rangoon","rangy","ranier","rank","rankin","rankine","rankle","ransack","ransom","rant","raoul","rap"
DATA "rapacious","rape","raphael","rapid","rapier","rapport","rapprochement","rapt","rapture","rare","rarefy","raritan","rasa","rascal","rash","rasmussen","rasp","raspberry","raster","rastus"
DATA "rat","rata","rate","ratepayer","rater","rather","ratify","ratio","ratiocinate","rationale","rattail","rattle","rattlesnake","ratty","raucous","raul","ravage","rave","ravel","raven"
DATA "ravenous","ravine","ravish","raw","rawboned","rawhide","rawlinson","ray","rayleigh","raymond","raytheon","raze","razor","razorback","razzle","rca","rd","re","reach","reactant"
DATA "reactionary","read","readout","ready","reagan","real","realisable","realm","realtor","realty","ream","reap","rear","reason","reave","reb","rebecca","rebel","rebelled","rebelling"
DATA "rebellion","rebellious","rebuke","rebut","rebuttal","rebutted","rebutting","recalcitrant","recappable","receipt","receive","recent","receptacle","reception","receptive","receptor","recess","recession","recessive","recherche"
DATA "recife","recipe","recipient","reciprocal","reciprocate","reciprocity","recital","recitative","reck","reckon","reclamation","recline","recluse","recombinant","recompense","reconcile","recondite","reconnaissance","recovery","recriminate"
DATA "recriminatory","recruit","rectangle","rectangular","rectifier","rectify","rectilinear","rectitude","rector","rectory","recumbent","recuperate","recur","recurred","recurrent","recurring","recursion","recusant","recuse","red"
DATA "redact","redactor","redbird","redbud","redcoat","redden","reddish","redemption","redemptive","redhead","redmond","redneck","redound","redpoll","redshank","redstart","redstone","redtop","reduce","reducible"
DATA "redundant","redwood","reed","reedbuck","reedy","reef","reek","reel","reese","reeve","reeves","refection","refectory","refer","referable","referee","refereeing","referenda","referendum","referent"
DATA "referential","referral","referred","referring","refinery","reflect","reflectance","reflector","reflexive","reformatory","refract","refractometer","refractory","refrain","refrigerate","refuge","refugee","refusal","refutation","refute"
DATA "regal","regale","regalia","regard","regatta","regent","regime","regimen","regiment","regimentation","regina","reginald","region","regional","regis","registrable","registrant","registrar","registration","registry"
DATA "regress","regression","regressive","regret","regretful","regrettable","regretted","regretting","regular","regulate","regulatory","regulus","regurgitate","rehabilitate","rehearsal","rehearse","reich","reid","reign","reilly"
DATA "reimbursable","reimburse","rein","reindeer","reinforce","reinhold","reinstate","reject","rejecter","rejoice","rejoinder","rejuvenate","relate","relaxation","relayed","releasable","relevant","reliant","relic","relict"
DATA "relief","relieve","religion","religiosity","religious","relinquish","reliquary","relish","reluctant","remainder","reman","remand","remark","rembrandt","remediable","remedial","remedy","remember","remembrance","remington"
DATA "reminisce","reminiscent","remiss","remission","remit","remittance","remitted","remitting","remnant","remonstrate","remorse","remorseful","remote","removal","remunerate","remus","rena","renaissance","renal","renault"
DATA "rend","render","rendezvous","rendition","rene","renegotiable","renewal","renoir","renounce","renovate","renown","rensselaer","rent","rental","renunciate","rep","repairman","repairmen","reparation","repartee"
DATA "repeal","repeat","repeater","repel","repelled","repellent","repelling","repent","repentant","repertoire","repertory","repetition","repetitious","repetitive","replaceable","replenish","replete","replica","replicate","report"
DATA "reportorial","repository","reprehensible","representative","repression","repressive","reprieve","reprimand","reprisal","reprise","reproach","reptile","reptilian","republic","republican","repudiate","repugnant","repulsion","repulsive","reputation"
DATA "repute","request","require","requisite","requisition","requited","reredos","rerouted","rerouting","rescind","rescue","resemblant","resemble","resent","resentful","reserpine","reservation","reserve","reservoir","reside"
DATA "resident","residential","residual","residuary","residue","residuum","resign","resignation","resilient","resin","resiny","resist","resistant","resistible","resistive","resistor","resolute","resolution","resolve","resonant"
DATA "resonate","resorcinol","resort","resourceful","respect","respecter","respectful","respiration","respirator","respiratory","respire","respite","resplendent","respond","respondent","response","responsible","responsive","rest","restaurant"
DATA "restaurateur","restful","restitution","restive","restoration","restorative","restrain","restraint","restrict","restroom","result","resultant","resume","resuming","resumption","resurgent","resurrect","resuscitate","ret","retail"
DATA "retain","retaliate","retaliatory","retard","retardant","retardation","retch","retention","retentive","reticent","reticulate","reticulum","retina","retinal","retinue","retire","retiree","retort","retract","retribution"
DATA "retrieval","retrieve","retroactive","retrofit","retrofitted","retrofitting","retrograde","retrogress","retrogression","retrogressive","retrorocket","retrospect","retrovision","return","reub","reuben","reuters","rev","reveal","revel"
DATA "revelation","revelatory","revelry","revenge","revenue","rever","reverberate","revere","reverend","reverent","reverie","reversal","reverse","reversible","reversion","revert","revertive","revery","revet","revile"
DATA "revisable","revisal","revise","revision","revisionary","revival","revive","revocable","revoke","revolt","revolution","revolutionary","revolve","revulsion","revved","revving","reward","rex","reykjavik","reynolds"
DATA "rhapsodic","rhapsody","rhea","rhenish","rhenium","rheology","rheostat","rhesus","rhetoric","rhetorician","rheum","rheumatic","rheumatism","rhine","rhinestone","rhino","rhinoceros","rho","rhoda","rhode"
DATA "rhodes","rhodesia","rhodium","rhododendron","rhodolite","rhodonite","rhombi","rhombic","rhombohedral","rhombus","rhubarb","rhyme","rhythm","rhythmic","ri","rib","ribald","ribbon","riboflavin","ribonucleic"
DATA "ribose","ribosome","rica","rice","rich","richard","richards","richardson","richfield","richmond","richter","rick","rickets","rickettsia","rickety","rickshaw","rico","ricochet","rid","riddance"
DATA "ridden","riddle","ride","ridge","ridgepole","ridgway","ridicule","ridiculous","riemann","riemannian","riffle","rifle","rifleman","riflemen","rift","rig","riga","rigel","rigging","riggs"
DATA "right","righteous","rightful","rightmost","rightward","rigid","rigorous","riley","rill","rilly","rim","rime","rimy","rinehart","ring","ringlet","ringmaster","ringside","rink","rinse"
DATA "rio","riordan","riot","riotous","rip","riparian","ripe","ripen","ripley","ripoff","ripple","rise","risen","risible","risk","risky","ritchie","rite","ritter","ritual"
DATA "ritz","rival","rivalry","riven","river","riverbank","riverfront","riverine","riverside","rivet","riviera","rivulet","riyadh","rna","roach","road","roadbed","roadblock","roadhouse","roadside"
DATA "roadster","roadway","roam","roar","roast","rob","robbery","robbin","robbins","robe","robert","roberta","roberto","roberts","robertson","robin","robinson","robot","robotic","robotics"
DATA "robust","rocco","rochester","rock","rockabye","rockaway","rockbound","rockefeller","rocket","rockford","rockies","rockland","rockwell","rocky","rococo","rod","rode","rodent","rodeo","rodgers"
DATA "rodney","rodriguez","roe","roebuck","roentgen","roger","rogers","rogue","roil","roister","roland","role","roll","rollback","rollick","rollins","roman","romance","romania","romano"
DATA "romantic","rome","romeo","romp","romulus","ron","ronald","rondo","ronnie","rood","roof","rooftop","rooftree","rook","rookie","rooky","room","roomful","roommate","roomy"
DATA "roosevelt","rooseveltian","roost","root","rope","rosa","rosalie","rosary","rose","rosebud","rosebush","roseland","rosemary","rosen","rosenberg","rosenblum","rosenthal","rosenzweig","rosetta","rosette"
DATA "ross","roster","rostrum","rosy","rot","rotarian","rotary","rotate","rotc","rote","rotenone","roth","rothschild","rotogravure","rotor","rototill","rotten","rotund","rotunda","rouge"
DATA "rough","roughcast","roughen","roughish","roughneck","roughshod","roulette","round","roundabout","roundhead","roundhouse","roundoff","roundtable","roundup","roundworm","rouse","rousseau","roustabout","rout","route"
DATA "routine","rove","row","rowboat","rowdy","rowe","rowena","rowland","rowley","roxbury","roy","royal","royalty","royce","rpm","rsvp","ruanda","rub","rubbery","rubbish"
DATA "rubble","rubdown","rube","ruben","rubicund","rubidium","rubin","rubric","ruby","ruckus","rudder","ruddy","rude","rudiment","rudimentary","rudolf","rudolph","rudy","rudyard","rue"
DATA "rueful","ruff","ruffian","ruffle","rufous","rufus","rug","ruin","ruination","ruinous","rule","rum","rumania","rumble","rumen","rumford","ruminant","ruminate","rummage","rummy"
DATA "rump","rumple","rumpus","run","runabout","runaway","rundown","rune","rung","runge","runic","runneth","runnymede","runoff","runt","runty","runway","runyon","rupee","rupture"
DATA "rural","ruse","rush","rushmore","rusk","russ","russell","russet","russia","russo","russula","rust","rustic","rustle","rustproof","rusty","rut","rutabaga","rutgers","ruth"
DATA "ruthenium","rutherford","ruthless","rutile","rutland","rutledge","rutty","rwanda","ryan","rydberg","ryder","rye","s","s's","sa","sabbath","sabbatical","sabina","sabine","sable"
DATA "sabotage","sabra","sac","saccade","saccharine","sachem","sachs","sack","sacral","sacrament","sacramento","sacred","sacrifice","sacrificial","sacrilege","sacrilegious","sacrosanct","sad","sadden","saddle"
DATA "saddlebag","sadie","sadism","sadist","sadler","safari","safe","safeguard","safekeeping","safety","saffron","sag","saga","sagacious","sagacity","sage","sagebrush","sagging","saginaw","sagittal"
DATA "sagittarius","sago","saguaro","sahara","said","saigon","sail","sailboat","sailfish","sailor","saint","sainthood","sake","sal","salaam","salacious","salad","salamander","salami","salaried"
DATA "salary","sale","salem","salerno","salesgirl","salesian","saleslady","salesman","salesmen","salesperson","salient","salina","saline","salisbury","salish","saliva","salivary","salivate","salk","salle"
DATA "sallow","sally","salmon","salmonberry","salmonella","salon","saloon","saloonkeep","saloonkeeper","salsify","salt","saltbush","saltwater","salty","salubrious","salutary","salutation","salute","salvador","salvage"
DATA "salvageable","salvation","salvatore","salve","salvo","sam","samarium","samba","same","sammy","samoa","samovar","sample","sampson","samson","samuel","samuelson","san","sana","sanatoria"
DATA "sanatorium","sanborn","sanchez","sancho","sanctify","sanctimonious","sanction","sanctity","sanctuary","sand","sandal","sandalwood","sandbag","sandblast","sandburg","sanderling","sanders","sanderson","sandhill","sandia"
DATA "sandman","sandpaper","sandpile","sandpiper","sandra","sandstone","sandusky","sandwich","sandy","sane","sanford","sang","sangaree","sanguinary","sanguine","sanguineous","sanhedrin","sanicle","sanitarium","sanitary"
DATA "sanitate","sank","sans","sanskrit","santa","santayana","santiago","santo","sao","sap","sapiens","sapient","sapling","saponify","sapphire","sappy","sapsucker","sara","saracen","sarah"
DATA "saran","sarasota","saratoga","sarcasm","sarcastic","sarcoma","sarcophagus","sardine","sardonic","sargent","sari","sarsaparilla","sarsparilla","sash","sashay","saskatchewan","saskatoon","sassafras","sat","satan"
DATA "satanic","satellite","satiable","satiate","satiety","satin","satire","satiric","satisfaction","satisfactory","satisfy","saturable","saturate","saturater","saturday","saturn","saturnalia","saturnine","satyr","sauce"
DATA "saucepan","saucy","saud","saudi","sauerkraut","saul","sault","saunders","sausage","saute","sauterne","savage","savagery","savannah","savant","save","saviour","savonarola","savoy","savoyard"
DATA "savvy","saw","sawbelly","sawdust","sawfish","sawfly","sawmill","sawtimber","sawtooth","sawyer","sax","saxifrage","saxon","saxony","saxophone","say","sc","scab","scabbard","scabious"
DATA "scabrous","scaffold","scala","scalar","scald","scale","scallop","scalp","scam","scamp","scan","scandal","scandalous","scandinavia","scandium","scant","scanty","scapegoat","scapula","scapular"
DATA "scar","scarborough","scarce","scare","scarecrow","scarf","scarface","scarify","scarlatti","scarlet","scarsdale","scarves","scary","scat","scathe","scatterbrain","scattergun","scaup","scavenge","scenario"
DATA "scene","scenery","scenic","scent","sceptic","schaefer","schafer","schantz","schedule","schelling","schema","schemata","schematic","scheme","schenectady","scherzo","schiller","schism","schist","schizoid"
DATA "schizomycetes","schizophrenia","schizophrenic","schlesinger","schlieren","schlitz","schloss","schmidt","schmitt","schnabel","schnapps","schneider","schoenberg","schofield","scholar","scholastic","school","schoolbook","schoolboy","schoolgirl"
DATA "schoolgirlish","schoolhouse","schoolmarm","schoolmaster","schoolmate","schoolroom","schoolteacher","schoolwork","schooner","schottky","schroeder","schroedinger","schubert","schultz","schulz","schumacher","schumann","schuster","schuyler","schuylkill"
DATA "schwab","schwartz","schweitzer","sci","sciatica","science","scientific","scientist","scimitar","scintillate","scion","scissor","sclerosis","sclerotic","scm","scoff","scold","scoop","scoot","scope"
DATA "scopic","scops","scorch","score","scoreboard","scorecard","scoria","scorn","scornful","scorpio","scorpion","scot","scotch","scotia","scotland","scotsman","scotsmen","scott","scottish","scottsdale"
DATA "scotty","scoundrel","scour","scourge","scout","scowl","scrabble","scraggly","scram","scramble","scranton","scrap","scrapbook","scrape","scratch","scratchy","scrawl","scrawny","scream","screech"
DATA "screechy","screed","screen","screenplay","screw","screwball","screwbean","screwdriver","screwworm","scribble","scribe","scribners","scrim","scrimmage","scripps","script","scription","scriptural","scripture","scriven"
DATA "scroll","scrooge","scrotum","scrounge","scrub","scrumptious","scruple","scrupulosity","scrupulous","scrutable","scrutiny","scuba","scud","scuff","scuffle","scull","sculpin","sculpt","sculptor","sculptural"
DATA "sculpture","scum","scurrilous","scurry","scurvy","scuttle","scutum","scylla","scythe","scythia","sd","se","sea","seaboard","seacoast","seafare","seafood","seagram","seagull","seahorse"
DATA "seal","sealant","seam","seaman","seamen","seamstress","seamy","sean","seance","seaport","seaquake","sear","search","searchlight","sears","seashore","seaside","season","seasonal","seat"
DATA "seater","seattle","seaward","seaweed","sebastian","sec","secant","secede","secession","seclude","seclusion","second","secondary","secondhand","secrecy","secret","secretarial","secretariat","secretary","secrete"
DATA "secretion","secretive","sect","sectarian","section","sector","sectoral","secular","secure","sedan","sedate","sedentary","seder","sedge","sediment","sedimentary","sedimentation","sedition","seditious","seduce"
DATA "seduction","seductive","sedulous","see","seeable","seed","seedbed","seedling","seedy","seeing","seek","seem","seen","seep","seepage","seersucker","seethe","seethed","seething","segment"
DATA "segmentation","segovia","segregant","segregate","segundo","seidel","seismic","seismograph","seismography","seismology","seize","seizure","seldom","select","selectman","selectmen","selector","selectric","selena","selenate"
DATA "selenite","selenium","self","selfadjoint","selfish","selfridge","selkirk","sell","seller","sellout","selma","seltzer","selves","selwyn","semantic","semaphore","semblance","semester","semi","seminal"
DATA "seminar","seminarian","seminary","seminole","semiramis","semite","semitic","semper","sen","senate","senatorial","send","seneca","senegal","senile","senior","senor","senora","senorita","sensate"
DATA "sense","sensible","sensitive","sensor","sensorimotor","sensory","sensual","sensuous","sent","sentence","sentential","sentient","sentiment","sentinel","sentry","seoul","sepal","separable","separate","sepia"
DATA "sepoy","sept","septa","septate","september","septennial","septic","septillion","septuagenarian","septum","sepuchral","sepulchral","seq","sequel","sequent","sequential","sequester","sequestration","sequin","sequitur"
DATA "sequoia","sera","seraglio","serape","seraphim","serbia","serenade","serendipitous","serendipity","serene","serf","serfdom","serge","sergeant","sergei","serial","seriate","seriatim","series","serif"
DATA "serine","serious","sermon","serology","serpens","serpent","serpentine","serum","servant","serve","service","serviceable","serviceberry","serviceman","servicemen","serviette","servile","servitor","servitude","servo"
DATA "servomechanism","sesame","session","set","setback","seth","seton","setscrew","settle","setup","seven","sevenfold","seventeen","seventeenth","seventh","seventieth","seventy","sever","several","severalfold"
DATA "severalty","severe","severn","seville","sew","sewage","seward","sewerage","sewn","sex","sextans","sextet","sextillion","sexton","sextuple","sextuplet","sexual","sexy","seymour","sforzando"
DATA "shabby","shack","shackle","shad","shadbush","shade","shadflower","shadow","shadowy","shady","shafer","shaffer","shaft","shag","shagbark","shagging","shaggy","shah","shake","shakeable"
DATA "shakedown","shaken","shakespeare","shakespearean","shakespearian","shako","shaky","shale","shall","shallot","shallow","shalom","sham","shamble","shame","shameface","shamefaced","shameful","shampoo","shamrock"
DATA "shan't","shanghai","shank","shannon","shantung","shanty","shape","shapiro","shard","share","sharecrop","shareholder","shareown","shari","shark","sharon","sharp","sharpe","sharpen","sharpshoot"
DATA "shasta","shatter","shatterproof","shattuck","shave","shaven","shaw","shawl","shawnee","shay","she","she'd","she'll","shea","sheaf","shear","shearer","sheath","sheathe","sheave"
DATA "shed","shedir","sheehan","sheen","sheep","sheepskin","sheer","sheet","sheffield","sheik","sheila","shelby","sheldon","shelf","shell","shelley","shelter","shelton","shelve","shenandoah"
DATA "shenanigan","shepard","shepherd","sheppard","sheraton","sherbet","sheridan","sheriff","sherlock","sherman","sherrill","sherry","sherwin","sherwood","shibboleth","shied","shield","shields","shift","shifty"
DATA "shill","shiloh","shim","shimmy","shin","shinbone","shine","shingle","shinto","shiny","ship","shipboard","shipbuild","shipbuilding","shiplap","shipley","shipman","shipmate","shipmen","shipshape"
DATA "shipwreck","shipyard","shire","shirk","shirley","shirt","shirtmake","shish","shitepoke","shiv","shiver","shivery","shmuel","shoal","shock","shockley","shod","shoddy","shoe","shoehorn"
DATA "shoelace","shoemake","shoestring","shoji","shone","shoo","shoofly","shook","shoot","shop","shopkeep","shopworn","shore","shoreline","short","shortage","shortcoming","shortcut","shorten","shortfall"
DATA "shorthand","shortish","shortsighted","shortstop","shot","shotbush","shotgun","should","shoulder","shouldn't","shout","shove","shovel","show","showboat","showcase","showdown","showman","showmen","shown"
DATA "showpiece","showplace","showroom","showy","shrank","shrapnel","shred","shreveport","shrew","shrewd","shrewish","shriek","shrift","shrike","shrill","shrilly","shrimp","shrine","shrink","shrinkage"
DATA "shrive","shrivel","shroud","shrove","shrub","shrubbery","shrug","shrugging","shrunk","shrunken","shu","shuck","shudder","shuddery","shuffle","shuffleboard","shulman","shun","shunt","shut"
DATA "shutdown","shutoff","shutout","shuttle","shuttlecock","shy","shylock","sial","siam","siamese","sian","sib","siberia","sibilant","sibley","sibling","sibyl","sic","sicilian","sicily"
DATA "sick","sicken","sickish","sickle","sicklewort","sickroom","side","sidearm","sideband","sideboard","sidecar","sidelight","sideline","sidelong","sideman","sidemen","sidereal","siderite","sidesaddle","sideshow"
DATA "sidestep","sidestepping","sidetrack","sidewalk","sidewall","sideway","sidewinder","sidewise","sidle","sidney","siege","siegel","siegfried","sieglinda","siegmund","siemens","siena","sienna","sierra","siesta"
DATA "sieve","sift","sigh","sight","sightsee","sightseeing","sightseer","sigma","sigmund","sign","signal","signature","signboard","signet","significant","signify","signor","signora","signpost","sikorsky"
DATA "silage","silane","silas","silent","silhouette","silica","silicate","siliceous","silicic","silicide","silicon","silicone","silk","silken","silkworm","silky","sill","silly","silo","silt"
DATA "siltation","siltstone","silty","silver","silverman","silversmith","silverware","silvery","sima","similar","simile","similitude","simmer","simmons","simon","simons","simonson","simper","simple","simplectic"
DATA "simpleminded","simpleton","simplex","simplicial","simplicity","simplify","simplistic","simply","simpson","sims","simulate","simulcast","simultaneity","simultaneous","sin","sinai","since","sincere","sinclair","sine"
DATA "sinew","sinewy","sinful","sing","singable","singapore","singe","single","singlehanded","singlet","singleton","singsong","singular","sinh","sinister","sinistral","sink","sinkhole","sinter","sinuous"
DATA "sinus","sinusoid","sinusoidal","sioux","sip","sir","sire","siren","sirius","sis","sisal","siskin","sister","sistine","sisyphean","sisyphus","sit","site","situ","situate"
DATA "situs","siva","six","sixfold","sixgun","sixteen","sixteenth","sixth","sixtieth","sixty","size","sizzle","skat","skate","skater","skeet","skeletal","skeleton","skeptic","sketch"
DATA "sketchbook","sketchpad","sketchy","skew","ski","skid","skiddy","skied","skiff","skill","skillet","skillful","skim","skimp","skimpy","skin","skindive","skinny","skip","skipjack"
DATA "skippy","skirmish","skirt","skit","skittle","skopje","skulk","skull","skullcap","skullduggery","skunk","sky","skye","skyhook","skyjack","skylark","skylight","skyline","skyrocket","skyscrape"
DATA "skyward","skywave","skyway","slab","slack","slacken","sladang","slag","slain","slake","slam","slander","slanderous","slang","slant","slap","slapstick","slash","slat","slate"
DATA "slater","slaughter","slaughterhouse","slav","slave","slavery","slavic","slavish","slavonic","slay","sled","sledge","sledgehammer","sleek","sleep","sleepwalk","sleepy","sleet","sleety","sleeve"
DATA "sleigh","sleight","slender","slept","sleuth","slew","slice","slick","slid","slide","slight","slim","slime","slimy","sling","slingshot","slip","slippage","slippery","slit"
DATA "slither","sliver","slivery","sloan","sloane","slob","slocum","sloe","slog","slogan","sloganeer","slogging","sloop","slop","slope","sloppy","slosh","slot","sloth","slothful"
DATA "slouch","slough","slovakia","sloven","slovenia","slow","slowdown","sludge","slug","slugging","sluggish","sluice","slum","slumber","slump","slung","slur","slurp","slurry","slut"
DATA "sly","smack","small","smaller","smalley","smallish","smallpox","smalltime","smart","smash","smatter","smattering","smear","smell","smelt","smile","smirk","smith","smithereens","smithfield"
DATA "smithson","smithsonian","smithy","smitten","smog","smoke","smokehouse","smokescreen","smokestack","smoky","smolder","smooch","smooth","smoothbore","smother","smucker","smudge","smudgy","smug","smuggle"
DATA "smut","smutty","smyrna","smythe","snack","snafu","snag","snagging","snail","snake","snakebird","snakelike","snakeroot","snap","snapback","snapdragon","snappish","snappy","snapshot","snare"
DATA "snark","snarl","snatch","snazzy","sneak","sneaky","sneer","sneeze","snell","snick","snider","sniff","sniffle","sniffly","snifter","snigger","snip","snipe","snippet","snippy"
DATA "snivel","snob","snobbery","snobbish","snook","snoop","snoopy","snore","snorkel","snort","snotty","snout","snow","snowball","snowfall","snowflake","snowmobile","snowshoe","snowstorm","snowy"
DATA "snub","snuff","snuffer","snuffle","snuffly","snug","snuggle","snuggly","snyaptic","snyder","so","soak","soap","soapstone","soapsud","soapy","soar","sob","sober","sobriety"
DATA "sobriquet","soc","soccer","sociable","social","societal","societe","society","socioeconomic","sociology","sociometry","sock","socket","sockeye","socrates","socratic","sod","soda","sodden","sodium"
DATA "sofa","soffit","sofia","soft","softball","soften","software","softwood","soggy","soignee","soil","soiree","sojourn","sol","solace","solar","sold","solder","soldier","soldiery"
DATA "sole","solecism","solemn","solemnity","solenoid","solicit","solicitation","solicitor","solicitous","solicitude","solid","solidarity","solidify","solidus","soliloquy","solipsism","solitaire","solitary","soliton","solitude"
DATA "solo","solomon","solon","solstice","soluble","solute","solution","solvate","solve","solvent","soma","somal","somali","somatic","somber","sombre","some","somebody","somebody'll","someday"
DATA "somehow","someone","someone'll","someplace","somers","somersault","somerset","somerville","something","sometime","somewhat","somewhere","sommelier","sommerfeld","somnolent","son","sonant","sonar","sonata","song"
DATA "songbag","songbook","songful","sonic","sonnet","sonny","sonogram","sonoma","sonora","sonority","sonorous","sony","soon","soot","sooth","soothe","soothsay","soothsayer","sop","sophia"
DATA "sophie","sophism","sophisticate","sophistry","sophoclean","sophocles","sophomore","sophomoric","soprano","sora","sorb","sorcery","sordid","sore","sorensen","sorenson","sorghum","sorority","sorption","sorrel"
DATA "sorrow","sorrowful","sorry","sort","sortie","sou","souffle","sough","sought","soul","soulful","sound","soundproof","soup","sour","sourberry","source","sourdough","sourwood","sousa"
DATA "soutane","south","southampton","southbound","southeast","southeastern","southern","southernmost","southey","southland","southpaw","southward","southwest","southwestern","souvenir","sovereign","sovereignty","soviet","sovkhoz","sow"
DATA "sowbelly","sown","soy","soya","soybean","spa","space","spacecraft","spacesuit","spacetime","spacious","spade","spaghetti","spain","spalding","span","spandrel","spangle","spaniard","spaniel"
DATA "spanish","spar","spare","sparge","spark","sparkle","sparkman","sparky","sparling","sparrow","sparse","sparta","spartan","spasm","spastic","spat","spate","spatial","spatlum","spatterdock"
DATA "spatula","spaulding","spavin","spawn","spay","spayed","speak","speakeasy","spear","spearhead","spearmint","spec","special","specie","species","specific","specify","specimen","specious","speck"
DATA "speckle","spectacle","spectacular","spectator","spector","spectra","spectral","spectrogram","spectrograph","spectrography","spectrometer","spectrophotometer","spectroscope","spectroscopic","spectroscopy","spectrum","specular","speculate","sped","speech"
DATA "speed","speedboat","speedometer","speedup","speedwell","speedy","spell","spellbound","spencer","spencerian","spend","spent","sperm","spermatophyte","sperry","spew","sphagnum","sphalerite","sphere","spheric"
DATA "spheroid","spheroidal","spherule","sphinx","spica","spice","spicebush","spicy","spider","spiderwort","spidery","spiegel","spigot","spike","spikenard","spiky","spill","spilt","spin","spinach"
DATA "spinal","spindle","spine","spinnaker","spinneret","spinodal","spinoff","spinster","spiny","spiral","spire","spirit","spiritual","spiro","spit","spite","spiteful","spitfire","spittle","spitz"
DATA "splash","splashy","splat","splay","splayed","spleen","spleenwort","splendid","splenetic","splice","spline","splint","splintery","split","splotch","splotchy","splurge","splutter","spoil","spoilage"
DATA "spokane","spoke","spoken","spokesman","spokesmen","spokesperson","sponge","spongy","sponsor","spontaneity","spontaneous","spoof","spook","spooky","spool","spoon","spoonful","sporadic","spore","sport"
DATA "sportsman","sportsmen","sportswear","sportswrite","sportswriter","sportswriting","sporty","spot","spotlight","spotty","spouse","spout","sprague","sprain","sprang","sprawl","spray","spread","spree","sprig"
DATA "sprightly","spring","springboard","springe","springfield","springtail","springtime","springy","sprinkle","sprint","sprite","sprocket","sproul","sprout","spruce","sprue","sprung","spud","spume","spumoni"
DATA "spun","spunk","spur","spurge","spurious","spurn","spurt","sputnik","sputter","spy","spyglass","squabble","squad","squadron","squalid","squall","squamous","squander","square","squash"
DATA "squashberry","squashy","squat","squatted","squatter","squatting","squaw","squawbush","squawk","squawroot","squeak","squeaky","squeal","squeamish","squeegee","squeeze","squelch","squibb","squid","squill"
DATA "squint","squire","squirehood","squirm","squirmy","squirrel","squirt","squishy","sri","sse","sst","ssw","st","stab","stabile","stable","stableman","stablemen","staccato","stack"
DATA "stacy","stadia","stadium","staff","stafford","stag","stage","stagecoach","stagestruck","stagnant","stagnate","stagy","stahl","staid","stain","stair","staircase","stairway","stairwell","stake"
DATA "stalactite","stale","stalemate","staley","stalin","stalk","stall","stallion","stalwart","stamen","stamford","stamina","staminate","stammer","stamp","stampede","stan","stance","stanch","stanchion"
DATA "stand","standard","standby","standeth","standish","standoff","standpoint","standstill","stanford","stanhope","stank","stanley","stannic","stannous","stanton","stanza","staph","staphylococcus","staple","stapleton"
DATA "star","starboard","starch","starchy","stardom","stare","starfish","stargaze","stark","starkey","starlet","starlight","starling","starr","start","startle","startup","starvation","starve","stash"
DATA "stasis","state","staten","stater","stateroom","statesman","statesmanlike","statesmen","statewide","static","stationarity","stationary","stationery","stationmaster","statistician","statler","stator","statuary","statue","statuette"
DATA "stature","status","statute","statutory","stauffer","staunch","staunton","stave","stay","stayed","stead","steadfast","steady","steak","steal","stealth","stealthy","steam","steamboat","steamy"
DATA "stearate","stearic","stearns","steed","steel","steele","steelmake","steely","steen","steep","steepen","steeple","steeplebush","steeplechase","steer","steeve","stefan","stegosaurus","stein","steinberg"
DATA "steiner","stella","stellar","stem","stench","stencil","stenographer","stenography","stenotype","step","stepchild","stephanie","stephanotis","stephen","stephens","stephenson","stepmother","steppe","steprelation","stepson"
DATA "stepwise","steradian","stereo","stereography","stereoscopy","sterile","sterling","stern","sternal","sternberg","sterno","sternum","steroid","stethoscope","stetson","steuben","steve","stevedore","steven","stevens"
DATA "stevenson","stew","steward","stewardess","stewart","stick","stickle","stickleback","stickpin","sticktight","sticky","stiff","stiffen","stifle","stigma","stigmata","stile","stiletto","still","stillbirth"
DATA "stillwater","stilt","stimulant","stimulate","stimulatory","stimuli","stimulus","sting","stingy","stink","stinkpot","stinky","stint","stipend","stipple","stipulate","stir","stirling","stirrup","stitch"
DATA "stochastic","stock","stockade","stockbroker","stockholder","stockholm","stockpile","stockroom","stockton","stocky","stodgy","stoic","stoichiometry","stoke","stokes","stole","stolen","stolid","stomach","stomp"
DATA "stone","stonecrop","stonehenge","stonewall","stoneware","stonewort","stony","stood","stooge","stool","stoop","stop","stopband","stopcock","stopgap","stopover","stoppage","stopwatch","storage","store"
DATA "storehouse","storekeep","storeroom","storey","stork","storm","stormbound","stormy","story","storyboard","storyteller","stout","stove","stow","stowage","stowaway","strabismic","strabismus","straddle","strafe"
DATA "straggle","straight","straightaway","straighten","straightforward","straightway","strain","strait","strand","strange","strangle","strangulate","strap","strata","stratagem","strategic","strategist","strategy","stratford","stratify"
DATA "stratosphere","stratospheric","stratton","stratum","strauss","straw","strawberry","strawflower","stray","streak","stream","streamline","streamside","street","streetcar","strength","strengthen","strenuous","streptococcus","streptomycin"
DATA "stress","stressful","stretch","strewn","striate","stricken","strickland","strict","stricter","stricture","stride","strident","strife","strike","strikebreak","string","stringent","stringy","strip","stripe"
DATA "striptease","stripy","strive","striven","strobe","stroboscopic","strode","stroke","stroll","strom","stromberg","strong","stronghold","strongroom","strontium","strop","strophe","strove","struck","structural"
DATA "structure","struggle","strum","strung","strut","strychnine","stu","stuart","stub","stubble","stubborn","stubby","stucco","stuck","stud","studebaker","student","studio","studious","study"
DATA "stuff","stuffy","stultify","stumble","stump","stumpage","stumpy","stun","stung","stunk","stunt","stupefaction","stupefy","stupendous","stupid","stupor","sturbridge","sturdy","sturgeon","sturm"
DATA "stutter","stuttgart","stuyvesant","stygian","style","styli","stylish","stylites","stylus","stymie","styrene","styrofoam","styx","suave","sub","subject","subjectivity","subjunctive","sublimate","subliminal"
DATA "submersible","submit","submittal","submitted","submitting","subpoena","subrogation","subservient","subsidiary","subsidy","subsist","subsistent","substantial","substantiate","substantive","substituent","substitute","substitution","substitutionary","substrate"
DATA "subsume","subsumed","subsuming","subterfuge","subterranean","subtle","subtlety","subtly","subtracter","subtrahend","suburb","suburbia","subversive","subvert","succeed","success","successful","succession","successive","successor"
DATA "succinct","succubus","succumb","such","suck","suckling","sucrose","suction","sud","sudan","sudanese","sudden","suds","sue","suey","suez","suffer","suffice","sufficient","suffix"
DATA "suffocate","suffolk","suffrage","suffragette","suffuse","sugar","suggest","suggestible","suggestion","suggestive","suicidal","suicide","suit","suitcase","suite","suitor","sulfa","sulfanilamide","sulfate","sulfide"
DATA "sulfite","sulfonamide","sulfur","sulfuric","sulfurous","sulk","sulky","sullen","sullivan","sully","sulphur","sultan","sultanate","sultry","sum","sumac","sumatra","sumeria","sumerian","summand"
DATA "summarily","summary","summate","summation","summers","summertime","summit","summitry","summon","sumner","sumptuous","sumter","sun","sunbeam","sunbonnet","sunburn","sunburnt","sunday","sunder","sundew"
DATA "sundial","sundown","sundry","sunfish","sunflower","sung","sunglasses","sunk","sunken","sunlight","sunlit","sunny","sunnyvale","sunrise","sunscreen","sunset","sunshade","sunshine","sunshiny","sunspot"
DATA "suntan","suntanned","suntanning","suny","sup","super","superannuate","superb","superbly","supercilious","superficial","superfluity","superfluous","superintendent","superior","superlative","superlunary","supernatant","supernovae","superposable"
DATA "supersede","superstition","superstitious","supervene","supervisory","supine","supplant","supple","supplementary","supplicate","supply","support","supposable","suppose","supposition","suppress","suppressible","suppression","suppressor","supra"
DATA "supranational","supremacy","supreme","supremum","surcease","surcharge","sure","surety","surf","surface","surfactant","surfeit","surge","surgeon","surgery","surgical","surjection","surjective","surmise","surmount"
DATA "surname","surpass","surplus","surprise","surreal","surrender","surreptitious","surrey","surrogate","surround","surtax","surtout","surveillant","survey","surveyor","survival","survive","survivor","sus","susan"
DATA "susanne","susceptance","susceptible","sushi","susie","suspect","suspend","suspense","suspension","suspensor","suspicion","suspicious","sussex","sustain","sustenance","sutherland","sutton","suture","suzanne","suzerain"
DATA "suzerainty","suzuki","svelte","sw","swab","swabby","swag","swage","swahili","swain","swallow","swallowtail","swam","swami","swamp","swampy","swan","swank","swanky","swanlike"
DATA "swanson","swap","swarm","swart","swarthmore","swarthout","swarthy","swastika","swat","swatch","swath","swathe","sway","swaziland","swear","sweat","sweatband","sweater","sweatshirt","sweaty"
DATA "swede","sweden","swedish","sweeney","sweep","sweepstake","sweet","sweeten","sweetheart","sweetish","swell","swelt","swelter","swenson","swept","swerve","swift","swig","swigging","swim"
DATA "swimsuit","swindle","swine","swing","swingable","swingy","swipe","swirl","swirly","swish","swishy","swiss","switch","switchblade","switchboard","switchgear","switchman","switzer","switzerland","swivel"
DATA "swizzle","swollen","swoop","sword","swordfish","swordplay","swordtail","swore","sworn","swum","swung","sybarite","sybil","sycamore","sycophant","sycophantic","sydney","syenite","sykes","syllabi"
DATA "syllabic","syllabify","syllable","syllabus","syllogism","syllogistic","sylow","sylvan","sylvania","sylvester","sylvia","symbiosis","symbiotic","symbol","symbolic","symmetry","sympathetic","sympathy","symphonic","symphony"
DATA "symplectic","symposia","symposium","symptom","symptomatic","synagogue","synapse","synapses","synaptic","synchronism","synchronous","synchrony","synchrotron","syncopate","syndic","syndicate","syndrome","synergism","synergistic","synergy"
DATA "synge","synod","synonym","synonymous","synonymy","synopses","synopsis","synoptic","syntactic","syntax","syntheses","synthesis","synthetic","syracuse","syria","syringa","syringe","syrinx","syrup","syrupy"
DATA "system","systematic","systemic","systemization","systemwide","syzygy","szilard","t","t's","ta","tab","tabernacle","table","tableau","tableaux","tablecloth","tableland","tablespoon","tablespoonful","tablet"
DATA "tabloid","taboo","tabu","tabula","tabular","tabulate","tachinid","tachistoscope","tachometer","tacit","tacitus","tack","tackle","tacky","tacoma","tact","tactful","tactic","tactician","tactile"
DATA "tactual","tad","tadpole","taffeta","taffy","taft","tag","tagging","tahiti","tahoe","tail","tailgate","tailor","tailspin","tailwind","taint","taipei","taiwan","take","taken"
DATA "takeoff","takeover","taketh","talc","talcum","tale","talent","talisman","talismanic","talk","talkative","talkie","talky","tall","tallahassee","tallow","tally","tallyho","talmud","talon"
DATA "talus","tam","tamale","tamarack","tamarind","tambourine","tame","tammany","tamp","tampa","tampon","tan","tanager","tanaka","tananarive","tandem","tang","tangent","tangential","tangerine"
DATA "tangible","tangle","tango","tangy","tanh","tank","tannin","tansy","tantalum","tantalus","tantamount","tantrum","tanya","tanzania","tao","taoist","taos","tap","tapa","tape"
DATA "taper","tapestry","tapeworm","tapir","tapis","tappa","tappet","tar","tara","tarantara","tarantula","tarbell","tardy","target","tariff","tarnish","tarpaper","tarpaulin","tarpon","tarry"
DATA "tarrytown","tart","tartar","tartary","tarzan","task","taskmaster","tasmania","tass","tassel","taste","tasteful","tasting","tasty","tat","tate","tater","tattle","tattler","tattletale"
DATA "tattoo","tatty","tau","taught","taunt","taurus","taut","tautology","tavern","taverna","tawdry","tawny","tax","taxation","taxi","taxicab","taxied","taxiway","taxonomic","taxonomy"
DATA "taxpayer","taxpaying","taylor","tea","teacart","teach","teacup","teahouse","teakettle","teakwood","teal","team","teammate","teamster","teamwork","teapot","tear","teardrop","tearful","tease"
DATA "teasel","teaspoon","teaspoonful","teat","tech","technetium","technic","technician","technion","technique","technocrat","technocratic","technology","tectonic","tecum","ted","teddy","tedious","tedium","tee"
DATA "teeing","teem","teen","teenage","teensy","teet","teeter","teeth","teethe","teethed","teething","teetotal","teflon","tegucigalpa","teheran","tehran","tektite","tektronix","tel","telecommunicate"
DATA "teleconference","teledyne","telefunken","telegram","telegraph","telegraphy","telekinesis","telemeter","teleology","teleost","telepathic","telepathy","telephone","telephonic","telephony","telephotography","teleprinter","teleprocessing","teleprompter","telescope"
DATA "telescopic","telethon","teletype","teletypesetting","teletypewrite","televise","television","telex","tell","teller","telltale","tellurium","temerity","temper","tempera","temperance","temperate","temperature","tempest","tempestuous"
DATA "template","temple","templeton","tempo","temporal","temporary","tempt","temptation","temptress","ten","tenable","tenacious","tenacity","tenant","tend","tendency","tenderfoot","tenderloin","tendon","tenebrous"
DATA "tenement","tenet","tenfold","tenneco","tennessee","tenney","tennis","tennyson","tenon","tenor","tense","tensile","tension","tensional","tensor","tenspot","tent","tentacle","tentative","tenterhooks"
DATA "tenth","tenuous","tenure","tepee","tepid","teratogenic","teratology","terbium","tercel","teresa","term","terminable","terminal","terminate","termini","terminology","terminus","termite","tern","ternary"
DATA "terpsichore","terpsichorean","terra","terrace","terrain","terramycin","terrapin","terre","terrestrial","terrible","terrier","terrific","terrify","territorial","territory","terror","terry","terse","tertiary","tess"
DATA "tessellate","test","testament","testamentary","testate","testbed","testes","testicle","testicular","testify","testimonial","testimony","testy","tetanus","tete","tether","tetrachloride","tetrafluoride","tetrafluouride","tetragonal"
DATA "tetrahedra","tetrahedral","tetrahedron","tetravalent","teutonic","texaco","texan","texas","text","textbook","textile","textron","textual","textural","texture","thai","thailand","thalia","thallium","thallophyte"
DATA "than","thank","thankful","thanksgiving","that","that'd","that'll","thatch","thaw","thayer","the","thea","theatric","thebes","thee","theft","their","theism","theist","thelma"
DATA "them","thematic","theme","themselves","then","thence","thenceforth","theocracy","theodore","theodosian","theologian","theology","theorem","theoretic","theoretician","theorist","theory","therapeutic","therapist","therapy"
DATA "there","there'd","there'll","thereabouts","thereafter","thereat","thereby","therefor","therefore","therefrom","therein","thereof","thereon","theresa","thereto","theretofore","thereunder","thereupon","therewith","thermal"
DATA "thermionic","thermistor","thermo","thermofax","thermostat","thesaurus","these","theses","theseus","thesis","thespian","theta","thetis","they","they'd","they'll","they're","they've","thiamin","thick"
DATA "thicken","thicket","thickish","thief","thieves","thieving","thigh","thimble","thimbu","thin","thine","thing","think","thinnish","thiocyanate","thiouracil","third","thirst","thirsty","thirteen"
DATA "thirteenth","thirtieth","thirty","this","this'll","thistle","thistledown","thither","thomas","thomistic","thompson","thomson","thong","thor","thoreau","thoriate","thorium","thorn","thornton","thorny"
DATA "thorough","thoroughbred","thoroughfare","thoroughgoing","thorpe","thorstein","those","thou","though","thought","thoughtful","thousand","thousandfold","thousandth","thrall","thrash","thread","threadbare","threat","threaten"
DATA "three","threefold","threesome","threonine","thresh","threshold","threw","thrice","thrift","thrifty","thrill","thrips","thrive","throat","throaty","throb","throes","thrombosis","throne","throng"
DATA "throttle","through","throughout","throughput","throw","throwaway","throwback","thrown","thrum","thrush","thrust","thruway","thuban","thud","thug","thuggee","thule","thulium","thumb","thumbnail"
DATA "thump","thunder","thunderbird","thunderbolt","thunderclap","thunderflower","thunderous","thundershower","thunderstorm","thurman","thursday","thus","thwack","thwart","thy","thyme","thymine","thymus","thyratron","thyroglobulin"
DATA "thyroid","thyroidal","thyronine","thyrotoxic","thyroxine","ti","tiber","tibet","tibetan","tibia","tic","tick","ticket","tickle","ticklish","tid","tidal","tidbit","tide","tideland"
DATA "tidewater","tidy","tie","tied","tientsin","tier","tiffany","tift","tiger","tight","tighten","tigress","tigris","til","tilde","tile","till","tilt","tilth","tim"
DATA "timber","timberland","timbre","time","timeout","timepiece","timeshare","timetable","timeworn","timex","timid","timon","timothy","tin","tina","tincture","tinder","tine","tinfoil","tinge"
DATA "tingle","tinker","tinkle","tinsel","tint","tintype","tiny","tioga","tip","tipoff","tipperary","tipple","tippy","tipsy","tiptoe","tirade","tirana","tire","tiresome","tissue"
DATA "tit","titan","titanate","titanic","titanium","tithe","titian","titillate","title","titmouse","titrate","titular","titus","tn","tnt","to","toad","toady","toast","toastmaster"
DATA "tobacco","tobago","toby","toccata","today","today'll","todd","toddle","toe","toefl","toenail","toffee","tofu","tog","together","togging","toggle","togo","togs","toil"
DATA "toilet","toiletry","toilsome","tokamak","token","tokyo","told","toledo","tolerable","tolerant","tolerate","toll","tollgate","tollhouse","tolstoy","toluene","tom","tomato","tomatoes","tomb"
DATA "tombstone","tome","tomlinson","tommie","tommy","tomograph","tomography","tomorrow","tompkins","ton","tonal","tone","tong","tongue","toni","tonic","tonight","tonk","tonnage","tonsil"
DATA "tonsillitis","tony","too","toodle","took","tool","toolkit","toolmake","toolsmith","toot","tooth","toothbrush","toothpaste","toothpick","tootle","top","topaz","topcoat","topeka","topgallant"
DATA "topic","topmost","topnotch","topocentric","topography","topologize","topology","topple","topsoil","topsy","tor","torah","torch","tore","tori","torn","tornado","toroid","toroidal","toronto"
DATA "torpedo","torpid","torpor","torque","torr","torrance","torrent","torrid","torsion","torso","tort","tortoise","tortoiseshell","tortuous","torture","torus","tory","toshiba","toss","tot"
DATA "total","totalitarian","tote","totem","totemic","touch","touchdown","touchstone","touchy","tough","tour","tournament","tousle","tout","tow","toward","towboat","towel","tower","towhead"
DATA "towhee","town","townhouse","townsend","townsman","townsmen","toxic","toxicology","toxin","toy","toyota","trace","traceable","tracery","trachea","track","trackage","tract","tractor","tracy"
DATA "trade","trademark","tradeoff","tradesman","tradesmen","tradition","traffic","trafficked","trafficking","trag","tragedian","tragedy","tragic","tragicomic","trail","trailblaze","trailhead","trailside","train","trainee"
DATA "trainman","trainmen","traipse","trait","traitor","traitorous","trajectory","tram","trammel","tramp","trample","tramway","trance","tranquil","tranquillity","transact","transalpine","transatlantic","transceiver","transcend"
DATA "transcendent","transcendental","transconductance","transcontinental","transcribe","transcript","transcription","transducer","transduction","transect","transept","transfer","transferable","transferee","transference","transferor","transferral","transferred","transferring","transfinite"
DATA "transfix","transform","transformation","transfusable","transfuse","transfusion","transgress","transgression","transgressor","transient","transistor","transit","transite","transition","transitive","transitory","translate","transliterate","translucent","transmissible"
DATA "transmission","transmit","transmittable","transmittal","transmittance","transmitted","transmitter","transmitting","transmogrify","transmutation","transmute","transoceanic","transom","transpacific","transparent","transpiration","transpire","transplant","transplantation","transpond"
DATA "transport","transportation","transposable","transpose","transposition","transship","transshipped","transshipping","transversal","transverse","transvestite","transylvania","trap","trapezium","trapezoid","trapezoidal","trash","trashy","trastevere","trauma"
DATA "traumatic","travail","travel","travelogue","traversable","traversal","traverse","travertine","travesty","travis","trawl","tray","treacherous","treachery","tread","treadle","treadmill","treason","treasonous","treasure"
DATA "treasury","treat","treatise","treaty","treble","tree","treetop","trefoil","trek","trellis","tremble","tremendous","tremor","tremulous","trench","trenchant","trencherman","trenchermen","trend","trendy"
DATA "trenton","trepidation","trespass","tress","trestle","trevelyan","triable","triac","triad","trial","triangle","triangular","triangulate","triangulum","trianon","triassic","triatomic","tribal","tribe","tribesman"
DATA "tribesmen","tribulate","tribunal","tribune","tributary","tribute","triceratops","trichinella","trichloroacetic","trichloroethane","trichrome","trick","trickery","trickle","trickster","tricky","trident","tridiagonal","tried","triennial"
DATA "trifle","trifluoride","trifluouride","trig","trigonal","trigonometry","trigram","trihedral","trill","trillion","trillionth","trilobite","trilogy","trim","trimer","trimester","trinidad","trinitarian","trinity","trinket"
DATA "trio","triode","trioxide","trip","tripartite","tripe","triphenylphosphine","triple","triplet","triplett","triplex","triplicate","tripod","tripoli","triptych","trisodium","tristan","tristate","trisyllable","trite"
DATA "tritium","triton","triumph","triumphal","triumphant","triune","trivalent","trivia","trivial","trivium","trod","trodden","troglodyte","troika","trojan","troll","trolley","trollop","trombone","trompe"
DATA "troop","trophic","trophy","tropic","tropopause","troposphere","tropospheric","trot","troubador","trouble","troubleshoot","troublesome","trough","trounce","troupe","trouser","trout","troutman","troy","truancy"
DATA "truant","truce","truck","truculent","trudge","trudy","true","truism","truly","truman","trumbull","trump","trumpery","trumpet","truncate","trundle","trunk","truss","trust","trustee"
DATA "trustful","trustworthy","truth","truthful","trw","try","trypsin","trytophan","tsar","tsarina","tsunami","ttl","tty","tub","tuba","tube","tuberculin","tuberculosis","tubular","tubule"
DATA "tuck","tucker","tucson","tudor","tuesday","tuff","tuft","tug","tugging","tuition","tulane","tularemia","tulip","tulle","tulsa","tum","tumble","tumbrel","tumult","tumultuous"
DATA "tun","tuna","tundra","tune","tuneful","tung","tungstate","tungsten","tunic","tunis","tunisia","tunnel","tupelo","tuple","turban","turbid","turbidity","turbinate","turbine","turbofan"
DATA "turbojet","turbulent","turf","turgid","turin","turing","turk","turkey","turkish","turmoil","turn","turnabout","turnaround","turnery","turnip","turnkey","turnoff","turnout","turnover","turnpike"
DATA "turnstone","turntable","turpentine","turpitude","turquoise","turret","turtle","turtleback","turtleneck","turvy","tuscaloosa","tuscan","tuscany","tuscarora","tusk","tuskegee","tussle","tutelage","tutor","tutorial"
DATA "tuttle","tutu","tuxedo","tv","tva","twa","twaddle","twain","tweak","tweed","tweedy","tweeze","twelfth","twelve","twentieth","twenty","twice","twiddle","twig","twigging"
DATA "twilight","twill","twin","twine","twinge","twinkle","twirl","twirly","twist","twisty","twit","twitch","twitchy","two","twofold","twombly","twosome","twx","tx","tyburn"
DATA "tycoon","tying","tyler","tyndall","type","typeface","typescript","typeset","typesetter","typesetting","typewrite","typewritten","typhoid","typhon","typhoon","typhus","typic","typify","typo","typographer"
DATA "typography","typology","tyrannic","tyrannicide","tyrannosaurus","tyranny","tyrant","tyrosine","tyson","u","u's","u.s","u.s.a","ubiquitous","ubiquity","ucla","uganda","ugh","ugly","uhf"
DATA "uk","ukraine","ukrainian","ulan","ulcer","ulcerate","ullman","ulster","ulterior","ultimate","ultimatum","ultra","ulysses","umber","umbilical","umbilici","umbilicus","umbra","umbrage","umbrella"
DATA "umlaut","umpire","un","unanimity","unanimous","unary","unbeknownst","unbidden","unchristian","uncle","uncouth","unction","under","underclassman","underclassmen","underling","undulate","unesco","uniaxial","unicorn"
DATA "unidimensional","unidirectional","uniform","unify","unilateral","unimodal","unimodular","uninominal","union","uniplex","unipolar","uniprocessor","unique","uniroyal","unisex","unison","unit","unital","unitarian","unitary"
DATA "unite","unity","univac","univalent","univariate","universal","universe","unix","unkempt","unruly","until","unwieldy","up","upbeat","upbraid","upbring","upcome","update","updraft","upend"
DATA "upgrade","upheaval","upheld","uphill","uphold","upholster","upholstery","upkeep","upland","uplift","upon","upper","upperclassman","upperclassmen","uppercut","uppermost","upraise","upright","uprise","upriver"
DATA "uproar","uproarious","uproot","upset","upsetting","upshot","upside","upsilon","upslope","upstair","upstand","upstart","upstate","upstater","upstream","upsurge","upswing","uptake","upton","uptown"
DATA "uptrend","upturn","upward","upwind","uracil","urania","uranium","uranus","uranyl","urban","urbana","urbane","urbanite","urchin","urea","uremia","urethane","urethra","urge","urgency"
DATA "urgent","urging","uri","urinal","urinary","urine","uris","urn","ursa","ursula","ursuline","uruguay","us","usa","usable","usaf","usage","usc","usc&gs","usda"
DATA "use","useful","usgs","usher","usia","usn","usps","ussr","usual","usurer","usurious","usurp","usurpation","usury","ut","utah","utensil","uterine","uterus","utica"
DATA "utile","utilitarian","utility","utmost","utopia","utopian","utrecht","utter","utterance","uttermost","v","v's","va","vacant","vacate","vacationland","vaccinate","vaccine","vacillate","vacua"
DATA "vacuo","vacuolate","vacuole","vacuous","vacuum","vade","vaduz","vagabond","vagary","vagina","vaginal","vagrant","vague","vail","vain","vainglorious","vale","valediction","valedictorian","valedictory"
DATA "valent","valentine","valerie","valery","valet","valeur","valhalla","valiant","valid","validate","valine","valkyrie","valletta","valley","valois","valparaiso","valuate","value","valve","vamp"
DATA "vampire","van","vanadium","vance","vancouver","vandal","vandenberg","vanderbilt","vanderpoel","vane","vanguard","vanilla","vanish","vanity","vanquish","vantage","vapid","vaporous","variable","variac"
DATA "varian","variant","variate","variegate","variety","various","varistor","varitype","varnish","varsity","vary","vascular","vase","vasectomy","vasquez","vassal","vassar","vast","vat","vatican"
DATA "vaudeville","vaudois","vaughan","vaughn","vault","vaunt","veal","vector","vectorial","veda","vee","veer","veery","vega","vegetable","vegetarian","vegetate","vehement","vehicle","vehicular"
DATA "veil","vein","velar","velasquez","veldt","vella","vellum","velocity","velours","velvet","velvety","venal","vend","vendetta","vendible","vendor","veneer","venerable","venerate","venereal"
DATA "venetian","veneto","venezuela","vengeance","vengeful","venial","venice","venison","venom","venomous","venous","vent","ventilate","ventricle","venture","venturesome","venturi","venus","venusian","vera"
DATA "veracious","veracity","veranda","verandah","verb","verbal","verbatim","verbena","verbiage","verbose","verbosity","verdant","verde","verdi","verdict","verge","veridic","verify","verisimilitude","veritable"
DATA "verity","verlag","vermeil","vermiculite","vermilion","vermin","vermont","vermouth","verna","vernacular","vernal","verne","vernier","vernon","verona","veronica","versa","versailles","versatec","versatile"
DATA "verse","version","versus","vertebra","vertebrae","vertebral","vertebrate","vertex","vertical","vertices","vertigo","verve","very","vesicular","vesper","vessel","vest","vestal","vestibule","vestige"
DATA "vestigial","vestry","vet","vetch","veteran","veterinarian","veterinary","veto","vex","vexation","vexatious","vhf","vi","via","viaduct","vial","vibrant","vibrate","vibrato","viburnum"
DATA "vicar","vicarious","vice","viceroy","vichy","vicinal","vicinity","vicious","vicissitude","vicksburg","vicky","victim","victor","victoria","victorian","victorious","victory","victrola","victual","vida"
DATA "vide","video","videotape","vie","vienna","viennese","vientiane","viet","vietnam","vietnamese","view","viewpoint","viewport","vigil","vigilant","vigilante","vigilantism","vignette","vigorous","vii"
DATA "viii","viking","vile","vilify","villa","village","villain","villainous","villein","vincent","vindicate","vindictive","vine","vinegar","vineyard","vinson","vintage","vintner","vinyl","viola"
DATA "violate","violent","violet","violin","virgil","virgin","virginal","virginia","virginian","virgo","virgule","virile","virtual","virtue","virtuosi","virtuosity","virtuoso","virtuous","virulent","virus"
DATA "vis","visa","visage","viscera","visceral","viscoelastic","viscometer","viscosity","viscount","viscous","vise","vishnu","visible","visigoth","vision","visionary","visit","visitation","visitor","visor"
DATA "vista","visual","vita","vitae","vital","vitamin","vitiate","vito","vitreous","vitrify","vitriol","vitriolic","vitro","viva","vivace","vivacious","vivacity","vivaldi","vivian","vivid"
DATA "vivify","vivo","vixen","viz","vladimir","vladivostok","vocable","vocabularian","vocabulary","vocal","vocalic","vocate","vociferous","vogel","vogue","voice","voiceband","void","volatile","volcanic"
DATA "volcanism","volcano","volition","volkswagen","volley","volleyball","volstead","volt","volta","voltage","voltaic","voltaire","volterra","voltmeter","voluble","volume","volumetric","voluminous","voluntarism","voluntary"
DATA "volunteer","voluptuous","volvo","vomit","von","voodoo","voracious","voracity","vortex","vortices","vorticity","voss","votary","vote","votive","vouch","vouchsafe","vought","vow","vowel"
DATA "voyage","vreeland","vt","vulcan","vulgar","vulnerable","vulpine","vulture","vying","w","w's","wa","waals","wabash","wac","wack","wacke","wacky","waco","wad"
DATA "waddle","wade","wadi","wadsworth","wafer","waffle","wag","wage","wagging","waggle","wagner","wagoneer","wah","wahl","wail","wainscot","wainwright","waist","waistcoat","waistline"
DATA "wait","waite","waitress","waive","wake","wakefield","wakeful","waken","wakerobin","wakeup","walcott","walden","waldo","waldorf","waldron","wale","walgreen","walk","walkie","walkout"
DATA "walkover","walkway","wall","wallaby","wallace","wallboard","waller","wallet","wallis","wallop","wallow","wallpaper","walls","wally","walnut","walpole","walrus","walsh","walt","walter"
DATA "walters","waltham","walton","waltz","waltzing","wan","wand","wander","wane","wang","wangle","want","wanton","wapato","wapiti","wappinger","war","warble","ward","warden"
DATA "wardrobe","wardroom","ware","warehouse","warehouseman","warfare","warhead","waring","warlike","warm","warmhearted","warmish","warmonger","warmth","warmup","warn","warp","warplane","warrant","warranty"
DATA "warren","warrior","warsaw","wart","wartime","warty","warwick","wary","was","wash","washbasin","washboard","washbowl","washburn","washington","washout","washy","wasn't","wasp","waspish"
DATA "wasserman","wast","wastage","waste","wastebasket","wasteful","wasteland","wastewater","wastrel","watanabe","watch","watchband","watchdog","watchful","watchmake","watchman","watchmen","watchword","water","waterbury"
DATA "watercourse","waterfall","waterfront","watergate","waterhouse","waterline","waterloo","waterman","watermelon","waterproof","waters","watershed","waterside","watertown","waterway","watery","watkins","watson","watt","wattage"
DATA "wattle","watts","wave","waveform","wavefront","waveguide","wavelength","wavelet","wavenumber","wavy","wax","waxen","waxwork","waxy","way","waybill","waylaid","waylay","wayne","wayside"
DATA "wayward","we","we'd","we'll","we're","we've","weak","weaken","weal","wealth","wealthy","wean","weapon","weaponry","wear","wearied","wearisome","weary","weasel","weather"
DATA "weatherbeaten","weatherproof","weatherstrip","weatherstripping","weave","web","webb","weber","webster","weco","wed","wedge","wedlock","wednesday","wee","weed","weedy","week","weekday","weekend"
DATA "weeks","weep","wehr","wei","weierstrass","weigh","weight","weighty","weinberg","weinstein","weir","weird","weiss","welch","welcome","weld","weldon","welfare","well","wellbeing"
DATA "weller","welles","wellesley","wellington","wells","welsh","welt","wendell","wendy","went","wept","were","weren't","werner","wert","werther","wesley","wesleyan","west","westbound"
DATA "westchester","westerly","western","westernmost","westfield","westinghouse","westminster","weston","westward","wet","wetland","weyerhauser","whack","whale","whalen","wham","wharf","wharton","wharves","what"
DATA "what'd","what're","whatever","whatley","whatnot","whatsoever","wheat","wheatstone","whee","wheedle","wheel","wheelbase","wheelchair","wheelhouse","wheeze","wheezy","whelan","whelk","wheller","whelm"
DATA "whelp","when","whence","whenever","where","where'd","where're","whereabout","whereas","whereby","wherefore","wherein","whereof","whereon","wheresoever","whereupon","wherever","wherewith","wherewithal","whet"
DATA "whether","which","whichever","whiff","whig","while","whim","whimper","whimsey","whimsic","whine","whinny","whip","whiplash","whippany","whippet","whipple","whipsaw","whir","whirl"
DATA "whirligig","whirlpool","whirlwind","whish","whisk","whisper","whistle","whistleable","whit","whitaker","whitcomb","white","whiteface","whitehall","whitehead","whitehorse","whiten","whitetail","whitewash","whither"
DATA "whitlock","whitman","whitney","whittaker","whittier","whittle","whiz","whizzing","who","who'd","who'll","who've","whoa","whoever","whole","wholehearted","wholesale","wholesome","wholly","whom"
DATA "whomever","whomsoever","whoop","whoosh","whop","whore","whose","whosoever","whup","why","wi","wichita","wick","wicket","wide","widen","widespread","widgeon","widget","widow"
DATA "widowhood","width","widthwise","wield","wiener","wier","wife","wig","wigging","wiggins","wiggle","wiggly","wightman","wigmake","wigwam","wilbur","wilcox","wild","wildcat","wildcatter"
DATA "wilderness","wildfire","wildlife","wile","wiley","wilfred","wilful","wilhelm","wilhelmina","wilkes","wilkie","wilkins","wilkinson","will","willa","willard","willful","william","williams","williamsburg"
DATA "williamson","willie","willis","willoughby","willow","willowy","wills","wilma","wilmington","wilshire","wilson","wilsonian","wilt","wily","win","wince","winch","winchester","wind","windbag"
DATA "windbreak","windfall","windmill","window","windowpane","windowsill","windshield","windsor","windstorm","windsurf","windup","windward","windy","wine","winemake","winemaster","winery","wineskin","winfield","wing"
DATA "wingback","wingman","wingmen","wingspan","wingtip","winifred","wink","winkle","winnetka","winnie","winnipeg","winnipesaukee","winnow","wino","winslow","winsome","winston","winter","winters","wintertime"
DATA "winthrop","wintry","winy","wipe","wire","wireman","wiremen","wiretap","wiretapper","wiretapping","wiry","wisconsin","wisdom","wise","wiseacre","wisecrack","wisenheimer","wish","wishbone","wishful"
DATA "wishy","wisp","wispy","wistful","wit","witch","witchcraft","with","withal","withdraw","withdrawal","withdrawn","withdrew","withe","wither","withheld","withhold","within","without","withstand"
DATA "withstood","withy","witness","witt","witty","wive","wizard","wobble","woe","woebegone","woeful","wok","woke","wolcott","wold","wolf","wolfe","wolff","wolfgang","wolfish"
DATA "wolve","wolves","woman","womanhood","womb","wombat","women","won","won't","wonder","wonderful","wonderland","wondrous","wong","wont","woo","wood","woodard","woodbury","woodcarver"
DATA "woodcock","woodcut","wooden","woodgrain","woodhen","woodland","woodlawn","woodlot","woodpeck","woodrow","woodruff","woods","woodshed","woodside","woodward","woodwind","woodwork","woody","woodyard","wool"
DATA "woolgather","woolworth","wooster","wop","worcester","word","wordsworth","wordy","wore","work","workaday","workbench","workbook","workday","workforce","workhorse","workload","workman","workmanlike","workmen"
DATA "workout","workpiece","workplace","worksheet","workshop","workspace","workstation","worktable","world","worldwide","worm","wormy","worn","worrisome","worry","worse","worsen","worship","worshipful","worst"
DATA "worth","worthington","worthwhile","worthy","wotan","would","wouldn't","wound","wove","woven","wow","wrack","wraith","wrangle","wrap","wrapup","wrath","wrathful","wreak","wreath"
DATA "wreathe","wreck","wreckage","wrench","wrest","wrestle","wretch","wriggle","wright","wrigley","wring","wrinkle","wrist","wristband","wristwatch","writ","write","writeup","writhe","written"
DATA "wrong","wrongdo","wrongdoer","wrongdoing","wrongful","wronskian","wrote","wrought","wry","wu","wuhan","wv","wy","wyandotte","wyatt","wyeth","wylie","wyman","wyner","wynn"
DATA "wyoming","x","x's","xavier","xenon","xenophobia","xerography","xerox","xerxes","xi","xylem","xylene","xylophone","y","y's","yacht","yachtsman","yachtsmen","yah","yak"
DATA "yakima","yale","yalta","yam","yamaha","yang","yank","yankee","yankton","yaounde","yap","yapping","yaqui","yard","yardage","yardstick","yarmouth","yarmulke","yarn","yarrow"
DATA "yates","yaw","yawl","yawn","ye","yea","yeager","yeah","year","yearbook","yearn","yeast","yeasty","yeats","yell","yellow","yellowish","yellowknife","yellowstone","yelp"
DATA "yemen","yen","yeoman","yeomanry","yerkes","yeshiva","yesterday","yesteryear","yet","yiddish","yield","yin","yip","yipping","ymca","yodel","yoder","yoga","yoghurt","yogi"
DATA "yogurt","yoke","yokel","yokohama","yokuts","yolk","yon","yond","yonkers","yore","york","yorktown","yosemite","yost","you","you'd","you'll","you're","you've","young"
DATA "youngish","youngster","youngstown","your","yourself","yourselves","youth","youthful","yow","ypsilanti","ytterbium","yttrium","yucatan","yucca","yuck","yugoslav","yugoslavia","yuh","yuki","yukon"
DATA "yule","yves","yvette","ywca","z","z's","zachary","zag","zagging","zagreb","zaire","zambia","zan","zanzibar","zap","zazen","zeal","zealand","zealot","zealous"
DATA "zebra","zeiss","zellerbach","zen","zenith","zero","zeroes","zeroth","zest","zesty","zeta","zeus","ziegler","zig","zigging","zigzag","zigzagging","zilch","zimmerman","zinc"
DATA "zing","zion","zionism","zip","zippy","zircon","zirconium","zloty","zodiac","zodiacal","zoe","zomba","zombie","zone","zoo","zoology","zoom","zorn","zoroaster","zoroastrian"
DATA "zounds","zucchini","zurich","zygote"

DATA "XDONE"


Now note, this has a built in dictionary, but it's only about 20,000 words, so it's easy to miss things.

The way this works is rather simple, and is a process I came up with.... gosh.... probably over 30 years ago now, back when I was learning QB45 in high school!!

Our teacher had basically asked us to, "Write a program that gives the user ten random US States or Capitols, and ask them to supply the opposite. Grade them on how well they did with their work."

I wrote mine, and at that point, I figured out, "Hey, this isn't fair to count things wrong when the student obviously knows the answer and just made a minor spelling mistake like typing 'Mississipi' instead of 'Mississippi'!"

And thus, I came up with the solution of just counting letters and seeing if the user had a "close enough" match.

The problem there came with if you simply typed, "AAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBCCCCCCCCCCCCCCCCCCCCCCCCCC... and so on, all the way to ZZZZZZZZZZ", then you'd be guaranted to match all the letters in the actual answer!

And so I came up with this concept:

Count the number of right letters.
Anything else is a wrong letters.
Take a percentage of the right letters/answer letter count, and then subtract points for wrong letters. Score the result as a percentage and set a threshold for "How close is close enough to count it as correct...."

And that's basicallly this old spellcheck in a nutshell, for anyone who hasn't ever seen it before. Smile

You basically get:
100% match -- the word is in our database. You spelt it correct!

You spelt it wrong, so it gives you any word that is x% similar to yours via the rules above, that is in the database, as a possible correct suggestion. (If any exists.)

Print this item

  phone number to words
Posted by: Jack - 06-30-2024, 02:44 AM - Forum: General Discussion - Replies (13)

has anyone made a program to convert a phone number to words?

Print this item

  qb64 "OPEN" linux /dev/ devices
Posted by: Parkland - 06-29-2024, 01:38 PM - Forum: General Discussion - Replies (2)

Hi guys

I hate bugging but I'm not smart enough to figure this out on my own.

On desktop/ linux mint, I used qb64 to make a program to talk to rs485 devices.
The issue was that QB64 wouldn't properly open the /dev/usbserial1 (or whatever it was) so I'd open it using cutecom and then the qb64 program could send/receive over the device.

Now I have QB64 running on an orange pi zero3 and really want to figure out how I could make qb64 open devices so I can use them.

I do not know what I'm doing lol help

Print this item

  Multi-Mouse Pong v0.33 (requires 2-4 USB mice plugged into your PC)
Posted by: madscijr - 06-28-2024, 11:02 PM - Forum: Games - No Replies

For those who wonder, Whatever happened to Pong?, here is an answer.

It's a multiplayer paddle game programmed in BASIC that uses upto 4 USB mice for the controls.


.zip   multimouse-pong-0-33-x64.zip (Size: 2.22 MB / Downloads: 25)


[Image: pong-doubles-0-33.png]


[Image: pong-regular-0-33.png]


[Image: pong-regular-4player-0-33.png]



To play:

  • Download & unzip zip file (contains ready-to-run Windows x64 binaries and source code)
  • Make sure all files are in the same folder.
  • Plug in 2-4 USB mice into your PC.
  • Start "pongmain33".
  • There are 2 game variations:
    doubles means 2 players side by side, currently you need all 4 players (3 player version soon)
    volleyball means players are in front and back.
  • Instructions to play will be displayed on the screen. 
    Press 1 to cycle through the game variations.
    Press 2 to start.
    Press 3 to cancel a game in progress.
    Press 4 for debug messages
    Press 5 for test mode (ball bounces back whether or not it hits pddle)
    Press P to pause a game in progress.
    Press - (dash) to slow down ball.
    Press =/+ to speed up ball.
    Press Escape to exit program.

For anyone who wants to run from the source code:
  • Make sure "pongmain33.bas", "pongsub33.bas", "makeint.h" and "winproc.h" are in the same folder.
  • Plug in 2-4 USB mice before you start.
  • First compile "pongsub33.bas" (or run it, it will briefly run then quit).
  • Then run the game "pongmain33.bas". Give it a few seconds to get started.
    NOTE: You will see 2 programs running in your taskbar (the game + the subprogram that reads the mouse input).

Any feedback welcome.

Thanks again SpriggsySpriggs, Steffan-68, DSMan195276, SMcNeill and the QB64PE community for their invaluable contributions.

"PongMain33.bas":
Code: (Select All)
' ################################################################################################################################################################
' MULTI-MOUSE PONG main program "PongMain"
' ################################################################################################################################################################

' MULTI MOUSE PONG v0.33 by Softintheheadware

' -------------------------------------------------------------------------------
' ABOUT
' -------------------------------------------------------------------------------
' "Whatever happened to Pong?" - Frank Black
'
' Back in the '70s, many home Pong games and the Atari 2600 VCS
' came with 4 (four!) paddle controllers, so you could play with a buddy or 3.
' With paddle controllers, you could move your player as fast as your brain
' could move your hand, so these games were true tests of reflexes.
'
' Since then, personal computers and video games have evolved,
' and paddle controllers are not included with modern computers.
'
' Computers do however come with some sort of mouse, which is as responsive
' as the old paddle controllers.
' However computers typically work with only one mouse,
' so even though Pong games are common for people learning how to make games,
' they're not very fun, because if you want to play your friend,
' one of you has to use the keyboard, which kind of sucks!
'
' But what if you could just plug in an extra mouse for player 2?
' What if you could plug in 3 or 4 mice for 4-player Pong games?
'
' Well, go get yourself an extra USB mouse or 3, plug 'em in, and have fun!

' -------------------------------------------------------------------------------
' HOW TO USE
' -------------------------------------------------------------------------------
' 1. Plug 2-4 USB mice into your PC.
'
' 2. Place "makeint.h" and "winproc.h" in same folder as the program.
'
' 3. Compile the mouse reader program "PongSub" first
'    (or run it once, it will run briefly then exit).
'
' 4. Run the front end program "PongMain".
'    The main program will automatically start the subprogram "PongSub"
'    which should have the focus.
'
' 5. If your PC prompts for permission say Yes.
'    Be patient, the program takes a few seconds to start everything up
'    and get "situated"!
'
' 6. Click the mouse to make sure "PongSub" has the focus
'    (it's invisible but sitting on top of "PongMain").
'
' 7. Follow the instructions on screen. Basic instructions:
'    KEY       ACTION
'    1         Select game variation
'    2         Start game
'    3         Cancel game in progress
'    4         Toggle debug messages
'    5         Toggle test mode
'    P         Pause game in progress
'    - (dash)  Slow down ball
'    =/+       Speed up ball
'    Escape    Exit program
'
' 8. Press Esc to quit, or delete the file "Pong.DELETE-TO-CLOSE".
'    The main program creates this file at startup, and both the main and
'    sub programs periodically check that the file is still present.
'    If it is missing, both programs shut down.

' DEBUGGING CODE:
' There is currently a ton of commented out debugging code -
' sorry about the mess! [tosses coins to bartender]
' There were some terribly elusive problems to figure out.
' To enable debugging output: change Const cDebugEnabled to TRUE
' and search for "PrintDebug" and "DebugLog" and uncomment those lines.
' DebugPrint outputs to the console, DebugLog outputs to a file
' (named the same as the executable but with .txt appended to the filename).
' Enabling console in "PongSub" caused all sorts of problems,
' so to debug that, just use DebugLog.

' -------------------------------------------------------------------------------
' CHANGES
' -------------------------------------------------------------------------------
' DATE        WHO        WHAT
' 2021-02-13  madscijr   2-player pong controlled by keyboard & 1 mouse = NO FUN!
' 2022-09-07  madscijr   Started trying to read multiple mice.
' 2024-06-19  madscijr   Multiple mice working with help from QB64PE community.
' 2024-06-23  madscijr   MULTI-MOUSE PONG v0.27 first beta release.
' 2024-06-26  madscijr   v0.31 Added primitive splash screen with instructions,
'                        error message if subprogram not found,
'                        improved paddle bounce angle logic,
'                        speed up ball in X direction every few volleys,
'                        added press "F11" to show values on screen,
'                        added press "F12" to put in game for test mode,
'                        increased paddle width and max speeed,
'                        added press "-" (minus) to descrease ball speed
'                        and press =/+ to increase ball speed.
' 2024-06-27  madscijr   v0.32 Added Pong Doubles (default) game option.
' 2024-06-28  madscijr   v0.33 Moved a lot of duplicated code into routines,
'                        moved game variables into GameType UDT,
'                        added debugging variables (sMessage1..4) to help.

' -------------------------------------------------------------------------------
' TO DO
' -------------------------------------------------------------------------------
' * Hide the real mouse cursor and reactivate it when program closes.
' * Fix issue where when speed = max speed, ball.dx somehow changes to 1!
' * Let player choose options in attract mode
' * Cycle screen color in attract mode (Atari 2600 style screen saver)
' * Make it faster / more efficient (move logic into subroutines; LOTS of bloat!)
' * Improve ball collision logic
'   - Check for vertical collisions (for games like breakout, warlords)
'     * look ahead so if ball speed > paddle width, ball doesn't jump over paddle?
' * Get it working with _FullScreen _SquarePixels.
' * Get multi-mouse working for Mac & Linux.
' * Add game variation: doubles (teams side by side each 1/2 of court)
' * Add game variations: quadrapong, octopong, foosball, warlords, s'morelords!
' * Pongball Construction Set!
'   - let users customize any number of paddle games
'     eventually they should be able to create
'     Pong = every game variant in Atari 2600 Video Olympics,
'     Quadrapong = one player per side of the screen (top/bottom/right/left)
'     Pong Doubles = 2 players each side, each player gets 1/2 of the court
'     Breakout / Super Breakout / Tetris Breakout mashup
'     Warlords
'     Video Pinball / Pinball Construction Set
'   - Graphic options
'     * screen color
'     * object color
'     * object fill pattern
'     * customize court lines / net drawn on screen
'   - paddle size
'     * player can choose (novice, expert, etc.)
'     * grows/shrinks when?
'       - shrinks when score exceeds x% of winning score
'       - grows if opponent exceeds x% of winning score
'       - when hit trigger
'       - every x points
'       - when  opponent scores
'     * paddle type
'       - standard pong / breakout
'       - pinball flippers
'       - unusual shape (ie hole in middle)
'   - paddle movement
'     * x*axis only
'     * y*axis only
'     * diagonally
'     * freeform (x and y axis)
'     * momentum?
'     * slippery? (triggered for x seconds?)
'     * one mouse controls >1 paddles?
'   - paddle controls / mouse button functions
'     * speed up ball
'     * slow down ball
'     * push
'     * open/close like flippers
'     * catch ball / release
'     * release vs throw
'     * rotate paddle (up/down vs right/left)
'   - team play or every wo/man for themself?
'   - game rules
'     * boundaries
'       - score greater if ball thrown/hit from further away (like 3*pointer in basketball)
'       - player can't move outside defined area
'       - player penalized if they move outisde area
'       - player penalized if they stay in an area too long (basketball rules)
'     * score x to win or timed?
'     * allow tie or overtime?
'   - ball(s)
'     * one or multi?
'     * can be enclosed in walls (like super breakout)
'     * released by ball hitting trigger object
'   - viewing angle?
'     * top down (pong)
'     * front (breakout)
'     * side view with gravity (basketball / volleyball)
'     * top view with some gravity (pinball)
'   - movement rules
'     * gravity?
'     * friction?
'   - scoring goal
'     * types
'       - simple = edge of screen behind player
'       - hole in wall
'       - net (like in hockey/soccer)
'       - free*standing object
'       - basket (for side view)
'     * size
'       - can change?
'         * expands contracts continually (speed?)
'         * changes when (trigger)
'         * grows/shrinks every n seconds
'         * grows/shrinks when (score)
'     * if ball in goal, award points or game lost or player out?
'     * "anti*goal" = reduces score!
'   - walls (warlords / breakout)
'     * color of each layer
'     * destructible?
'       - # hits to destroy
'       - higher become lower?
'       - not destructible until hit from outside (contain other balls)
'   - how is ball served?
'     * automatically
'     * players take turns
'     * player who scored last
'     * pinball
'   - pinball type objects: see https://archive.org/details/pinball-construction-set-user-guide
'     * flippers
'     * ball launcher / plunger
'     * bumpers (various types)
'     * tunnel (entrance, exit, exit direction/velocity?)
'     * ball splitter = if a ball hits this it splits in two
'     * polygons = can have elasticity (bounce) or negative elasticity (slow down ball)
'     * slingshot
'     * kickers
'     * drop target
'     * ball hopper
'     * ball eater
'     * spinner
'     * magnet
'     * lanes
'     * gates
'     * rollover
'     * knife edge
'     * target = can take multiple hits to score
'     * trigger
'       - releases ball(s)
'       - opens/closes door
'       - moves object(s)
'       - changes paddle size
'       - activates object
'       - temporarily change gravity (for n seconds or until next trigger)
'       - can 1 trigger do >1 action, or do we just make multi triggers and place them near each other?
'       - if multiple, all triggers must be hit to cause action
'       - single use, reset immediately, times reset, or (re)activated by trigger?
'       - can take multiple hits to activeate?
'     * timed? appear after n seconds (or every n seconds)
'     * elastic = bounce object back
'     * speed up/slow down ball
'     * fling ball in random direction (spins around fast)
'     * reverser = auto*reverse dx and/or dy
'     * ball trap = stop (with gravity?)
'     * polygons / line objects?
'   - special objects
'     * automatic vs player control
'     * walls that extend
'     * puck launcher (hits ball then disappears, changes ball's trajectory)
'     * vacuum (suck ball in)
'   - (Find brainstorming with Pomly notes from 1996!)
' * Smarter collision detection
'   - Line intersection?
'   - Square vs Irregular polygon
'   - Pre-draw polygons
'   - Pixel detect under ball's pixels
' * Pre-calculate trajectories?
' * More multimouse games: 2-mouse archery?

' -------------------------------------------------------------------------------
' Thoughts
' -------------------------------------------------------------------------------
'   1 line for every angle 0-359°
'   lines stores in arrLineDX(z), arrLineDY(z)
'   1024x768 screen
'   4x4 ball size
'   ball at (x,y) with angle z
'   each line is 1-dimensional
'   linear # = arrAngle(x,y,z)
'   arrMove(z, linear #)
'   where linear # moves top left to bottom right
'   to calculate arrAngle and arrMove:
'   draw lines from/to (off screen? every location?)
'   for every angle, and for each pixel on the line and angle,
'   save the x,y,z to arrAngle
'   then use areAngle to populate  arrMove(z, linear #)
'   with 1024x768 screen and 4x4 ball size
'   that's 256x192 4x4 locations
'   256x192 = 49,152
'   256x192 x 360 = 17,694,720
'   with 1024x768 x 360 = 283,115,520

Option Explicit
_Title "PongMain"

'NOT SURE WHAT THIS LINE IS SUPPOSED TO DO? DISABLED FOR NOW:
'$ dynamic

$NoPrefix

'$Console:Only
'Console Off

' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
' BEGIN CONSTANTS
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Const cProgName = "PongMain"
Const FALSE = 0
Const TRUE = Not FALSE
Const cDebugEnabled = FALSE

' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
' CONSTANTS FOR GAME MODE USED FOR VARIABLE ThisGame.iGameMode
Const cAttractMode = 0
Const cInPlay = 1
Const cPaused = 2
'const cGameOver = 3

' OTHER GAME CONSTANTS
Const cNoDir = 0
Const cLeftDir = 1
Const cRightDir = 2
Const cUpDir = 3
Const cDownDir = 4

' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
' TEXT MODE COLORS:
Const c_Black = 0: Const c_Blue = 1: Const c_Green = 2: Const c_LtBlue = 3
Const c_Red = 4: Const c_Purple = 5: Const c_Orange = 6: Const c_White = 7
Const c_Gray = 8: Const c_Periwinkle = 9: Const c_LtGreen = 10: Const c_Cyan = 11
Const c_LtRed = 12: Const c_Pink = 13: Const c_Yellow = 14: Const c_LtGray = 15

' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
' FOR CONTROLLING WINDOW ON TOP, ETC.
Const SWP_NOSIZE = &H0001 'ignores cx and cy size parameters
Const SWP_NOMOVE = &H0002 'ignores x and y position parameters
Const SWP_NOZORDER = &H0004 'keeps z order and ignores hWndInsertAfter parameter
Const SWP_NOREDRAW = &H0008 'does not redraw window changes
Const SWP_NOACTIVATE = &H0010 'does not activate window
Const SWP_FRAMECHANGED = &H0020
Const SWP_SHOWWINDOW = &H0040
Const SWP_HIDEWINDOW = &H0080
Const SWP_NOCOPYBITS = &H0100
Const SWP_NOOWNERZORDER = &H0200
Const SWP_NOSENDCHANGING = &H0400
Const SWP_DRAWFRAME = SWP_FRAMECHANGED
Const SWP_NOREPOSITION = SWP_NOOWNERZORDER
Const SWP_DEFERERASE = &H2000
Const SWP_ASYNCWINDOWPOS = &H4000
Const HWND_TOP = 0 'window at top of z order no focus
Const HWND_BOTTOM = 1 'window at bottom of z order no focus
Const HWND_TOPMOST = -1 'window above all others no focus unless active
Const HWND_NOTOPMOST = -2 'window below active no focus

' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
' FOR CONTROLLING WINDOW FOCUS
Const SW_SHOW = 5

'' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
'' CONSTANT FOR 2ND DIMENSION OF arrFile ARRAY
'Const cFileName = 0
'Const cFileData = 1

' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
' CONSTANT FOR WHAT DATA IS EXPECTED FROM THIS LINE IN FILE
Const cForPlayer = 1
'Const cUpdateCount = 2
Const cMouseDX = 2
Const cMouseDY = 3
Const cMousePosX = 4
Const cMousePosY = 5
Const cMouseWheel = 6
Const cMouseLeftDown = 7
Const cMouseMiddleDown = 8
Const cMouseRightDown = 9

Const cMouseSpeedX = 0 ' smaller = faster
Const cMouseSpeedY = 2 ' smaller = faster

' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
' BEGIN Virtual-Key Codes
' https://learn.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes
' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
' NOTE: raw.data.Keyboard.vKey may require set extended bit
Const VK_LBUTTON = &H01 ' dec = 1, Left mouse button
Const VK_RBUTTON = &H02 ' dec = 2, Right mouse button
Const VK_CANCEL = &H03 ' dec = 3, Control-break processing
Const VK_MBUTTON = &H04 ' dec = 4, Middle mouse button
Const VK_XBUTTON1 = &H05 ' dec = 5, X1 mouse button
Const VK_XBUTTON2 = &H06 ' dec = 6, X2 mouse button
'??? = &H07 ' dec = 7, Reserved
Const VK_BACK = &H08 ' dec = 8, BACKSPACE key
Const VK_TAB = &H09 ' dec = 9, TAB key
'??? = &H0A-0B ' dec = 10-11, Reserved
Const VK_CLEAR = &H0C ' dec = 12, CLEAR key
Const VK_RETURN = &H0D ' dec = 13, ENTER key
'??? = &H0E-0F ' dec = 14-15, Unassigned
Const VK_SHIFT = &H10 ' dec = 16, SHIFT key
Const VK_CONTROL = &H11 ' dec = 17, CTRL key
Const VK_MENU = &H12 ' dec = 18, ALT key
Const VK_PAUSE = &H13 ' dec = 19, PAUSE key
Const VK_CAPITAL = &H14 ' dec = 20, CAPS LOCK key
Const VK_KANA = &H15 ' dec = 21, IME Kana mode
Const VK_HANGUL = &H15 ' dec = 21, IME Hangul mode
Const VK_IME_ON = &H16 ' dec = 22, IME On
Const VK_JUNJA = &H17 ' dec = 23, IME Junja mode
Const VK_FINAL = &H18 ' dec = 24, IME final mode
Const VK_HANJA = &H19 ' dec = 25, IME Hanja mode
Const VK_KANJI = &H19 ' dec = 25, IME Kanji mode
Const VK_IME_OFF = &H1A ' dec = 26, IME Off
Const VK_ESCAPE = &H1B ' dec = 27, ESC key
Const VK_CONVERT = &H1C ' dec = 28, IME convert
Const VK_NONCONVERT = &H1D ' dec = 29, IME nonconvert
Const VK_ACCEPT = &H1E ' dec = 30, IME accept
Const VK_MODECHANGE = &H1F ' dec = 31, IME mode change request
Const VK_SPACE = &H20 ' dec = 32, SPACEBAR
Const VK_PRIOR = &H21 ' dec = 33, PAGE UP key
Const VK_NEXT = &H22 ' dec = 34, PAGE DOWN key
Const VK_END = &H23 ' dec = 35, END key
Const VK_HOME = &H24 ' dec = 36, HOME key
Const VK_LEFT = &H25 ' dec = 37, LEFT ARROW key
Const VK_UP = &H26 ' dec = 38, UP ARROW key
Const VK_RIGHT = &H27 ' dec = 39, RIGHT ARROW key
Const VK_DOWN = &H28 ' dec = 40, DOWN ARROW key
Const VK_SELECT = &H29 ' dec = 41, SELECT key
Const VK_PRINT = &H2A ' dec = 42, PRINT key
Const VK_EXECUTE = &H2B ' dec = 43, EXECUTE key
Const VK_SNAPSHOT = &H2C ' dec = 44, PRINT SCREEN key
Const VK_INSERT = &H2D ' dec = 45, INS key
Const VK_DELETE = &H2E ' dec = 46, DEL key
Const VK_HELP = &H2F ' dec = 47, HELP key

' MADE OUR OWN CONSTANTS FOR THESE:
Const VK_0 = &H30 ' dec = 48, 0 key
Const VK_1 = &H31 ' dec = 49, 1 key
Const VK_2 = &H32 ' dec = 50, 2 key
Const VK_3 = &H33 ' dec = 51, 3 key
Const VK_4 = &H34 ' dec = 52, 4 key
Const VK_5 = &H35 ' dec = 53, 5 key
Const VK_6 = &H36 ' dec = 54, 6 key
Const VK_7 = &H37 ' dec = 55, 7 key
Const VK_8 = &H38 ' dec = 56, 8 key
Const VK_9 = &H39 ' dec = 57, 9 key
'??? = &H3A-40 ' dec = 58-64, Undefined
Const VK_A = &H41 ' dec = 65, A key
Const VK_B = &H42 ' dec = 66, B key
Const VK_C = &H43 ' dec = 67, C key
Const VK_D = &H44 ' dec = 68, D key
Const VK_E = &H45 ' dec = 69, E key
Const VK_F = &H46 ' dec = 70, F key
Const VK_G = &H47 ' dec = 71, G key
Const VK_H = &H48 ' dec = 72, H key
Const VK_I = &H49 ' dec = 73, I key
Const VK_J = &H4A ' dec = 74, J key
Const VK_K = &H4B ' dec = 75, K key
Const VK_L = &H4C ' dec = 76, L key
Const VK_M = &H4D ' dec = 77, M key
Const VK_N = &H4E ' dec = 78, N key
Const VK_O = &H4F ' dec = 79, O key
Const VK_P = &H50 ' dec = 80, P key
Const VK_Q = &H51 ' dec = 81, Q key
Const VK_R = &H52 ' dec = 82, R key
Const VK_S = &H53 ' dec = 83, S key
Const VK_T = &H54 ' dec = 84, T key
Const VK_U = &H55 ' dec = 85, U key
Const VK_V = &H56 ' dec = 86, V key
Const VK_W = &H57 ' dec = 87, W key
Const VK_X = &H58 ' dec = 88, X key
Const VK_Y = &H59 ' dec = 89, Y key
Const VK_Z = &H5A ' dec = 90, Z key

' Microsoft's Virtual-Key Codes constants (continued):
Const VK_LWIN = &H5B ' dec = 91, Left Windows key
Const VK_RWIN = &H5C ' dec = 92, Right Windows key
Const VK_APPS = &H5D ' dec = 93, Applications key
'??? = &H5E ' dec = 94, Reserved
Const VK_SLEEP = &H5F ' dec = 95, Computer Sleep key
Const VK_NUMPAD0 = &H60 ' dec = 96, Numeric keypad 0 key
Const VK_NUMPAD1 = &H61 ' dec = 97, Numeric keypad 1 key
Const VK_NUMPAD2 = &H62 ' dec = 98, Numeric keypad 2 key
Const VK_NUMPAD3 = &H63 ' dec = 99, Numeric keypad 3 key
Const VK_NUMPAD4 = &H64 ' dec = 100, Numeric keypad 4 key
Const VK_NUMPAD5 = &H65 ' dec = 101, Numeric keypad 5 key
Const VK_NUMPAD6 = &H66 ' dec = 102, Numeric keypad 6 key
Const VK_NUMPAD7 = &H67 ' dec = 103, Numeric keypad 7 key
Const VK_NUMPAD8 = &H68 ' dec = 104, Numeric keypad 8 key
Const VK_NUMPAD9 = &H69 ' dec = 105, Numeric keypad 9 key
Const VK_MULTIPLY = &H6A ' dec = 106, Multiply key
Const VK_ADD = &H6B ' dec = 107, Add key
Const VK_SEPARATOR = &H6C ' dec = 108, Separator key
Const VK_SUBTRACT = &H6D ' dec = 109, Subtract key
Const VK_DECIMAL = &H6E ' dec = 110, Decimal key
Const VK_DIVIDE = &H6F ' dec = 111, Divide key
Const VK_F1 = &H70 ' dec = 112, F1 key
Const VK_F2 = &H71 ' dec = 113, F2 key
Const VK_F3 = &H72 ' dec = 114, F3 key
Const VK_F4 = &H73 ' dec = 115, F4 key
Const VK_F5 = &H74 ' dec = 116, F5 key
Const VK_F6 = &H75 ' dec = 117, F6 key
Const VK_F7 = &H76 ' dec = 118, F7 key
Const VK_F8 = &H77 ' dec = 119, F8 key
Const VK_F9 = &H78 ' dec = 120, F9 key
Const VK_F10 = &H79 ' dec = 121, F10 key
Const VK_F11 = &H7A ' dec = 122, F11 key
Const VK_F12 = &H7B ' dec = 123, F12 key
Const VK_F13 = &H7C ' dec = 124, F13 key
Const VK_F14 = &H7D ' dec = 125, F14 key
Const VK_F15 = &H7E ' dec = 126, F15 key
Const VK_F16 = &H7F ' dec = 127, F16 key
Const VK_F17 = &H80 ' dec = 128, F17 key
Const VK_F18 = &H81 ' dec = 129, F18 key
Const VK_F19 = &H82 ' dec = 130, F19 key
Const VK_F20 = &H83 ' dec = 131, F20 key
Const VK_F21 = &H84 ' dec = 132, F21 key
Const VK_F22 = &H85 ' dec = 133, F22 key
Const VK_F23 = &H86 ' dec = 134, F23 key
Const VK_F24 = &H87 ' dec = 135, F24 key
'??? = &H88-8F ' dec = 136-143, Reserved
Const VK_NUMLOCK = &H90 ' dec = 144, NUM LOCK key
Const VK_SCROLL = &H91 ' dec = 145, SCROLL LOCK key
'??? = &H92-96 ' dec = 146-150, OEM specific
'??? = &H97-9F ' dec = 151-159, Unassigned
Const VK_LSHIFT = &HA0 ' dec = 160, Left SHIFT key
Const VK_RSHIFT = &HA1 ' dec = 161, Right SHIFT key
Const VK_LCONTROL = &HA2 ' dec = 162, Left CONTROL key
Const VK_RCONTROL = &HA3 ' dec = 163, Right CONTROL key
Const VK_LMENU = &HA4 ' dec = 164, Left ALT key
Const VK_RMENU = &HA5 ' dec = 165, Right ALT key
Const VK_BROWSER_BACK = &HA6 ' dec = 166, Browser Back key
Const VK_BROWSER_FORWARD = &HA7 ' dec = 167, Browser Forward key
Const VK_BROWSER_REFRESH = &HA8 ' dec = 168, Browser Refresh key
Const VK_BROWSER_STOP = &HA9 ' dec = 169, Browser Stop key
Const VK_BROWSER_SEARCH = &HAA ' dec = 170, Browser Search key
Const VK_BROWSER_FAVORITES = &HAB ' dec = 171, Browser Favorites key
Const VK_BROWSER_HOME = &HAC ' dec = 172, Browser Start and Home key
Const VK_VOLUME_MUTE = &HAD ' dec = 173, Volume Mute key
Const VK_VOLUME_DOWN = &HAE ' dec = 174, Volume Down key
Const VK_VOLUME_UP = &HAF ' dec = 175, Volume Up key
Const VK_MEDIA_NEXT_TRACK = &HB0 ' dec = 176, Next Track key
Const VK_MEDIA_PREV_TRACK = &HB1 ' dec = 177, Previous Track key
Const VK_MEDIA_STOP = &HB2 ' dec = 178, Stop Media key
Const VK_MEDIA_PLAY_PAUSE = &HB3 ' dec = 179, Play/Pause Media key
Const VK_LAUNCH_MAIL = &HB4 ' dec = 180, Start Mail key
Const VK_LAUNCH_MEDIA_SELECT = &HB5 ' dec = 181, Select Media key
Const VK_LAUNCH_APP1 = &HB6 ' dec = 182, Start Application 1 key
Const VK_LAUNCH_APP2 = &HB7 ' dec = 183, Start Application 2 key
'??? = &HB8-B9 ' dec = 184-137, Reserved
Const VK_OEM_1 = &HBA ' dec = 186, Used for miscellaneous characters; it can vary by keyboard. For the US standard keyboard, the ;: key
Const VK_OEM_PLUS = &HBB ' dec = 187, For any country/region, the + key
Const VK_OEM_COMMA = &HBC ' dec = 188, For any country/region, the , key
Const VK_OEM_MINUS = &HBD ' dec = 189, For any country/region, the - key
Const VK_OEM_PERIOD = &HBE ' dec = 190, For any country/region, the . key
Const VK_OEM_2 = &HBF ' dec = 191, Used for miscellaneous characters; it can vary by keyboard. For the US standard keyboard, the /? key
Const VK_OEM_3 = &HC0 ' dec = 192, Used for miscellaneous characters; it can vary by keyboard. For the US standard keyboard, the `~ key
'??? = &HC1-DA ' dec = 193-218, Reserved
Const VK_OEM_4 = &HDB ' dec = 219, Used for miscellaneous characters; it can vary by keyboard. For the US standard keyboard, the [{ key
Const VK_OEM_5 = &HDC ' dec = 220, Used for miscellaneous characters; it can vary by keyboard. For the US standard keyboard, the \\| key
Const VK_OEM_6 = &HDD ' dec = 221, Used for miscellaneous characters; it can vary by keyboard. For the US standard keyboard, the ]} key
Const VK_OEM_7 = &HDE ' dec = 222, Used for miscellaneous characters; it can vary by keyboard. For the US standard keyboard, the '" key
Const VK_OEM_8 = &HDF ' dec = 223, Used for miscellaneous characters; it can vary by keyboard.
'??? = &HE0 ' dec = 224, Reserved
'??? = &HE1 ' dec = 225, OEM specific
Const VK_OEM_102 = &HE2 ' dec = 226, The <> keys on the US standard keyboard, or the \\| key on the non-US 102-key keyboard
'??? = &HE3-E4 ' dec = 227-228, OEM specific
Const VK_PROCESSKEY = &HE5 ' dec = 229, IME PROCESS key
'??? = &HE6 ' dec = 230, OEM specific
Const VK_PACKET = &HE7 ' dec = 231, Used to pass Unicode characters as if they were keystrokes. The VK_PACKET key is the low word of a 32-bit Virtual Key value used for non-keyboard input methods. For more information, see Remark in KEYBDINPUT, SendInput, WM_KEYDOWN, and WM_KEYUP
'??? = &HE8 ' dec = 232, Unassigned
'??? = &HE9-F5 ' dec = 233-245, OEM specific
Const VK_ATTN = &HF6 ' dec = 246, Attn key
Const VK_CRSEL = &HF7 ' dec = 247, CrSel key
Const VK_EXSEL = &HF8 ' dec = 248, ExSel key
Const VK_EREOF = &HF9 ' dec = 249, Erase EOF key
Const VK_PLAY = &HFA ' dec = 250, Play key
Const VK_ZOOM = &HFB ' dec = 251, Zoom key
Const VK_NONAME = &HFC ' dec = 252, Reserved
Const VK_PA1 = &HFD ' dec = 253, PA1 key
Const VK_OEM_CLEAR = &HFE ' dec = 254, Clear key
' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
' END Virtual-Key Codes
' ----------------------------------------------------------------------------------------------------------------------------------------------------------------

' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
' END CONSTANTS
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
' BEGIN TYPE DECLARATIONS
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

' UDT TO HOLD THE INFO FOR EACH PLAYER
Type PlayerType
    IsAvailable As Integer ' IF FALSE, THIS PLAYER IS NOT AVAILABLE FOR THE CURRENT GAME OPTION
    IsActive As Integer ' MOUSE DETECTED, CHANGE THIS TO TRUE AND SHOW PLAYER (IF AVAILABLE FOR CURRENT GAME)
    TeamNumber As Integer ' 1 = LEFT SIDE OF SCREEN, 2 = RIGHT; LATER EXPAND FOR OTHER GAME VARIANTS (WARLORDS, QUADRAPONG, OCTOPONG, ETC.)

    ID As String ' player identifier or mouse device ID
    'Name As String ' player name

    ' GAME VALUES
    Score As Integer

    ' WHERE TO DISPLAY PLAYER INFO
    scoreCol As Integer ' text column to display score at
    scoreRow As Integer ' text row    to display score at
    nameCol As Integer '  text column to display name  at
    nameRow As Integer '  text row    to display name  at

    ' POSITION + GRAPHIC VALUES
    color As _Unsigned Long
    x As Long ' player x position
    y As Long ' player y position
    width As Integer
    height As Integer

    BounceSegmentWidth As Double
    BounceSegmentHeight As Double
    'x1 As Integer
    'y1 As Integer
    'x2 As Integer
    'y2 As Integer

    ' BOUNDARIES
    minX As Long
    maxX As Long
    minY As Long
    maxY As Long

    ' MOUSE INPUT VARIABLES
    px As Long ' pointer x position (hires) for absolute position of mouse from raw input api
    py As Long ' pointer y position (hires) for absolute position of mouse from raw input api
    LeftDown As Integer ' tracks left mouse button state, TRUE=down
    MiddleDown As Integer ' tracks middle mouse button state, TRUE=down
    RightDown As Integer ' tracks right mouse button state, TRUE=down
    LeftDownOld As Integer ' tracks left mouse button state, TRUE=down
    MiddleDownOld As Integer ' tracks middle mouse button state, TRUE=down
    RightDownOld As Integer ' tracks right mouse button state, TRUE=down
    'wheel As Integer ' mouse wheel value
    'wheelOld As Integer ' old mouse wheel value

    ' KEYBOARD INPUT VARIABLES
    UpKey As Integer
    DownKey As Integer

    ' NOT USED HERE
    'dx As Integer ' mouse x movement -1=left, 1=right, 0=none
    'dy As Integer ' mouse y movement -1=up  , 1=down , 0=none
    'oldX As Long ' tracks old x position to erase screen
    'oldY As Long ' tracks old y position to erase screen
    'pxOld As Long ' old pointer x position (hires) for absolute position of mouse from raw input api
    'pyOld As Long ' old pointer y position (hires) for absolute position of mouse from raw input api
    'pdx As Long ' x delta (hires) for absolute position of mouse from raw input api
    'pdy As Long ' y delta (hires) for absolute position of mouse from raw input api

    ' TEST VALUES
    'char As String ' cursor character
    'row As Integer ' line to display values at
    'Message As String
End Type ' PlayerType

' UDT TO HOLD THE INFO FOR EACH BALL
Type BallType
    size As Integer
    color As _Unsigned Long

    ' POSITION
    x As Integer
    y As Integer

    '' FOR LOOK AHEAD
    'nextX as integer
    'nextY as integer

    ' MOVEMENT
    dx As Integer
    dy As Integer

    ' BOUNDARIES
    minX As Long
    maxX As Long
    minY As Long
    maxY As Long

    'x1 as integer
    'y1 as integer
    'x2 as integer
    'y2 as integer
End Type ' BallType

' UDT TO HOLD OPTIONS FOR EACH GAME VARIANT
' FOR NOW IT JUST HOLDS THE NAME
' TODO: MAYBE DEVELOP A NOTATION TO CONTROL THINGS LIKE
'       HOW EACH PLAYER MOVES (HORIZONTALLY, VERTICALLY, BOTH, ETC.)
'       EACH PLAYER'S BOUNDARIES
'       ETC.
Type GameOptionType
    name As String ' the name of the game
End Type ' GameOptionType

' UDT TO HOLD VALUES FOR THE CURRENT GAME
' THAT ARE SET INSIDE InitGame DEPENDING ON THE GAME VARIANT CHOSEN
Type GameType
    imgBackground As Long ' NEEDS _FREEIMAGE AT END
    imgWalls As Long ' NEEDS _FREEIMAGE AT END
    imgText As Long ' NEEDS _FREEIMAGE AT END
    imgPlayers As Long ' NEEDS _FREEIMAGE AT END
    imgScore As Long ' NEEDS _FREEIMAGE AT END

    ulngScreenColor As _Unsigned Long ' screen_color~& ulngScreenColor
    ulngWallColor As _Unsigned Long ' wall_color~&
    iTeam1ScoreColumn As Integer
    iTeam2ScoreColumn As Integer
    iTeam1ScoreRow As Integer
    iTeam2ScoreRow As Integer

    iScoreToWin As Integer

    iScore1 As Integer
    iScore2 As Integer

    iGameMode As Integer ' TRACK GAME STATE, can be cAttractMode, cInPlay, cPaused
    'iWhoLastHitBall as integer

    iGameType As Integer ' the current game (variable index)
    sGameName As String ' the current game (name)

    ' SPEED SETTINGS
    MinSpeed As Integer
    MaxSpeed As Integer
    iIncreaseSpeedEvery As Integer ' # times ball crosses net before increasing speed (add +1 to speed)

    ' TRACK GAME SPEED, COUNT # VOLLEYS, ETC.
    iSpeed As Integer ' for now just the overall speed of the game
    iVolleyNum As Integer
    iVolleyDir As Integer
    iIncreaseSpeedAtVolley As Integer ' next iVolleyNum to increase speed at
    bSpeedChanged As Integer

    ' FOR DEBUGGING
    bTestMode As Integer ' IF TRUE, BALL BOUNCES BACK WHETHER IT HITS PADDLES OR NOT
    bShowValues As Integer ' IF TRUE, DISPLAYS sMessage1..4 at bottom of screen, which can be set to show debug info
    sMessage1 As String
    sMessage2 As String
    sMessage3 As String
    sMessage4 As String

End Type ' GameType

' UDT TO HOLD THE PARAMETERS FOR EACH PLAYER PER GAME OPTION
Type InitPlayerType
    IsAvailable As Integer ' IF FALSE, THIS PLAYER IS NOT AVAILABLE FOR THE CURRENT GAME OPTION
    TeamNumber As Integer ' TEAM PLAYER IS ON FOR THIS OPTION; 1 = LEFT SIDE OF SCREEN, 2 = RIGHT; LATER EXPAND FOR OTHER GAME VARIANTS (WARLORDS, QUADRAPONG, OCTOPONG, ETC.)
    ID As String ' default player identifier, can be used to describe positions, e.g., "center", "halfback", "fullback", etc.

    ' POSITION + GRAPHIC VALUES
    color As _Unsigned Long
    x As Long ' player x position
    y As Long ' player y position
    width As Integer
    height As Integer

    ' BOUNDARIES
    minX As Long
    maxX As Long
    minY As Long
    maxY As Long

    ' KEYBOARD INPUT VARIABLES
    UpKey As Integer
    DownKey As Integer

    '' WHERE TO DISPLAY PLAYER INFO
    'scoreCol As Integer ' text column to display score at
    'scoreRow As Integer ' text row    to display score at
    'nameCol As Integer '  text column to display name  at
    'nameRow As Integer '  text row    to display name  at
End Type ' InitPlayerType

' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
' END TYPE DECLARATIONS
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
' BEGIN API DECLARATIONS
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

' ================================================================================================================================================================
' BEGIN Dynamic Library definitions
' ================================================================================================================================================================

Declare Dynamic Library "user32"
    ' FOR CONTROLLING WINDOW ON TOP, ETC.:
    Function FindWindowA%& (ByVal lpClassName%&, Byval lpWindowName%&)
    Function SetWindowPos& (ByVal hWnd%&, Byval hWndInsertAfter%&, Byval X&, Byval Y&, Byval cx&, Byval cy&, Byval uFlags~&)
    Function GetForegroundWindow%&

    ' FOR CONTROLLING SUB WINDOW FOCUS:
    Sub ShowWindow (ByVal hWnd As _Offset, Byval nCmdShow As Long)

End Declare

Declare Dynamic Library "kernel32"
    Function GetLastError~& ()
End Declare

' ================================================================================================================================================================
' END Dynamic Library definitions
' ================================================================================================================================================================

' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
' END API DECLARATIONS
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
' BEGIN GLOBAL VARIABLES
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
' BASIC PROGRAM METADATA
Dim Shared m_ProgramPath$: m_ProgramPath$ = Left$(Command$(0), _InStrRev(Command$(0), "\"))
Dim Shared m_ProgramName$: m_ProgramName$ = Mid$(Command$(0), _InStrRev(Command$(0), "\") + 1)
Dim Shared m_VersionNum$: m_VersionNum$ = GetVersionNum$(m_ProgramName$)

' GLOBAL VARIABLES TO TRACK ERROR STATE
Dim Shared m_sError As String: m_sError = ""
Dim Shared m_sIncludeError As String: m_sIncludeError = ""
Dim Shared m_sTriggerFile As String: m_sTriggerFile = m_ProgramPath$ + "Pong.DELETE-TO-CLOSE"
Dim Shared m_sDebugFile As String: m_sDebugFile = m_ProgramPath$ + m_ProgramName$ + ".txt"

' GLOBAL VARIABLES FOR SCREEN
Dim Shared m_iScreenWidth As Long: m_iScreenWidth = 1024 ' _DesktopWidth
Dim Shared m_iScreenHeight As Long: m_iScreenHeight = 768 ' _DesktopHeight
Dim Shared m_iTextRows As Long: m_iTextRows = (m_iScreenHeight / _FontHeight)
Dim Shared m_iTextCols As Long: m_iTextCols = (m_iScreenWidth / _FontWidth)

' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
' END GLOBAL VARIABLES
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

' ****************************************************************************************************************************************************************
' BEGIN DEBUG CONSOLE
' ****************************************************************************************************************************************************************
' ENABLE / DISABLE DEBUG CONSOLE WINDOW
'If cDebugEnabled = TRUE Then
'    $Console
'    _Delay 4
'    _Console On
'    _Echo "Started " + m_ProgramName$
'    _Echo "Debugging on..."
'End If
' ****************************************************************************************************************************************************************
' END DEBUG CONSOLE
' ****************************************************************************************************************************************************************

' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
' EXECUTION STARTS HERE!
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

' =============================================================================
' START THE MAIN ROUTINE
'DebugLog m_ProgramName$ + " starting sub main"
main

' =============================================================================
' FINISH
Print m_ProgramName$ + " finished."

' ****************************************************************************************************************************************************************
' DEACTIVATE DEBUGGING WINDOW
'If cDebugEnabled = TRUE Then
'    _Console Off
'End If
' ****************************************************************************************************************************************************************

'End
System ' return control to the operating system

' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
' BEGIN GLOBAL ERROR HANDLER
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ErrorHandler:
m_sError = "Error #" + _Trim$(Str$(Err)) + " at line " + _Trim$(Str$(_ErrorLine)) + "."
m_sIncludeError = "File " + Chr$(34) + _InclErrorFile$ + Chr$(34) + " at line " + _Trim$(Str$(_InclErrorLine)) + "."
Resume Next
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
' END GLOBAL ERROR HANDLER
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

' /////////////////////////////////////////////////////////////////////////////
' TODO:
' * player colors
' * how many volleys to increase ball speed
' * extra balls?
' * configure controls
' * paddle size
' * paddle distance from edge
' * court color
' * court line style (dash/dot/solid/double line/etc., line thickness, etc.)
' * reset ball speed on serve? (until volley x?)

' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
' BEGIN PONG ROUTINES
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

' /////////////////////////////////////////////////////////////////////////////
' TODO:
' * reset ball speed when serving

Sub main
    ' PONG GAME VARIABLES
    Dim iPlayer As Integer
    Dim iBall As Integer

    Dim ThisGame As GameType ' HOLDS VALUES FOR THE CURRENT GAME

    ' FOR ANGLE BALL BOUNCES OFF PADDLE
    Dim arrZone(8, 7) As Integer ' 8 speeds, 7 paddle zones
    Dim iDeflectionZone As Integer

    ' FOR FIGURING OUT BOUNCE ANGLE #1
    Dim iCenterY As Integer
    Dim dblHalf As Double
    Dim iValueA As Integer
    Dim iValueB As Integer
    Dim dblValueC As Double

    ' OTHER
    Dim sMessage As String
    Dim bFinished As Integer
    Dim iNextValue As Integer
    Dim iNextX As Integer
    Dim iNextY As Integer

    '  GAME OPTIONS
    Dim arrGameOption(1 To 2) As GameOptionType

    ' GAME OBJECTS
    Dim arrPlayer(1 To 8) As PlayerType
    Dim arrBall(1 To 8) As BallType

    ' WINDOW VARIABLES
    Dim hwndSub As _Offset ' FOR CONTROLLING WINDOW FOCUS

    ' MOUSE READER PROG
    Dim sMouseReaderProg As String

    ' VARIABLES FOR READING MICE FROM CLIENT
    Dim uintPort As _Unsigned Integer ' port
    Dim lngHost ' h&
    Dim lngConn ' c&
    Dim fTime As _Float ' MyTime##
    Dim sInput As String ' s$
    Dim sMessageType As String
    Dim sValue As String

    ' OTHER VARS
    Dim iLoop1 As Integer
    Dim iLoop2 As Integer
    Dim sNextError As String
    Dim iBallSpeed As Integer
    Dim iIndex As Integer
    Dim iCount As Integer
    Dim iCol As Integer
    Dim iRow As Integer
    Dim in$
    Dim sDebug As String

    ' FOR LOOPING THROUGH INPUT DATA FROM SUBPROGRAM
    ReDim arrMice(-1 To -1) As String
    ReDim arrMessage(-1 To -1) As String
    ReDim arrValue(-1 To -1) As String
    Dim sNextChunk As String
    Dim sNextValue As String
    Dim iValuePosition As Integer
    Dim sText As String

    ' TEST VALUES
    Dim iLastKeyDown As Integer
    Dim iLastKeyUp As Integer
    Dim sLastKeyDown As String
    Dim sLastKeyUp As String
    Dim iTestCount As Integer

    ' INITIALIZE
    m_sError = ""

    ' SHOW SOME INSTRUCTIONS
    Cls
    Color c_Cyan
    Print "MULTI MOUSE PONG v0.33 by Softintheheadware"
    Print "-------------------------------------------"
    Print "Plug in 2 or more USB mice now, then press any key to start the game."
    Print "If your PC prompts for network permission, click Allow. This will allow the "
    Print "Raw Input API subprogram to send the mouse and keyboard input to the game."
    Print "This is just to allow the program to talk to the subprogram on the same PC,"
    Print "it does NOT attempt to communicate with another computer over Internet or LAN!"
    Print "(Maybe one day we'll figure out how to do this all in one program!)"
    Print "(Also maybe we'll figure out how to read >1 mouse for Mac and Linux, too!)"
    Print "When the game first starts, it might take a few seconds to get going."
    Print
    Print "Press any key to begin..."
    Sleep
    'print "-------------------------------------------------------------------------------"

    ' XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    ' BEGIN INITIALIZE INPUT SUBPROGRAM
    ' XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    ' =============================================================================
    ' SET ERROR TRAPPING
    On Error GoTo ErrorHandler

    ' ================================================================================================================================================================
    ' OPEN A PORT TO TALK TO THE MOUSE READER SUBPROGRAM
    If Len(m_sError) = 0 Then
        'DebugLog "OPEN A PORT TO TALK TO THE MOUSE READER SUBPROGRAM..."

        Randomize Timer
        uintPort = Rnd * 10000 + 40000 ' between 40000 and 50000
        lngHost = _OpenHost("tcp/ip:" + _Trim$(Str$(uintPort)))
    End If

    ' ================================================================================================================================================================
    ' START THE MOUSE READER SUBPROGRAM
    If Len(m_sError) = 0 Then
        'DebugLog "START THE MOUSE READER SUBPROGRAM..."

        sMouseReaderProg = "pongsub" + m_VersionNum$ + ".exe"
        If _FileExists(sMouseReaderProg) = FALSE Then
            m_sError = ""
            m_sError = m_sError + "Subprogram " + Chr$(34) + sMouseReaderProg + Chr$(34) + " not found." + Chr$(13)
            m_sError = m_sError + "Be sure to compile " + Chr$(34) + "pongsub" + m_VersionNum$ + ".bas" + Chr$(34) + " before running this." + Chr$(13)

            Cls
            Color c_Cyan
            Print "Subprogram " + Chr$(34) + sMouseReaderProg + Chr$(34) + " not found."
            Print "Please move the file to the same folder as " + m_ProgramName$
            Print "then restart the game."
            Print
            Print "Press any key to exit"
            Sleep
            'print "-------------------------------------------------------------------------------"

        End If
    End If

    If Len(m_sError) = 0 Then
        'sDebug = "Shell _DontWait `pongsub` + m_VersionNum$ + `.exe ` + _Trim$(Str$(uintPort))"
        'sDebug = Replace$(sDebug, "`", chr$(34))
        ''DebugLog sDebug
        'sDebug = "Shell _DontWait " + chr$(34) + "pongsub" + m_VersionNum$ + ".exe" + chr$(34) + " " + _Trim$(Str$(uintPort))
        ''DebugLog sDebug
        Shell _DontWait "pongsub" + m_VersionNum$ + ".exe " + _Trim$(Str$(uintPort))
    End If

    ' ================================================================================================================================================================
    ' OPEN TCP/IP CONNECTION AS HOST
    If Len(m_sError) = 0 Then

        '    ' GET CONNECTION WITH MOUSE READER
        '    lngConn = 0
        '    While lngConn = 0
        '        lngConn = _OpenConnection(lngHost)
        '        _Limit 60
        '    Wend

        'DebugLog "OPEN TCP/IP CONNECTION AS HOST..."

        lngConn = 0
        fTime = ExtendedTimer + 30 ' TRY FOR 30 SECONDS
        Do
            lngConn = _OpenConnection(lngHost)
            If lngConn <> 0 Then Exit Do
            _Limit 60
        Loop Until Timer > fTime
        If lngConn = 0 Then
            m_sError = "Failed to open tcp/ip host connection."
            'DebugLog m_sError
        End If
    End If

    ' ================================================================================================================================================================
    ' GET CONNECTION WITH MOUSE READER SUBPROGRAM
    If Len(m_sError) = 0 Then
        'DebugLog "GET CONNECTION WITH MOUSE READER SUBPROGRAM..."

        sInput = ""
        fTime = ExtendedTimer + 30 ' TRY FOR 30 SECONDS
        Do
            Get #lngConn, , sInput
            If Left$(sInput, 2) = "w:" Then Exit Do
        Loop Until Timer > fTime

        ' remove trailing cr
        If Right$(sInput, 1) = Chr$(13) Then
            sInput = Left$(sInput, Len(sInput) - 1)
        End If

        ' is it a window handle?
        If Left$(sInput, 2) = "w:" Then
            sValue = Right$(sInput, Len(sInput) - 2)

            If IsNumber%(sValue) Then
                hwndSub = Val(sValue)
            Else
                m_sError = "Mouse reader subprogram failed to return a valid window handle."
                m_sError = m_sError + Chr$(13)
                m_sError = m_sError + "sInput=" + Chr$(34) + sInput + Chr$(34) + Chr$(13)
                m_sError = m_sError + "sValue=" + Chr$(34) + sValue + Chr$(34) + Chr$(13)
            End If
        ElseIf Left$(sInput, 2) = "e:" Then
            If Len(sInput) > 2 Then
                m_sError = Right$(sInput, Len(sInput) - 2)
            Else
                m_sError = "Unspecified error."
            End If
        Else
            m_sError = "Mouse reader subprogram failed to return a window handle."
            m_sError = m_sError + Chr$(13)
            m_sError = m_sError + "sInput=" + Chr$(34) + sInput + Chr$(34) + Chr$(13)
        End If
    End If

    ' XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    ' END INITIALIZE INPUT SUBPROGRAM
    ' XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX


    ' XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    ' BEGIN PRECALCULATIONS
    ' XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    If Len(m_sError) = 0 Then
        ' THIS NEEDS WORK!
        ' dx SHOULD INCREASE BASED ON SPEED, NOT dy!
        ' WHAT WAS I THINKING??

        ' SET UP BOUNCE ZONES
        ' * Ball direction depends on which of 7 segments the ball hits (NOTE: the vertical center of the ball)
        ' * The faster the horizontal speed, the greater the deflection angles
        ' * Middle = always straight

        '               HORIZONTAL SPEED (pixels)
        ' PADDLE ZONE    1  2  3  4  5  6  7  8
        ' -----------   -- -- -- -- -- -- -- --
        '           1   -3 -3 -4 -4 -5 -6 -7 -8
        '           2   -2 -2 -3 -3 -4 -5 -6 -7
        '           3   -1 -1 -2 -2 -3 -4 -5 -6
        ' MIDDLE -> 4    0  0  0  0  0  0  0  0
        '           5   +1 +1 +2 +2 +3 +4 +5 +6
        '           6   +2 +2 +3 +3 +4 +5 +6 +7
        '           7   +3 +3 +4 +4 +5 +6 +7 +8

        ' If we set this up this way in data statements,
        ' it turns out we have to do lots of loops within loops
        ' which makes for ugly complicated code - DOH!
        ' There has to be a better way!
        ' To set up the assigning the values in the simplest way,
        ' we'll rearrange the numbers in data statements
        ' so they correspond to speed first (rows), then zone (columns):

        '              ZONE
        ' SPEED  1  2  3  4  5  6  7
        ' -----  -- -- -- -- -- -- --
        '     1  -3 -2 -1  0  1  2  3
        '     2  -3 -2 -1  0  1  2  3
        '     3  -4 -3 -2  0  2  3  4
        '     4  -4 -3 -2  0  2  3  4
        '     5  -5 -4 -3  0  3  4  5
        '     6  -6 -5 -4  0  4  5  6
        '     7  -7 -6 -5  0  5  6  7
        '     8  -8 -7 -6  0  6  7  8

        BounceData:
        Data -3,-2,-1,0,1,2,3: ' DY VALUES FOR SPEED 1 (ZONES 1-7)
        Data -3,-2,-1,0,1,2,3: ' DY VALUES FOR SPEED 2 (ZONES 1-7)
        Data -4,-3,-2,0,2,3,4: ' DY VALUES FOR SPEED 3 (ZONES 1-7)
        Data -4,-3,-2,0,2,3,4: ' DY VALUES FOR SPEED 4 (ZONES 1-7)
        Data -5,-4,-3,0,3,4,5: ' DY VALUES FOR SPEED 5 (ZONES 1-7)
        Data -6,-5,-4,0,4,5,6: ' DY VALUES FOR SPEED 6 (ZONES 1-7)
        Data -7,-6,-5,0,5,6,7: ' DY VALUES FOR SPEED 7 (ZONES 1-7)
        Data -8,-7,-6,0,6,7,8: ' DY VALUES FOR SPEED 8 (ZONES 1-7)

        ' FIRST GET THE VERTICAL BALL SPEEDS FOR THE 7 PADDLE ZONES, AT 8 DIFFERENT HORIZONTAL BALL SPEEDS
        Restore BounceData
        For iBallSpeed = 1 To 8
            For iDeflectionZone = 1 To 7
                Read iNextValue
                arrZone(iBallSpeed, iDeflectionZone) = iNextValue
            Next iDeflectionZone
        Next iBallSpeed

    End If
    ' XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    ' END PRECALCULATIONS
    ' XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    ' XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    ' BEGIN INITIALIZE VARIABLES
    ' XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    If Len(m_sError) = 0 Then

        ' SET UP SCREEN
        m_iScreenWidth = 1024 ' _DesktopWidth
        m_iScreenHeight = 768 ' _DesktopHeight

        ' GAME OPTIONS
        arrGameOption(1).name = "Pong Doubles"
        arrGameOption(2).name = "Pong Volleyball"
        'arrGameOption(xx).name = "Quadrapong"
        'arrGameOption(xx).name = "Foos-pong"
        'arrGameOption(xx).name = "Octopong"
        'arrGameOption(xx).name = "Warlords"
        'arrGameOption(xx).name = "S'morelords"
        'arrGameOption(xx).name = "Breakout"
        'arrGameOption(xx).name = "Hockey"
        'arrGameOption(xx).name = "Basketball"
        'arrGameOption(xx).name = "Volleyball"
        'arrGameOption(xx).name = "Curling"
        'arrGameOption(xx).name = "Pinball"
        'arrGameOption(xx).name = "Kaboom"
        'arrGameOption(xx).name = "Maze Craze"
        'arrGameOption(xx).name = "Maze War"
        'arrGameOption(xx).name = "Spacewar!"
        'arrGameOption(xx).name = "Sprint" ' = Indy 500 / Sprint / Sprint 4 / Sprint 8
        'arrGameOption(xx).name = "Omega Race"
        'arrGameOption(xx).name = "Super Octopong"
        'arrGameOption(xx).name = "Super Deluxe Octopong"
        'arrGameOption(xx).name = "Super Deluxe Octohookapong"
        'arrGameOption(xx).name = "Surround" ' Tron
        'arrGameOption(xx).name = "Drone Hunt" ' like duck hunt

        ' INITIALIZE PLAYERS
        For iPlayer = 1 To 4
            arrPlayer(iPlayer).IsActive = FALSE ' WAIT UNTIL GIVEN MOUSE IS MOVED TO ACTIVATE EACH PLAYER (IsActive = TRUE)
            arrPlayer(iPlayer).px = 0
            arrPlayer(iPlayer).py = 0
            arrPlayer(iPlayer).LeftDown = FALSE
            arrPlayer(iPlayer).LeftDownOld = FALSE
            arrPlayer(iPlayer).MiddleDown = FALSE
            arrPlayer(iPlayer).MiddleDownOld = FALSE
            arrPlayer(iPlayer).RightDown = FALSE
            arrPlayer(iPlayer).RightDownOld = FALSE
        Next iPlayer

        ' CURRENT GAME OPTIONS
        ThisGame.iGameType = LBound(arrGameOption)
        ThisGame.sGameName = arrGameOption(ThisGame.iGameType).name
        InitGame ThisGame, arrPlayer(), arrBall()

        ' INITIALIZE GAME
        bFinished = FALSE ' NO ONE HAS WON YET

        ' TEST VARIABLES
        iTestCount = -63
        iLastKeyDown = 0
        iLastKeyUp = 0
        sLastKeyDown = "(None)"
        sLastKeyUp = "(None)"
    End If
    ' XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    ' END INITIALIZE VARIABLES
    ' XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    ' XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    ' BEGIN SETUP SCREEN + LAYERS
    ' XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    If Len(m_sError) = 0 Then

        ' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
        ' INIT SCREEN
        ' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
        Screen _NewImage(m_iScreenWidth, m_iScreenHeight, 32)
        'Screen _NewImage(_DesktopWidth, _DesktopHeight, 32)

        ' window needs to be lined up directly under the main program, so the mouse coordinates align with the display
        _ScreenMove 0, 0

        ' CLEAR THE SCREEN
        _Dest 0: Cls , cEmpty

        ' update screen with changes & wait for next update
        _Display

        ' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
        ' ATTEMPT FULLSCREEN
        ' *** NOT WORKING ***
        ' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
        '_FULLSCREEN _SQUAREPIXELS
        ''_FULLSCREEN _STRETCH, _SMOOTH

        ' check that a full screen mode initialized:
        'IF _FULLSCREEN = 0 THEN
        '   _FULLSCREEN _OFF
        '   SOUND 100, .75
        'END IF

        ' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
        ' DRAW INITIAL SCREEN
        ' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
        DrawInstructionsLayer ThisGame
        RenderScreen ThisGame

        ' XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
        ' END SETUP SCREEN + LAYERS
        ' XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

        ' XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
        ' BEGIN MAIN LOOP
        ' XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

        Do
            ' ================================================================================================================================================================
            ' BEGIN PROCESS INPUT FROM SUBPROGRAM
            ' ================================================================================================================================================================

            ' KEEP PONGSUB WINDOW ON TOP
            If _WindowHasFocus = TRUE Then
                ShowWindow hwndSub, 1
                '_ScreenIcon

                ' CLICK ON SCREEN TO GIVE IT THE FOCUS
                _ScreenClick 0, 0
            End If

            ' READ MICE COORDINATES FROM CONNECTION...
            Get #lngConn, , sInput

            ' DID IT WORK?
            If Len(m_sError) = 0 Then

                'DebugLog "sInput=" + chr$(34) + sInput + chr$(34)

                ' HAVE DATA?
                If Len(sInput) > 0 Then
                    ' * The subprogram "PongSub" sends its data back to "PongMain"
                    '   via TCPIP in the form of a tab-delimited string. Tab is chr$(9).
                    '   Sometimes it sends multiple messages, which are separated by chr$(13).
                    '   Here we split the input by chr$(13) and process each line seperately,
                    '   which should make concurrent input smoother:

                    split sInput, Chr$(13), arrMessage() ' SPLIT OUTPUT INTO PAGES

                    For iLoop2 = LBound(arrMessage) To UBound(arrMessage)
                        sInput = arrMessage(iLoop2)

                        ' WHAT KIND OF MESSAGE?
                        sMessageType = Left$(sInput, 2)

                        'DebugLog "sMessageType=" + chr$(34) + sMessageType + chr$(34)

                        If sMessageType = "d:" Then
                            ' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
                            ' BEGIN KEY DOWN
                            ' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
                            sValue = Right$(sInput, Len(sInput) - 2)
                            If IsNumber%(sValue) Then
                                iLastKeyDown = Val(sValue)
                                sLastKeyDown = VirtualKeyCodeToString$(iLastKeyDown)

                                'DebugLog "sLastKeyDown=" + chr$(34) + sLastKeyDown + chr$(34)

                                ' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                ' BEGIN PROCESS KEYBOARD INPUT
                                ' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                ' TODO: cleanup logic, move into Case or ElseIf structure

                                '' PLAYER 1 KEYBOARD INPUT
                                'if iLastKeyDown = arrPlayer(1).UpKey then
                                '   arrPlayer(1).y = arrPlayer(1).y - arrBall(1).size
                                '   IF arrPlayer(1).y < arrPlayer(1).minY THEN
                                '       arrPlayer(1).y = arrPlayer(1).minY
                                '   END IF
                                'ElseIf iLastKeyDown = arrPlayer(1).DownKey then
                                '   arrPlayer(1).y = arrPlayer(1).y + arrBall(1).size
                                '   IF arrPlayer(1).y > arrPlayer(1).maxY THEN
                                '       arrPlayer(1).y = arrPlayer(1).maxY
                                '   END IF
                                'END IF
                                '
                                '' PLAYER 2 KEYBOARD INPUT
                                'if iLastKeyDown = arrPlayer(2).UpKey then
                                '   arrPlayer(2).y = arrPlayer(2).y - arrBall(1).size
                                '   IF arrPlayer(2).y < arrPlayer(2).minY THEN
                                '       arrPlayer(2).y = arrPlayer(2).minY
                                '   END IF
                                'ElseIf iLastKeyDown = arrPlayer(2).DownKey then
                                '   arrPlayer(2).y = arrPlayer(2).y + arrBall(1).size
                                '   IF arrPlayer(2).y > arrPlayer(2).maxY THEN
                                '       arrPlayer(2).y = arrPlayer(2).maxY
                                '   END IF
                                'END IF

                                ' KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK
                                ' CHECK IF "1" KEY IS PRESSED
                                ' KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK
                                If iLastKeyDown = VK_1 Then
                                    ' SELECT GAME VARIATION
                                    ThisGame.iGameType = ThisGame.iGameType + 1
                                    If ThisGame.iGameType > UBound(arrGameOption) Then
                                        ThisGame.iGameType = LBound(arrGameOption)
                                    End If
                                    ThisGame.sGameName = arrGameOption(ThisGame.iGameType).name

                                    ThisGame.sMessage1 = "ThisGame.iGameType=" + _Trim$(Str$(ThisGame.iGameType))

                                    InitGame ThisGame, arrPlayer(), arrBall()

                                    DrawInstructionsLayer ThisGame
                                End If

                                ' KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK
                                ' CHECK IF "2" KEY IS PRESSED
                                ' KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK
                                'If iLastKeyDown = VK_RETURN Then
                                If iLastKeyDown = VK_2 Then
                                    If ThisGame.iGameMode = cAttractMode Then ' or ThisGame.iGameMode = cGameOver then
                                        ' ARE 2 OR MORE PLAYERS READY?
                                        iCount = 0
                                        For iPlayer = 1 To 4
                                            If arrPlayer(iPlayer).IsActive = TRUE Then
                                                iCount = iCount + 1
                                            End If
                                        Next iPlayer
                                        If iCount > 1 Then
                                            ThisGame.iGameMode = cInPlay

                                            ' RESET SCORES
                                            For iPlayer = 1 To 4
                                                arrPlayer(iPlayer).Score = 0
                                            Next iPlayer
                                            ThisGame.iScore1 = 0
                                            ThisGame.iScore2 = 0

                                            ' UPDATE INSTRUCTIONS
                                            DrawInstructionsLayer ThisGame

                                            ' SERVE BALL
                                            ServeBall ThisGame, arrBall(1), arrPlayer(), 0

                                        End If
                                    End If
                                End If

                                ' KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK
                                ' CHECK IF "3" KEY IS PRESSED
                                ' KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK
                                If iLastKeyDown = VK_3 Then
                                    If ThisGame.iGameMode = cInPlay Or ThisGame.iGameMode = cPaused Then
                                        ThisGame.iGameMode = cAttractMode
                                        InitGame ThisGame, arrPlayer(), arrBall()
                                        DrawInstructionsLayer ThisGame
                                    Else
                                        ' (ignore)
                                    End If
                                End If

                                ' KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK
                                ' CHECK IF "4" KEY IS PRESSED
                                ' KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK
                                If iLastKeyDown = VK_4 Then
                                    ' TOGGLE SHOW VALUES MODE
                                    If ThisGame.bShowValues = FALSE Then
                                        ThisGame.bShowValues = TRUE
                                        ThisGame.sMessage4 = "bShowValues=TRUE"
                                    Else
                                        ThisGame.bShowValues = FALSE
                                    End If
                                End If

                                ' KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK
                                ' CHECK IF "5" KEY IS PRESSED
                                ' KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK
                                If iLastKeyDown = VK_5 Then
                                    ' TOGGLE TEST MODE
                                    If ThisGame.bTestMode = FALSE Then
                                        ThisGame.bTestMode = TRUE
                                    Else
                                        ThisGame.bTestMode = FALSE
                                    End If
                                End If

                                ' KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK
                                ' CHECK IF PAUSE "P" KEY IS PRESSED
                                ' KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK
                                If iLastKeyDown = VK_P Then
                                    If ThisGame.iGameMode = cInPlay Then
                                        ThisGame.iGameMode = cPaused
                                        DrawInstructionsLayer ThisGame
                                    ElseIf ThisGame.iGameMode = cPaused Then
                                        ThisGame.iGameMode = cInPlay
                                        DrawInstructionsLayer ThisGame
                                    Else
                                        ' (ignore)
                                    End If
                                End If

                                ' KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK
                                ' CHECK IF - (MINUS) KEY IS PRESSED
                                ' KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK
                                If iLastKeyDown = VK_OEM_MINUS Then
                                    ThisGame.iSpeed = ThisGame.iSpeed - 1
                                    If ThisGame.iSpeed < ThisGame.MinSpeed Then
                                        ThisGame.iSpeed = ThisGame.MinSpeed
                                    Else
                                        ThisGame.bSpeedChanged = TRUE
                                    End If
                                End If

                                ' KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK
                                ' CHECK IF =/+ KEY IS PRESSED
                                ' KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK
                                If iLastKeyDown = VK_OEM_PLUS Then
                                    ThisGame.iSpeed = ThisGame.iSpeed + 1
                                    If ThisGame.iSpeed > ThisGame.MaxSpeed Then
                                        ThisGame.iSpeed = ThisGame.MaxSpeed
                                    Else
                                        ThisGame.bSpeedChanged = TRUE
                                    End If
                                End If

                                ' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                ' END PROCESS KEYBOARD INPUT
                                ' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

                            Else
                                ' INVALID KEYBOARD INPUT = NOT A NUMBER
                                iLastKeyDown = 0
                                sLastKeyDown = Chr$(34) + sValue + Chr$(34) + " IS NOT A NUMBER"
                            End If
                            ' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
                            ' END KEY DOWN
                            ' ----------------------------------------------------------------------------------------------------------------------------------------------------------------

                        ElseIf sMessageType = "u:" Then
                            ' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
                            ' BEGIN KEY UP
                            ' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
                            sValue = Right$(sInput, Len(sInput) - 2)
                            If IsNumber%(sValue) Then
                                ' KEY WAS RELEASED
                                iLastKeyUp = Val(sValue)
                                sLastKeyUp = VirtualKeyCodeToString$(iLastKeyUp)
                            Else
                                ' INVALID KEYBOARD INPUT = NOT A NUMBER
                                iLastKeyUp = 0
                                sLastKeyUp = Chr$(34) + sValue + Chr$(34) + " IS NOT A NUMBER"
                            End If
                            ' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
                            ' END KEY UP
                            ' ----------------------------------------------------------------------------------------------------------------------------------------------------------------

                        ElseIf sMessageType = "m:" Then
                            ' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
                            ' BEGIN MOUSE MOVED
                            ' ----------------------------------------------------------------------------------------------------------------------------------------------------------------

                            ' SPLIT INPUT INTO VALUES
                            ' cForPlayer cMouseDX cMouseDY cMousePosX cMousePosY cMouseWheel cMouseLeftDown cMouseMiddleDown cMouseRightDown
                            ' {mouse #}\t{dx}\t{dy}\t{pos x}\t{pos y}\t{wheel}\t{leftDown}\t{middleDown}\t{rightDown}\n
                            sValue = Right$(sInput, Len(sInput) - 2)
                            split sValue, Chr$(9), arrValue() ' SPLIT OUTPUT INTO PAGES

                            ' PROCESS VALUES
                            iIndex = -1
                            iValuePosition = 0

                            For iLoop1 = LBound(arrValue) To UBound(arrValue)
                                ' TRACK WHAT VALUE # WE'RE ON
                                iValuePosition = iValuePosition + 1

                                ' GET VALUE
                                sNextValue = _Trim$(arrValue(iLoop1))

                                ' IS IT A VALID INTEGER?
                                If IsNumber%(sNextValue) Then
                                    ' DETERMINE WHICH VALUE IT IS FROM ORDINAL POSITION IN THE INPUT
                                    ' AND WRITE TO APPROPRIATE VARIABLE
                                    Select Case iValuePosition
                                        Case cForPlayer
                                            ' THIS VALUE TELLS US WHO IT'S FOR
                                            iIndex = Val(sNextValue)
                                            'DebugLog "MOUSE " + sNextValue + " INPUT, iIndex = " + _Trim$(Str$(iIndex))

                                            If iIndex >= 0 And iIndex < 4 Then
                                                iIndex = iIndex + 1
                                            Else
                                                'DebugLog "SKIPPING THIS MOUSE"
                                                Exit For
                                            End If

                                            'Case cMouseDX:
                                            '    ' READ RAW VALUE
                                            '    arrPlayer(iIndex).dx = Val(sNextValue)
                                            '    'DebugPrint "                DX = " + _Trim$(Str$(arrPlayer(iIndex).dx))

                                            'Case cMouseDY:
                                            '    ' READ RAW VALUE
                                            '    arrPlayer(iIndex).dy = Val(sNextValue)
                                            '    'DebugPrint "                DY = " + _Trim$(Str$(arrPlayer(iIndex).dy))

                                        Case cMousePosX:
                                            ' READ RAW VALUE
                                            arrPlayer(iIndex).px = Val(sNextValue)
                                            If arrPlayer(iIndex).px < arrPlayer(iIndex).minX Then
                                                arrPlayer(iIndex).x = arrPlayer(iIndex).minX
                                            ElseIf arrPlayer(iIndex).px > arrPlayer(iIndex).maxX Then
                                                arrPlayer(iIndex).x = arrPlayer(iIndex).maxX
                                            Else
                                                arrPlayer(iIndex).x = arrPlayer(iIndex).px
                                            End If

                                        Case cMousePosY:
                                            ' READ RAW VALUE
                                            arrPlayer(iIndex).py = Val(sNextValue)
                                            If arrPlayer(iIndex).py < arrPlayer(iIndex).minY Then
                                                arrPlayer(iIndex).y = arrPlayer(iIndex).minY
                                            ElseIf arrPlayer(iIndex).py > arrPlayer(iIndex).maxY Then
                                                arrPlayer(iIndex).y = arrPlayer(iIndex).maxY
                                            Else
                                                arrPlayer(iIndex).y = arrPlayer(iIndex).py
                                            End If

                                        Case cMouseWheel:
                                            '' READ RAW VALUE
                                            'arrPlayer(iIndex).wheel = Val(sNextValue)

                                        Case cMouseLeftDown:
                                            ' READ RAW VALUE
                                            arrPlayer(iIndex).LeftDown = Val(sNextValue)

                                            ' DID VALUE CHANGE?
                                            If arrPlayer(iIndex).LeftDown <> arrPlayer(iIndex).LeftDownOld Then
                                                If arrPlayer(iIndex).LeftDown = TRUE Then
                                                    'DebugLog "arrPlayer(" + _Trim$(Str$(iIndex)) + ").LeftDown = TRUE"

                                                    ' CLICKED BUTTON
                                                    If ThisGame.iGameMode = cAttractMode Then
                                                        'DebugLog "MOUSE " + _Trim$(Str$(iIndex)) + " LEFT CLICKED: arrPlayer(" + _Trim$(Str$(iIndex)) + ").IsActive = TRUE"
                                                        If arrPlayer(iIndex).IsAvailable = TRUE Then
                                                            arrPlayer(iIndex).IsActive = TRUE
                                                        Else
                                                            arrPlayer(iIndex).IsActive = FALSE
                                                        End If
                                                    End If
                                                Else
                                                    ' RELEASED BUTTON
                                                End If
                                                arrPlayer(iIndex).LeftDownOld = arrPlayer(iIndex).LeftDown
                                            End If

                                        Case cMouseMiddleDown:
                                            ' READ RAW VALUE
                                            arrPlayer(iIndex).MiddleDown = Val(sNextValue)

                                            ' DID VALUE CHANGE?
                                            If arrPlayer(iIndex).MiddleDown <> arrPlayer(iIndex).MiddleDownOld Then
                                                If arrPlayer(iIndex).MiddleDown = TRUE Then
                                                    ' CLICKED BUTTON
                                                Else
                                                    ' RELEASED BUTTON
                                                End If
                                                arrPlayer(iIndex).MiddleDownOld = arrPlayer(iIndex).MiddleDown
                                            End If

                                        Case cMouseRightDown:
                                            ' READ RAW VALUE
                                            arrPlayer(iIndex).RightDown = Val(sNextValue)

                                            ' DID VALUE CHANGE?
                                            If arrPlayer(iIndex).RightDown <> arrPlayer(iIndex).RightDownOld Then
                                                If arrPlayer(iIndex).RightDown = TRUE Then
                                                    ' CLICKED BUTTON
                                                    If ThisGame.iGameMode = cAttractMode Then
                                                        'DebugLog "MOUSE " + _Trim$(Str$(iIndex)) + " RIGHT CLICKED: arrPlayer(" + _Trim$(Str$(iIndex)) + ").IsActive = FALSE"
                                                        arrPlayer(iIndex).IsActive = FALSE
                                                    End If
                                                Else
                                                    ' RELEASED BUTTON
                                                End If
                                                arrPlayer(iIndex).RightDownOld = arrPlayer(iIndex).RightDown
                                            End If

                                        Case Else:
                                            ' Unknown
                                    End Select
                                Else
                                    ' (VALUE ISN'T A NUMBER)
                                    ' (DO NOTHING)
                                    'DebugPrint "                " + _
                                    '    "Value " + _
                                    '    chr$(34) + sNextValue + chr$(34) + " " + _
                                    '    "at position " + _
                                    '    _Trim$(Str$(iLoop1)) + " " + _
                                    '    "(" + MouseDataPositionToString(iLoop1) + ") " + _
                                    '    "is not a number."
                                End If

                            Next iLoop1
                            ' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
                            ' END MOUSE MOVED
                            ' ----------------------------------------------------------------------------------------------------------------------------------------------------------------

                        ElseIf sMessageType = "e:" Then
                            ' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
                            ' BEGIN INPUT ERROR
                            ' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
                            sValue = Right$(sInput, Len(sInput) - 2)
                            'DebugLog "Received error message from subprogram: " + sValue
                            ' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
                            ' END INPUT ERROR
                            ' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
                        Else
                            'DebugLog "Message type from subprogram not recognized: " + sInput
                        End If
                    Next iLoop2
                Else
                    ' RETRIEVED DATA IS EMPTY
                    ' (JUST IGNORE FOR NOW)
                    ' DebugPrint "    DATA IS EMPTY"
                    ' TODO:
                    ' WE SHOULD QUIT IF NO DATA IS RETRIEVED IN A CERTAIN THRESHOLD OF TIME...
                End If
            Else
                ' ERROR RETRIEVING DATA...
                'DebugLog "ERROR RETRIEVING DATA FROM CONNECTION: " + m_sError
                ErrorClear
                ' (OUTPUT ERROR TO LOG HERE)
                'color cLtRed, cBlack
                'PrintString1 1, 1, "Error opening file " + chr$(34) + arrFile(iIndex, cFileName) + chr$(34)
                'PrintString1 1, 1, m_sError
                ' TODO:
                ' WE SHOULD QUIT HERE, AND RESTART THE CLIENT...
            End If
            ' ================================================================================================================================================================
            ' END PROCESS INPUT FROM SUBPROGRAM
            ' ================================================================================================================================================================

            ' ================================================================================================================================================================
            ' BEGIN GAME LOGIC
            ' ================================================================================================================================================================
            ' *** THIS PART NEEDS WORK - THE MATH OF THE BALL ANGLES SEEMS WRONG ***

            If ThisGame.iGameMode = cInPlay Then
                '' LOOK AHEAD
                'arrBall(1).nextX = arrBall(1).x + arrBall(1).dx
                'arrBall(1).nextY = arrBall(1).y + arrBall(1).dy
                '(test first for look ahead)

                ' MOVE BALL HORIZONTALLY
                arrBall(1).x = arrBall(1).x + arrBall(1).dx

                If arrBall(1).x > arrBall(1).maxX Then
                    ' ****************************************************************************************************************************************************************
                    ' TEAM 1 SCORES
                    ' ****************************************************************************************************************************************************************
                    ScoreSound1
                    _Delay 2 ' WAIT A COUPLE SECONDS
                    ThisGame.iScore1 = ThisGame.iScore1 + 1 ' AWARD THEM A POINT

                    ' IF THEY WON THEN END GAME
                    If ThisGame.iScore1 >= ThisGame.iScoreToWin Then
                        ThisGame.iGameMode = cAttractMode
                        'EXIT DO
                    Else
                        ' The person who misses the ball always receives the next serve
                        ServeBall ThisGame, arrBall(1), arrPlayer(), 2
                    End If

                ElseIf arrBall(1).x < arrBall(1).minX Then
                    ' ****************************************************************************************************************************************************************
                    ' TEAM 2 SCORES
                    ' ****************************************************************************************************************************************************************
                    ScoreSound1
                    _Delay 2 ' WAIT A COUPLE SECONDS
                    ThisGame.iScore2 = ThisGame.iScore2 + 1 ' AWARD THEM A POINT

                    ' IF THEY WON THEN END GAME
                    If ThisGame.iScore2 >= ThisGame.iScoreToWin Then
                        ThisGame.iGameMode = cAttractMode
                        'EXIT DO
                    Else
                        ' The person who misses the ball always receives the next serve
                        ServeBall ThisGame, arrBall(1), arrPlayer(), 1
                    End If

                ElseIf (arrBall(1).x < arrPlayer(1).x) And (arrPlayer(1).IsActive = TRUE) And (ThisGame.bTestMode = TRUE) Then
                    ' ****************************************************************************************************************************************************************
                    ' TEST MODE BOUNCE BACK FOR PADDLE #1
                    ' ****************************************************************************************************************************************************************
                    BounceBack ThisGame, arrBall(1), arrPlayer(1), cLeftDir

                ElseIf (arrBall(1).x > arrPlayer(2).x) And (arrPlayer(2).IsActive = TRUE) And (ThisGame.bTestMode = TRUE) Then
                    ' ****************************************************************************************************************************************************************
                    ' TEST MODE BOUNCE BACK FOR PADDLE #2
                    ' ****************************************************************************************************************************************************************
                    BounceBack ThisGame, arrBall(1), arrPlayer(2), cRightDir

                ElseIf (arrBall(1).x < arrPlayer(3).x) And (arrPlayer(3).IsActive = TRUE) And (ThisGame.bTestMode = TRUE) Then
                    ' ****************************************************************************************************************************************************************
                    ' TEST MODE BOUNCE BACK FOR PADDLE #3
                    ' ****************************************************************************************************************************************************************
                    BounceBack ThisGame, arrBall(1), arrPlayer(3), cLeftDir

                ElseIf (arrBall(1).x > arrPlayer(4).x) And (arrPlayer(4).IsActive = TRUE) And (ThisGame.bTestMode = TRUE) Then
                    ' ****************************************************************************************************************************************************************
                    ' TEST MODE BOUNCE BACK FOR PADDLE #4
                    ' ****************************************************************************************************************************************************************
                    BounceBack ThisGame, arrBall(1), arrPlayer(4), cRightDir

                ELSEIF ( (arrBall(1).x >= arrPlayer(1).x) AND (arrBall(1).x < (arrPlayer(1).x + arrPlayer(1).width)) ) AND _
                       ( (arrBall(1).y >= arrPlayer(1).y) AND (arrBall(1).y <= (arrPlayer(1).y + arrPlayer(1).height)) ) AND _
                       (arrPlayer(1).IsActive = true) then

                    ' ****************************************************************************************************************************************************************
                    ' BALL HIT PADDLE #1
                    ' ****************************************************************************************************************************************************************
                    BallHitPaddle ThisGame, arrBall(1), arrPlayer(1), arrZone()

                ELSEIF ( (arrBall(1).x >= arrPlayer(2).x) AND (arrBall(1).x < (arrPlayer(2).x + arrPlayer(2).width)) ) AND _
                       ( (arrBall(1).y >= arrPlayer(2).y) AND (arrBall(1).y <= (arrPlayer(2).y + arrPlayer(2).height)) ) AND _
                       (arrPlayer(2).IsActive = true) then

                    ' ****************************************************************************************************************************************************************
                    ' BALL HIT PADDLE #2
                    ' ****************************************************************************************************************************************************************
                    BallHitPaddle ThisGame, arrBall(1), arrPlayer(2), arrZone()

                ELSEIF ( (arrBall(1).x >= arrPlayer(3).x) AND (arrBall(1).x < (arrPlayer(3).x + arrPlayer(3).width)) ) AND _
                       ( (arrBall(1).y >= arrPlayer(3).y) AND (arrBall(1).y <= (arrPlayer(3).y + arrPlayer(3).height)) ) AND _
                       (arrPlayer(3).IsActive = true) then

                    ' ****************************************************************************************************************************************************************
                    ' BALL HIT PADDLE #3
                    ' ****************************************************************************************************************************************************************
                    BallHitPaddle ThisGame, arrBall(1), arrPlayer(3), arrZone()

                ELSEIF ( (arrBall(1).x >= arrPlayer(4).x) AND (arrBall(1).x < (arrPlayer(4).x + arrPlayer(4).width)) ) AND _
                       ( (arrBall(1).y >= arrPlayer(4).y) AND (arrBall(1).y <= (arrPlayer(4).y + arrPlayer(4).height)) ) AND _
                       (arrPlayer(4).IsActive = true) then

                    ' ****************************************************************************************************************************************************************
                    ' BALL HIT PADDLE #4
                    ' ****************************************************************************************************************************************************************
                    BallHitPaddle ThisGame, arrBall(1), arrPlayer(4), arrZone()

                Else
                    ' COUNT VOLLEY IF BALL CROSSES CENTER LINE

                    ' IS BALL TRAVELING IN THE RIGHT DIRECTION?
                    If ((ThisGame.iVolleyDir < 0) And (arrBall(1).dx < 0)) Or ((ThisGame.iVolleyDir > 0) And (arrBall(1).dx > 0)) Then

                        If arrBall(1).dx < 0 Then
                            ' MOVING TO THE LEFT
                            If arrBall(1).x < (m_iScreenWidth / 2) Then
                                ' INCREASE VOLLEY #
                                ThisGame.iVolleyNum = ThisGame.iVolleyNum + 1

                                ' NOW WAIT FOR BALL TO CROSS IN OTHER DIRECTION
                                ThisGame.iVolleyDir = 0 - ThisGame.iVolleyDir

                                If ThisGame.iVolleyNum >= ThisGame.iIncreaseSpeedAtVolley Then
                                    ' SPEED UP
                                    ThisGame.iSpeed = ThisGame.iSpeed + 1
                                    ThisGame.bSpeedChanged = TRUE

                                    ' PAST MAX SPEED?
                                    If ThisGame.iSpeed > ThisGame.MaxSpeed Then
                                        ThisGame.iSpeed = ThisGame.MinSpeed
                                    End If

                                    ' GET VOLLEY # FOR NEXT SPEED INCREASE
                                    ThisGame.iIncreaseSpeedAtVolley = ThisGame.iVolleyNum + ThisGame.iIncreaseSpeedEvery
                                End If

                            End If
                        ElseIf arrBall(1).dx > 0 Then
                            ' MOVING TO THE RIGHT
                            If arrBall(1).x > (m_iScreenWidth / 2) Then
                                ' INCREASE VOLLEY #
                                ThisGame.iVolleyNum = ThisGame.iVolleyNum + 1

                                ' NOW WAIT FOR BALL TO CROSS IN OTHER DIRECTION
                                ThisGame.iVolleyDir = 0 - ThisGame.iVolleyDir

                                If ThisGame.iVolleyNum >= ThisGame.iIncreaseSpeedAtVolley Then
                                    ' SPEED UP
                                    ThisGame.iSpeed = ThisGame.iSpeed + 1
                                    ThisGame.bSpeedChanged = TRUE

                                    ' PAST MAX SPEED?
                                    If ThisGame.iSpeed > ThisGame.MaxSpeed Then
                                        ThisGame.iSpeed = ThisGame.MinSpeed
                                    End If

                                    ' GET VOLLEY # FOR NEXT SPEED INCREASE
                                    ThisGame.iIncreaseSpeedAtVolley = ThisGame.iVolleyNum + ThisGame.iIncreaseSpeedEvery
                                End If

                            End If
                        End If
                    End If
                End If

                ' MOVE BALL VERTICALLY
                arrBall(1).y = arrBall(1).y + arrBall(1).dy
                If arrBall(1).y < arrBall(1).minY Then
                    arrBall(1).y = arrBall(1).minY
                    arrBall(1).dy = 0 - arrBall(1).dy
                    WallSound1
                ElseIf arrBall(1).y > arrBall(1).maxY Then
                    arrBall(1).y = arrBall(1).maxY
                    arrBall(1).dy = 0 - arrBall(1).dy
                    WallSound2
                End If

                ' SHOW IN-GAME VALUES
                If ThisGame.bShowValues = TRUE Then
                    ' SHOW BALL SPEED
                    ThisGame.sMessage2 = "BALL: DX=" + cstr$(arrBall(1).dx) + " DY=" + cstr$(arrBall(1).dy)

                    ' SHOW VOLLEY # NEXT SPEED INCREASE AT
                    ThisGame.sMessage3 = "INCREASE AT: " + cstr$(ThisGame.iIncreaseSpeedAtVolley)
                End If

                ' DID GAME END?
                If ThisGame.iGameMode = cAttractMode Then
                    ' DEACTIVATE PLAYERS
                    For iPlayer = 1 To 4
                        arrPlayer(iPlayer).IsActive = FALSE
                    Next iPlayer

                    ' UPDATE INSTRUCTIONS
                    DrawInstructionsLayer ThisGame
                End If

            End If

            ' ================================================================================================================================================================
            ' END GAME LOGIC
            ' ================================================================================================================================================================

            ' ================================================================================================================================================================
            ' BEGIN UPDATE DISPLAY
            ' ================================================================================================================================================================

            ' DRAW THE SCORE LAYER
            DrawScoreLayer ThisGame

            ' DRAW THE OBJECTS LAYER
            DrawObjectsLayer ThisGame, arrPlayer(), arrBall()

            ' COPY LAYERS TO SCREEN AND UPDATE DISPLAY
            RenderScreen ThisGame

            ' ================================================================================================================================================================
            ' END UPDATE DISPLAY
            ' ================================================================================================================================================================

            ' ================================================================================================================================================================
            ' QUIT ONCE PLAYER PRESSES ESC KEY
            ' ================================================================================================================================================================
            If iLastKeyDown = VK_ESCAPE Then
                'DebugLog "USER HIT ESCAPE, DELETING TRIGGER FILE"
                DeleteFile m_sTriggerFile
            End If

            ' ================================================================================================================================================================
            ' QUIT IF TRIGGER FILE IS GONE
            ' ================================================================================================================================================================
            If _FileExists(m_sTriggerFile) = FALSE Then
                'DebugLog "_FileExists(" + chr$(34) + m_sTriggerFile + chr$(34) + ") = FALSE, exiting"
                Exit Do
            End If

            ' SET GAME SPEED IN FPS
            '_Limit 60 ' run 60 fps
        Loop While _Connected(lngConn)

        ' RETURN TO AUTODISPLAY
        _AutoDisplay

        ' XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
        ' END MAIN LOOP
        ' XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

        'DebugLog "EXITED MAIN LOOP"
    End If

    If Len(m_sError) > 0 Then
        _AutoDisplay
        'DebugLog "ERROR: " + m_sError

        Screen 0
        Print m_sError
        Input "PRESS ENTER TO CONTINUE TEST"; in$
    End If

End Sub ' main

' /////////////////////////////////////////////////////////////////////////////
' COPY LAYERS TO SCREEN AND UPDATE DISPLAY

Sub RenderScreen (ThisGame As GameType)
    ' CLEAR THE SCREEN
    _Dest 0: Cls , cEmpty

    ' Add the background
    _PutImage , ThisGame.imgBackground, 0

    ' Add the walls
    _PutImage , ThisGame.imgWalls, 0

    ' Add the instructions
    _PutImage , ThisGame.imgText, 0

    ' Add the score
    _PutImage , ThisGame.imgScore, 0

    ' Add the players
    _PutImage , ThisGame.imgPlayers, 0

    ' update screen with changes
    _Display
End Sub ' RenderScreen

' /////////////////////////////////////////////////////////////////////////////
' DRAW THE INSTRUCTIONS LAYER

' TEXT SCREEN AT 1024 x  768 = 128 x 48 (m_iTextCols x m_iTextRows)

' DrawInstructionsLayer ThisGame

Sub DrawInstructionsLayer (ThisGame As GameType)
    Dim sMessage As String
    Dim iCol As Integer

    _Dest ThisGame.imgText: Cls , cEmpty

    Select Case ThisGame.sGameName
        Case "Pong Doubles", "Pong Volleyball":
            Select Case ThisGame.iGameMode
                Case cAttractMode:
                    ' ROW 1: PLUG MOUSE / TITLE
                    Color cWhite, cEmpty
                    sMessage = "MULTI-MOUSE PONG BY SOFTINTHEHEADWARE"
                    iCol = (m_iTextCols / 2) - (Len(sMessage) / 2)
                    Locate 2, iCol: Print sMessage; ' CENTERED TEXT

                    Color cYellow, cEmpty
                    sMessage = "PLUG IN A USB MOUSE FOR EACH PLAYER"
                    iCol = (m_iTextCols / 2) - (Len(sMessage) / 2)
                    Locate 3, iCol: Print sMessage; ' CENTERED TEXT

                    ' ROW 2: SCORE

                    ' ROW 47: CLICK MOUSE
                    Color cYellow, cEmpty
                    sMessage = "EACH PLAYER: CLICK MOUSE TO JOIN GAME, RIGHT-CLICK TO LEAVE"
                    Locate 47, ((m_iTextCols / 2) - (Len(sMessage) / 2)): Print sMessage; ' CENTERED TEXT
                    'Locate 47, 64 - (Len(sMessage) / 2): Print sMessage;

                    ' ROW 48: GAME OPTIONS
                    Color cWhite, cEmpty
                    sMessage = "[1] SELECT GAME"
                    iCol = (((m_iTextCols / 3) / 2) - (Len(sMessage) / 2))
                    Locate 48, iCol: Print sMessage;
                    Color cCyan, cEmpty
                    Locate 48, iCol + Len(sMessage) + 2: Print ThisGame.sGameName;

                    Color cWhite, cEmpty
                    sMessage = "[2] START  GAME"
                    Locate 48, ((m_iTextCols / 2) - (Len(sMessage) / 2)): Print sMessage ' MIDDLE THIRD

                    sMessage = "[ESC] EXIT"
                    Locate 48, (m_iTextCols - ((m_iTextCols / 3) / 2)) - (Len(sMessage) / 2): Print sMessage; ' RIGHT THIRD

                Case cInPlay:
                    ' PRINT TITLE ROW 1
                    Color cWhite, cEmpty
                    sMessage = "MULTI-MOUSE PONG BY SOFTINTHEHEADWARE"
                    iCol = (m_iTextCols / 2) - (Len(sMessage) / 2)
                    Locate 1, iCol: Print sMessage; ' CENTERED TEXT
                    'Locate 1, 64 - (Len(sMessage) / 2): Print sMessage; ' CENTER

                    ' SHOW MORE INSTRUCTIONS ROW 47
                    Color cWhite, cEmpty
                    sMessage = "AVOID MISSING BALL FOR HIGH SCORE"
                    Locate 46, 64 - (Len(sMessage) / 2): Print sMessage; ' CENTER

                    ' ROW 48: GAME OPTIONS
                    Color cWhite, cEmpty
                    'sMessage = "[2] START  GAME"
                    sMessage = "[3] CANCEL GAME"
                    iCol = (((m_iTextCols / 3) / 2) - (Len(sMessage) / 2))
                    Locate 48, iCol: Print sMessage;
                    Color cCyan, cEmpty
                    Locate 48, iCol + Len(sMessage) + 2: Print ThisGame.sGameName;

                    sMessage = "[ESC] EXIT"
                    Locate 48, (m_iTextCols - ((m_iTextCols / 3) / 2)) - (Len(sMessage) / 2): Print sMessage; ' RIGHT THIRD

                Case cPaused:
                    ' PRINT TITLE ROW 1
                    Color cWhite, cEmpty
                    sMessage = "MULTI-MOUSE PONG BY SOFTINTHEHEADWARE"
                    iCol = (m_iTextCols / 2) - (Len(sMessage) / 2)
                    Locate 1, iCol: Print sMessage; ' CENTERED TEXT
                    'Locate 1, 64 - (Len(sMessage) / 2): Print sMessage;

                    ' SHOW MORE INSTRUCTIONS ROW 47
                    Color cWhite, cEmpty
                    sMessage = "PAUSED - PRESS " + Chr$(34) + "P" + Chr$(34) + " TO CONTINUE"
                    Locate 47, 64 - (Len(sMessage) / 2): Print sMessage;

                    ' ROW 48: GAME OPTIONS
                    Color cWhite, cEmpty
                    'sMessage = "[2] START  GAME"
                    'sMessage = "    PLAYING GAME"
                    sMessage = "[P]  RESUME GAME"
                    iCol = (((m_iTextCols / 3) / 2) - (Len(sMessage) / 2))
                    Locate 48, iCol: Print sMessage;
                    Color cCyan, cEmpty
                    Locate 48, iCol + Len(sMessage) + 2: Print ThisGame.sGameName;

                    sMessage = "[ESC] EXIT"
                    Locate 48, (m_iTextCols - ((m_iTextCols / 3) / 2)) - (Len(sMessage) / 2): Print sMessage; ' RIGHT THIRD
            End Select
    End Select

End Sub ' DrawInstructionsLayer

' /////////////////////////////////////////////////////////////////////////////
' DRAW THE SCORE LAYER

' TEXT SCREEN AT 1024 x  768 = 128 x 48 (m_iTextCols x m_iTextRows)

' DrawScoreLayer ThisGame

Sub DrawScoreLayer (ThisGame As GameType)
    Dim sMessage As String
    Dim iCol As Integer

    _Dest ThisGame.imgScore: Cls , cEmpty

    Select Case ThisGame.sGameName
        Case "Pong Doubles", "Pong Volleyball":
            ' PRINT SCORES
            If ThisGame.iScore1 < ThisGame.iScoreToWin Then
                Color cCyan, cEmpty
            Else
                Color ThisGame.ulngScreenColor, cCyan
            End If
            Locate ThisGame.iTeam1ScoreRow, ThisGame.iTeam1ScoreColumn: Print _Trim$(Str$(ThisGame.iScore1));
            If ThisGame.iScore2 < ThisGame.iScoreToWin Then
                Color cCyan, cEmpty
            Else
                Color ThisGame.ulngScreenColor, cCyan
            End If
            Locate ThisGame.iTeam2ScoreRow, ThisGame.iTeam2ScoreColumn: Print _Trim$(Str$(ThisGame.iScore2));

            ' PRINT OTHER INFO
            If ThisGame.iGameMode = cInPlay Or ThisGame.iGameMode = cPaused Then
                Color cWhite, cEmpty
                Locate 46, 32: Print "SPEED: " + cstr$(ThisGame.iSpeed); ' SHOW SPEED
                Locate 46, 96: Print "VOLLEY: " + cstr$(ThisGame.iVolleyNum); ' SHOW VOLLEY #
            End If
        Case Else:
            ' FOR INDIVIDUAL COMPETITION GAMES:
            'for iPlayer = 1 to 4
            '   if arrPlayer(iPlayer).IsActive = true then
            '       IF arrPlayer(iPlayer).score < ThisGame.iScoreToWin THEN
            '           color arrPlayer(iPlayer).color, cEmpty
            '       else
            '           color ThisGame.ulngScreenColor, arrPlayer(iPlayer).color
            '       end if
            '       LOCATE arrPlayer(iPlayer).nameRow, arrPlayer(iPlayer).nameCol: PRINT arrPlayer(iPlayer).ID + ": ";
            '       LOCATE arrPlayer(iPlayer).scoreRow, arrPlayer(iPlayer).scoreCol: PRINT _Trim$(Str$(arrPlayer(1).score));
            '   end if
            'next iPlayer
    End Select

    ' SHOW TEST VALUES?
    If ThisGame.bShowValues = TRUE Then
        Color cHotPink, cEmpty
        Locate 47, 1: Print ThisGame.sMessage1;
        Locate 47, 32: Print ThisGame.sMessage2;
        Locate 47, 64: Print ThisGame.sMessage3;
        Locate 47, 96: Print ThisGame.sMessage4;
    End If

    ' INDICATE IF WE'RE IN TEST MODE
    If ThisGame.bTestMode = TRUE Then
        Color cHotPink, cEmpty
        Locate 47, 120: Print "TEST MODE";
    End If

End Sub ' DrawScoreLayer

' /////////////////////////////////////////////////////////////////////////////
' DRAW THE OBJECTS LAYER

' DrawObjectsLayer ThisGame, arrPlayer(), arrBall()

Sub DrawObjectsLayer (ThisGame As GameType, arrPlayer() As PlayerType, arrBall() As BallType)
    Dim iPlayer As Integer
    Dim iBall As Integer

    _Dest ThisGame.imgPlayers: Cls , cEmpty

    Select Case ThisGame.sGameName
        Case "Pong Doubles", "Pong Volleyball":

            For iPlayer = 1 To 4
                If arrPlayer(iPlayer).IsActive = TRUE Then
                    DrawRectSolid arrPlayer(iPlayer).x, arrPlayer(iPlayer).y, arrPlayer(iPlayer).width, arrPlayer(iPlayer).height, arrPlayer(iPlayer).color
                End If
            Next iPlayer

            For iBall = 1 To 1
                If ThisGame.iGameMode = cInPlay Or ThisGame.iGameMode = cPaused Then
                    DrawBoxSolid arrBall(iBall).x, arrBall(iBall).y, arrBall(iBall).size, arrBall(iBall).color
                End If
            Next iBall
    End Select
End Sub ' DrawObjectsLayer' /////////////////////////////////////////////////////////////////////////////
' arrInitPlayer({iNumPlayers}, [iPlayer}) as InitPlayerType

' NOTE: scoreCol, scoreRow, nameCol, nameRow are for future use
'       such as games where players compete individually,
'       currently all game options use team play

Sub InitGame (ThisGame As GameType, arrPlayer() As PlayerType, arrBall() As BallType)
    Dim arrInitPlayer(1 To 4) As InitPlayerType ' (# players): for now support upto 4 players, later we'll add 8 or 16
    Dim iNumPlayers As Integer
    Dim iPlayer As Integer
    Dim iNextX As Integer
    Dim iNextY As Integer

    ' ENABLE/DISABLE DEBUGGING
    'ThisGame.bTestMode = FALSE
    'ThisGame.bShowValues = FALSE
    'ThisGame.sMessage1 = ""
    'ThisGame.sMessage2 = ""
    'ThisGame.sMessage3 = ""
    'ThisGame.sMessage4 = ""

    ' ================================================================================================================================================================
    ' SETUP COMMON TO ALL GAMES
    ' ================================================================================================================================================================
    ' PROGRAM STATUS
    ThisGame.iGameMode = cAttractMode ' cAttractMode=wait for player input to change options or start game; cInPlay=game in session; cPaused=game paused, wait for P key or escape

    ' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
    ' INIT LAYERS
    ' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
    _Dest 0: Cls , cEmpty
    If ThisGame.imgBackground = -1 Or ThisGame.imgBackground = 0 Then
        ThisGame.imgBackground = _NewImage(m_iScreenWidth, m_iScreenHeight, 32)
    End If
    If ThisGame.imgWalls = -1 Or ThisGame.imgWalls = 0 Then
        ThisGame.imgWalls = _NewImage(m_iScreenWidth, m_iScreenHeight, 32)
    End If
    If ThisGame.imgText = -1 Or ThisGame.imgText = 0 Then
        ThisGame.imgText = _NewImage(m_iScreenWidth, m_iScreenHeight, 32)
    End If
    If ThisGame.imgPlayers = -1 Or ThisGame.imgPlayers = 0 Then
        ThisGame.imgPlayers = _NewImage(m_iScreenWidth, m_iScreenHeight, 32)
        _Dest ThisGame.imgPlayers: Cls , cEmpty
    End If
    If ThisGame.imgScore = -1 Or ThisGame.imgScore = 0 Then
        ThisGame.imgScore = _NewImage(m_iScreenWidth, m_iScreenHeight, 32)
        _Dest ThisGame.imgScore: Cls , cEmpty
    End If
    'If imgScreen& < -1 Or imgScreen& > 0 Then
    '   _FreeImage imgScreen&
    'End If
    '' update screen with changes
    '_Display

    ' ================================================================================================================================================================
    ' SPECIFIC GAME SETUP
    ' ================================================================================================================================================================
    Select Case ThisGame.sGameName

        Case "Pong Doubles":
            ' COLORS
            ThisGame.ulngScreenColor = cBlack
            ThisGame.ulngWallColor = cWhite

            ' FOR PLACING TEXT ON SCREEN: currently 1024 x  768 = 128 columns x 48 rows of text
            ThisGame.iTeam1ScoreColumn = 32
            ThisGame.iTeam2ScoreColumn = 96
            ThisGame.iTeam1ScoreRow = 2
            ThisGame.iTeam2ScoreRow = 2

            ' GAME PARAMETERS
            ThisGame.iScoreToWin = 11
            ThisGame.MinSpeed = 1
            ThisGame.MaxSpeed = 32
            ThisGame.iIncreaseSpeedEvery = 4 ' # times ball crosses net before increasing speed (add +1 to speed)

            ' GAME VARIABLES
            ThisGame.iScore1 = 0
            ThisGame.iScore2 = 0
            ThisGame.iVolleyNum = 0
            ThisGame.iSpeed = ThisGame.MinSpeed
            ThisGame.bSpeedChanged = TRUE
            ThisGame.iIncreaseSpeedAtVolley = ThisGame.iIncreaseSpeedEvery ' next iVolleyNum to increase speed at
            ThisGame.iVolleyDir = 0 ' (set at serveball)
            'ThisGame.iWhoLastHitBall = 0 ' FOR MULTIPLAYER NON-TEAM SCORING:

            ' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
            ' DRAW THE BACKGROUND LAYER
            ' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
            _Dest ThisGame.imgBackground: Cls , ThisGame.ulngScreenColor

            ' DRAW THE NET
            For iNextY = 44 To (m_iScreenHeight - 48) Step 20
                Line ((m_iScreenWidth / 2) - 2, iNextY)-((m_iScreenWidth / 2) + 2, iNextY + 10), ThisGame.ulngWallColor, BF
            Next iNextY
            'LINE (0, 0)-(iScreenWidth, iScreenHeight), ulngScreenColor, BF ' Draw a solid box

            ' DRAW LINE BETWEEN PLAYERS
            For iNextX = 7 To m_iScreenWidth Step 20
                Line (iNextX, (m_iScreenHeight / 2) - 2)-(iNextX + 10, (m_iScreenHeight / 2) + 2), ThisGame.ulngWallColor, BF
            Next iNextX

            ' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
            ' DRAW THE WALLS LAYER
            ' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
            _Dest ThisGame.imgWalls: Cls , cEmpty

            ' DRAW WALLS AROUND EDGES
            For iNextX = 7 To m_iScreenWidth Step 20
                Line (iNextX, 40)-(iNextX + 10, 44), ThisGame.ulngWallColor, BF
                Line (iNextX, m_iScreenHeight - 50)-(iNextX + 10, m_iScreenHeight - 54), ThisGame.ulngWallColor, BF
            Next iNextX
            'DrawRectSolid (iX As Integer, iY As Integer, iSizeW As Integer, iSizeH As Integer, fgColor As _Unsigned Long)
            'DrawBoxSolid (iX As Integer, iY As Integer, iSize As Integer, fgColor As _Unsigned Long)

            ' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
            ' PLAYER 1 (TEAM #1 ON LEFT) SETTINGS
            ' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
            iPlayer = 1
            arrInitPlayer(iPlayer).ID = "Player" + _Trim$(Str$(iPlayer))
            arrInitPlayer(iPlayer).IsAvailable = TRUE
            arrInitPlayer(iPlayer).TeamNumber = 1
            arrInitPlayer(iPlayer).color = cRed
            arrInitPlayer(iPlayer).x = 64 ' LEFT SIDE OF SCREEN
            arrInitPlayer(iPlayer).y = m_iScreenHeight / 4 ' MIDDLE OF TOP HALF OF SCREEN
            arrInitPlayer(iPlayer).width = 16
            arrInitPlayer(iPlayer).height = 64
            arrInitPlayer(iPlayer).minX = arrInitPlayer(1).x
            arrInitPlayer(iPlayer).maxX = arrInitPlayer(1).x
            arrInitPlayer(iPlayer).minY = 45 ' TOP OF SCREEN
            arrInitPlayer(iPlayer).maxY = (m_iScreenHeight / 2) - arrInitPlayer(iPlayer).height ' MIDDLE OF SCREEN
            arrInitPlayer(iPlayer).UpKey = VK_A
            arrInitPlayer(iPlayer).DownKey = VK_Z
            'arrPlayer(iPlayer).scoreCol = 32
            'arrPlayer(iPlayer).scoreRow = 2
            'arrPlayer(iPlayer).nameCol = arrPlayer(1).scoreCol - 8
            'arrPlayer(iPlayer).nameRow = arrPlayer(1).scoreRow

            ' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
            ' PLAYER 2 (TEAM #2 ON RIGHT) SETTINGS
            ' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
            iPlayer = 2
            arrInitPlayer(iPlayer).ID = "Player" + _Trim$(Str$(iPlayer))
            arrInitPlayer(iPlayer).IsAvailable = TRUE
            arrInitPlayer(iPlayer).TeamNumber = 2
            arrInitPlayer(iPlayer).color = cBlue
            arrInitPlayer(iPlayer).x = m_iScreenWidth - 64 ' RIGHT SIDE OF SCREEN
            arrInitPlayer(iPlayer).y = m_iScreenHeight / 4 ' MIDDLE OF TOP HALF OF SCREEN
            arrInitPlayer(iPlayer).width = 16
            arrInitPlayer(iPlayer).height = 64
            arrInitPlayer(iPlayer).minX = arrInitPlayer(iPlayer).x
            arrInitPlayer(iPlayer).maxX = arrInitPlayer(iPlayer).x
            arrInitPlayer(iPlayer).minY = 45 ' TOP OF SCREEN
            arrInitPlayer(iPlayer).maxY = (m_iScreenHeight / 2) - arrInitPlayer(iPlayer).height ' MIDDLE OF SCREEN
            arrInitPlayer(iPlayer).UpKey = VK_UP
            arrInitPlayer(iPlayer).DownKey = VK_DOWN
            'arrPlayer(iPlayer).scoreCol = 54 '96
            'arrPlayer(iPlayer).scoreRow = 2
            'arrPlayer(iPlayer).nameCol = arrPlayer(iPlayer).scoreCol - 8
            'arrPlayer(iPlayer).nameRow = arrPlayer(iPlayer).scoreRow

            ' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
            ' PLAYER 3 (TEAM #1 ON LEFT) SETTINGS
            ' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
            iPlayer = 3
            arrInitPlayer(iPlayer).ID = "Player" + _Trim$(Str$(iPlayer))
            arrInitPlayer(iPlayer).IsAvailable = TRUE
            arrInitPlayer(iPlayer).TeamNumber = 1
            arrInitPlayer(iPlayer).color = cYellow
            arrInitPlayer(iPlayer).x = 64 ' LEFT SIDE OF SCREEN
            arrInitPlayer(iPlayer).y = m_iScreenHeight - (m_iScreenHeight / 4) ' MIDDLE OF BOTTOM HALF OF SCREEN
            arrInitPlayer(iPlayer).width = 16
            arrInitPlayer(iPlayer).height = 64
            arrInitPlayer(iPlayer).minX = arrInitPlayer(iPlayer).x
            arrInitPlayer(iPlayer).maxX = arrInitPlayer(iPlayer).x
            arrInitPlayer(iPlayer).minY = (m_iScreenHeight / 2) + 1 ' MIDDLE OF SCREEN +1px
            arrInitPlayer(iPlayer).maxY = m_iScreenHeight - (54 + arrInitPlayer(iPlayer).height + 1)
            arrInitPlayer(iPlayer).UpKey = VK_I
            arrInitPlayer(iPlayer).DownKey = VK_K
            'arrPlayer(iPlayer).scoreCol = 76 '32
            'arrPlayer(iPlayer).scoreRow = 2
            'arrPlayer(iPlayer).nameCol = arrPlayer(iPlayer).scoreCol - 8
            'arrPlayer(iPlayer).nameRow = arrPlayer(iPlayer).scoreRow

            ' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
            ' PLAYER 4 (TEAM #2 ON RIGHT) SETTINGS
            ' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
            iPlayer = 4
            arrInitPlayer(iPlayer).ID = "Player" + _Trim$(Str$(iPlayer))
            arrInitPlayer(iPlayer).IsAvailable = TRUE
            arrInitPlayer(iPlayer).TeamNumber = 2
            arrInitPlayer(iPlayer).color = cLime
            arrInitPlayer(iPlayer).x = m_iScreenWidth - 64 ' RIGHT SIDE OF SCREEN
            arrInitPlayer(iPlayer).y = m_iScreenHeight - (m_iScreenHeight / 4) ' MIDDLE OF BOTTOM HALF OF SCREEN
            arrInitPlayer(iPlayer).width = 16
            arrInitPlayer(iPlayer).height = 64
            arrInitPlayer(iPlayer).minX = arrInitPlayer(iPlayer).x
            arrInitPlayer(iPlayer).maxX = arrInitPlayer(iPlayer).x
            arrInitPlayer(iPlayer).minY = (m_iScreenHeight / 2) + 1 ' MIDDLE OF SCREEN +1px
            arrInitPlayer(iPlayer).maxY = m_iScreenHeight - (54 + arrInitPlayer(iPlayer).height + 1) ' BOTTOM OF SCREEN
            arrInitPlayer(iPlayer).UpKey = VK_SUBTRACT ' numeric keypad -
            arrInitPlayer(iPlayer).DownKey = VK_ADD ' numeric keypad +
            'arrPlayer(iPlayer).scoreCol = 98 '96
            'arrPlayer(iPlayer).scoreRow = 2
            'arrPlayer(iPlayer).nameCol = arrPlayer(iPlayer).scoreCol - 8
            'arrPlayer(iPlayer).nameRow = arrPlayer(iPlayer).scoreRow

            ' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
            ' INITIALIZE BALL
            ' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
            arrBall(1).size = 8
            arrBall(1).color = cCyan
            arrBall(1).x = 0
            arrBall(1).y = 0
            'arrBall(1).nextX = 0
            'arrBall(1).nextY = 0
            arrBall(1).dx = 0
            arrBall(1).dy = 0
            arrBall(1).minX = 1
            arrBall(1).maxX = m_iScreenWidth
            arrBall(1).minY = 45
            arrBall(1).maxY = m_iScreenHeight - (54 + arrBall(1).size + 1)


            ' ================================================================================================================================================================
        Case "Pong Volleyball":
            ' COLORS
            ThisGame.ulngScreenColor = cBlack
            ThisGame.ulngWallColor = cWhite

            ' FOR PLACING TEXT ON SCREEN: currently 1024 x  768 = 128 columns x 48 rows of text
            ThisGame.iTeam1ScoreColumn = 32
            ThisGame.iTeam2ScoreColumn = 96
            ThisGame.iTeam1ScoreRow = 2
            ThisGame.iTeam2ScoreRow = 2

            ' GAME PARAMETERS
            ThisGame.iScoreToWin = 11
            ThisGame.MinSpeed = 1
            ThisGame.MaxSpeed = 32
            ThisGame.iIncreaseSpeedEvery = 4 ' # times ball crosses net before increasing speed (add +1 to speed)

            ' GAME VARIABLES
            ThisGame.iScore1 = 0
            ThisGame.iScore2 = 0
            ThisGame.iVolleyNum = 0
            ThisGame.iSpeed = ThisGame.MinSpeed
            ThisGame.bSpeedChanged = TRUE
            ThisGame.iIncreaseSpeedAtVolley = ThisGame.iIncreaseSpeedEvery ' next iVolleyNum to increase speed at
            ThisGame.iVolleyDir = 0 ' (set at serveball)
            'ThisGame.iWhoLastHitBall = 0 ' FOR MULTIPLAYER NON-TEAM SCORING:

            ' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
            ' DRAW THE BACKGROUND LAYER
            ' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
            _Dest ThisGame.imgBackground: Cls , ThisGame.ulngScreenColor

            ' DRAW THE NET
            For iNextY = 44 To (m_iScreenHeight - 48) Step 20
                Line ((m_iScreenWidth / 2) - 2, iNextY)-((m_iScreenWidth / 2) + 2, iNextY + 10), ThisGame.ulngWallColor, BF
            Next iNextY
            'LINE (0, 0)-(iScreenWidth, iScreenHeight), ulngScreenColor, BF ' Draw a solid box

            ' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
            ' DRAW THE WALLS LAYER
            ' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
            _Dest ThisGame.imgWalls: Cls , cEmpty

            ' DRAW WALLS AROUND EDGES
            For iNextX = 7 To m_iScreenWidth Step 20
                Line (iNextX, 40)-(iNextX + 10, 44), ThisGame.ulngWallColor, BF
                Line (iNextX, m_iScreenHeight - 50)-(iNextX + 10, m_iScreenHeight - 54), ThisGame.ulngWallColor, BF
            Next iNextX
            'DrawRectSolid (iX As Integer, iY As Integer, iSizeW As Integer, iSizeH As Integer, fgColor As _Unsigned Long)
            'DrawBoxSolid (iX As Integer, iY As Integer, iSize As Integer, fgColor As _Unsigned Long)

            ' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
            ' PLAYER 1 (TEAM #1 ON LEFT) SETTINGS
            ' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
            iPlayer = 1
            arrInitPlayer(iPlayer).ID = "Player1"
            arrInitPlayer(iPlayer).IsAvailable = TRUE
            arrInitPlayer(iPlayer).TeamNumber = 1
            arrInitPlayer(iPlayer).color = cRed
            arrInitPlayer(iPlayer).x = 64 ' LEFT SIDE OF SCREEN
            arrInitPlayer(iPlayer).y = m_iScreenHeight / 2 ' MIDDLE OF SCREEN
            arrInitPlayer(iPlayer).width = 16
            arrInitPlayer(iPlayer).height = 64
            arrInitPlayer(iPlayer).minX = arrInitPlayer(1).x
            arrInitPlayer(iPlayer).maxX = arrInitPlayer(1).x
            arrInitPlayer(iPlayer).minY = 45 ' TOP OF SCREEN
            arrInitPlayer(iPlayer).maxY = m_iScreenHeight - (54 + arrInitPlayer(1).height + 1) ' BOTTOM OF SCREEN
            arrInitPlayer(iPlayer).UpKey = VK_A
            arrInitPlayer(iPlayer).DownKey = VK_Z
            'arrPlayer(iPlayer).scoreCol = 32
            'arrPlayer(iPlayer).scoreRow = 2
            'arrPlayer(iPlayer).nameCol = arrPlayer(1).scoreCol - 8
            'arrPlayer(iPlayer).nameRow = arrPlayer(1).scoreRow

            ' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
            ' PLAYER 2 (TEAM #2 ON RIGHT) SETTINGS
            ' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
            iPlayer = 2
            arrInitPlayer(iPlayer).ID = "Player2"
            arrInitPlayer(iPlayer).IsAvailable = TRUE
            arrInitPlayer(iPlayer).TeamNumber = 2
            arrInitPlayer(iPlayer).color = cBlue
            arrInitPlayer(iPlayer).x = m_iScreenWidth - 64 ' RIGHT SIDE OF SCREEN
            arrInitPlayer(iPlayer).y = m_iScreenHeight / 2 ' MIDDLE OF SCREEN
            arrInitPlayer(iPlayer).width = 16
            arrInitPlayer(iPlayer).height = 64
            arrInitPlayer(iPlayer).minX = arrInitPlayer(iPlayer).x
            arrInitPlayer(iPlayer).maxX = arrInitPlayer(iPlayer).x
            arrInitPlayer(iPlayer).minY = 45 ' TOP OF SCREEN
            arrInitPlayer(iPlayer).maxY = m_iScreenHeight - (54 + arrInitPlayer(iPlayer).height + 1) ' BOTTOM OF SCREEN
            arrInitPlayer(iPlayer).UpKey = VK_UP
            arrInitPlayer(iPlayer).DownKey = VK_DOWN
            'arrPlayer(iPlayer).scoreCol = 54 '96
            'arrPlayer(iPlayer).scoreRow = 2
            'arrPlayer(iPlayer).nameCol = arrPlayer(iPlayer).scoreCol - 8
            'arrPlayer(iPlayer).nameRow = arrPlayer(iPlayer).scoreRow

            ' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
            ' PLAYER 3 (TEAM #1 ON LEFT) SETTINGS
            ' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
            iPlayer = 3
            arrInitPlayer(iPlayer).ID = "Player3"
            arrInitPlayer(iPlayer).IsAvailable = TRUE
            arrInitPlayer(iPlayer).TeamNumber = 3
            arrInitPlayer(iPlayer).color = cYellow
            arrInitPlayer(iPlayer).x = 64 * 5 ' TO THE LEFT OF THE NET
            arrInitPlayer(iPlayer).y = m_iScreenHeight / 2 ' MIDDLE OF SCREEN
            arrInitPlayer(iPlayer).width = 16
            arrInitPlayer(iPlayer).height = 64
            arrInitPlayer(iPlayer).minX = arrInitPlayer(iPlayer).x
            arrInitPlayer(iPlayer).maxX = arrInitPlayer(iPlayer).x
            arrInitPlayer(iPlayer).minY = 45 ' TOP OF SCREEN
            arrInitPlayer(iPlayer).maxY = m_iScreenHeight - (54 + arrInitPlayer(iPlayer).height + 1) ' BOTTOM OF SCREEN
            arrInitPlayer(iPlayer).UpKey = VK_I
            arrInitPlayer(iPlayer).DownKey = VK_K
            'arrPlayer(iPlayer).scoreCol = 76 '32
            'arrPlayer(iPlayer).scoreRow = 2
            'arrPlayer(iPlayer).nameCol = arrPlayer(iPlayer).scoreCol - 8
            'arrPlayer(iPlayer).nameRow = arrPlayer(iPlayer).scoreRow

            ' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
            ' PLAYER 4 (TEAM #2 ON RIGHT) SETTINGS
            ' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
            iPlayer = 4
            arrInitPlayer(iPlayer).ID = "Player4"
            arrInitPlayer(iPlayer).IsAvailable = TRUE
            arrInitPlayer(iPlayer).TeamNumber = 4
            arrInitPlayer(iPlayer).color = cLime
            arrInitPlayer(iPlayer).x = m_iScreenWidth - (64 * 5) ' TO THE RIGHT OF THE NET
            arrInitPlayer(iPlayer).y = m_iScreenHeight / 2 ' MIDDLE OF SCREEN
            arrInitPlayer(iPlayer).width = 16
            arrInitPlayer(iPlayer).height = 64
            arrInitPlayer(iPlayer).minX = arrInitPlayer(iPlayer).x
            arrInitPlayer(iPlayer).maxX = arrInitPlayer(iPlayer).x
            arrInitPlayer(iPlayer).minY = 45 ' TOP OF SCREEN
            arrInitPlayer(iPlayer).maxY = m_iScreenHeight - (54 + arrInitPlayer(iPlayer).height + 1) ' BOTTOM OF SCREEN
            arrInitPlayer(iPlayer).UpKey = VK_SUBTRACT ' numeric keypad -
            arrInitPlayer(iPlayer).DownKey = VK_ADD ' numeric keypad +
            'arrPlayer(iPlayer).scoreCol = 98 '96
            'arrPlayer(iPlayer).scoreRow = 2
            'arrPlayer(iPlayer).nameCol = arrPlayer(iPlayer).scoreCol - 8
            'arrPlayer(iPlayer).nameRow = arrPlayer(iPlayer).scoreRow

    End Select

    ' ================================================================================================================================================================
    ' INITIALIZE PLAYERS WITH SETTINGS FOR CURRENT GAME
    ' ================================================================================================================================================================
    For iPlayer = 1 To 4
        ' GAME OPTION SPECIFIC PLAYER PARAMETERS
        arrPlayer(iPlayer).IsAvailable = arrInitPlayer(iPlayer).IsAvailable
        arrPlayer(iPlayer).TeamNumber = arrInitPlayer(iPlayer).TeamNumber
        arrPlayer(iPlayer).ID = arrInitPlayer(iPlayer).ID
        arrPlayer(iPlayer).color = arrInitPlayer(iPlayer).color
        arrPlayer(iPlayer).x = arrInitPlayer(iPlayer).x
        arrPlayer(iPlayer).y = arrInitPlayer(iPlayer).y
        arrPlayer(iPlayer).width = arrInitPlayer(iPlayer).width
        arrPlayer(iPlayer).height = arrInitPlayer(iPlayer).height
        arrPlayer(iPlayer).minX = arrInitPlayer(iPlayer).minX
        arrPlayer(iPlayer).maxX = arrInitPlayer(iPlayer).maxX
        arrPlayer(iPlayer).minY = arrInitPlayer(iPlayer).minY
        arrPlayer(iPlayer).maxY = arrInitPlayer(iPlayer).maxY
        arrPlayer(iPlayer).UpKey = arrInitPlayer(iPlayer).UpKey
        arrPlayer(iPlayer).DownKey = arrInitPlayer(iPlayer).DownKey
        'arrPlayer(iPlayer).scoreCol = arrPlayer(iPlayer).scoreCol
        'arrPlayer(iPlayer).scoreRow = arrPlayer(iPlayer).scoreRow
        'arrPlayer(iPlayer).nameCol = arrPlayer(iPlayer).nameCol
        'arrPlayer(iPlayer).nameRow = arrPlayer(iPlayer).nameRow

        ' CALCULATED BASED ON GAME PARAMETERS
        arrPlayer(iPlayer).BounceSegmentWidth = arrPlayer(iPlayer).width / 7
        arrPlayer(iPlayer).BounceSegmentHeight = arrPlayer(iPlayer).height / 7

        ' PLAYER PARAMETERS THAT ARE THE SAME FOR ALL GAMES
        arrPlayer(iPlayer).Score = 0
        'arrPlayer(iPlayer).IsActive = FALSE ' WAIT UNTIL GIVEN MOUSE IS MOVED TO ACTIVATE EACH PLAYER (IsActive = TRUE)
        'arrPlayer(iPlayer).px = 0
        'arrPlayer(iPlayer).py = 0
        'arrPlayer(iPlayer).LeftDown = FALSE
        'arrPlayer(iPlayer).LeftDownOld = FALSE
        'arrPlayer(iPlayer).MiddleDown = FALSE
        'arrPlayer(iPlayer).MiddleDownOld = FALSE
        'arrPlayer(iPlayer).RightDown = FALSE
        'arrPlayer(iPlayer).RightDownOld = FALSE
    Next iPlayer

End Sub ' InitGame

' /////////////////////////////////////////////////////////////////////////////
' BALL HITS PADDLE SOUND

Sub BallPaddleSound (iSpeed As Integer)
    Dim iNote As Integer
    iNote = iSpeed * 100
    If iNote > 4186 Then
        iNote = 4186
    End If
    Sound iNote, .75
End Sub ' BallPaddleSound

' /////////////////////////////////////////////////////////////////////////////

Sub ScoreSound1
    Sound 123, 4
End Sub ' ScoreSound1

' /////////////////////////////////////////////////////////////////////////////

Sub WallSound1
    Sound 932, .75
End Sub ' WallSound1

' /////////////////////////////////////////////////////////////////////////////

Sub WallSound2
    Sound 123, .75
End Sub ' WallSound2

' /////////////////////////////////////////////////////////////////////////////
'
' Calculates the angle of trajectory of puck based on where it hits
' the paddle and its current trajectory.
'
' (variables passed in by reference)
'
' PucksY!   - puck's current y location
' PlayersY% - current player's paddle y location
'
' REMEMBER: If you modify a variable in a SUB/FUNCTION that has been passed
'           by reference, that modification will also be seen in the variable
'           used when calling the SUB/FUNCTION.
'
'           A function's name acts like a variable, returning a value to the
'           calling routine.
'
' NOTE    : For less deflection increase the last value on the next code line.
'           (default = 2)

Function TRAJECTORY% (ball_y%, player_y%, ball_size%, player_height%)
    TRAJECTORY% = (((ball_y% - player_y%) + ball_size% - (player_height% + ball_size%) \ 2) / ((player_height% + ball_size%) / 2)) / 2
End Function ' TRAJECTORY%

' /////////////////////////////////////////////////////////////////////////////

'SUB ServeBall (to_player%, ball_x%, ball_x1%, ball_x2%, ball_y%, ball_y1%, ball_y2%, ball_size%, screen_width%, screen_height%, ball_dx%, ball_dy%, iVolleyNum)
Sub ServeBall (ThisGame As GameType, MyBall As BallType, arrPlayer() As PlayerType, iToPlayer As Integer)
    Dim iGuess As Integer

    ' START IN THE MIDDLE OF THE COURT
    MyBall.x = m_iScreenWidth / 2

    ' PICK A RANDOM STARTING POINT
    MyBall.y = RandomNumber%(20, m_iScreenHeight - 20)

    ' CHOOSE HORIZONTAL DIRECTION?
    If iToPlayer = 0 Then
        ' PICK A RANDOM HORIZONTAL DIRECTION
        iGuess = RandomNumber%(1, 2)
        If iGuess = 1 Then
            ' 1 = right
            MyBall.dx = MyBall.size / 2
        Else
            ' 2 = left
            MyBall.dx = 0 - (MyBall.size / 2)
        End If

        If MyBall.dx < 1 Then
            ThisGame.iVolleyDir = -1
        Else
            ThisGame.iVolleyDir = 1
        End If
    Else
        ' (BALL DX RESUMES FROM BEFORE)
    End If

    ' CHOOSE VERTICAL DIRECTION?
    If iToPlayer = 0 Then
        ' PICK A RANDOM VERTICAL DIRECTION & SPEED
        iGuess = RandomNumber%(1, 2)
        If iGuess = 1 Then
            ' 1 = down
            iGuess = RandomNumber%(0, 6)
            MyBall.dy = iGuess
        Else
            ' 2 = up
            iGuess = RandomNumber%(0, 6)
            MyBall.dy = 0 - iGuess
        End If
    Else
        ' (BALL DY RESUMES FROM BEFORE)
    End If

    ' RESTART COUNTER
    ThisGame.iVolleyNum = 0
    ThisGame.iIncreaseSpeedAtVolley = ThisGame.iIncreaseSpeedEvery

    ' PLAY SOUND
    BallPaddleSound ThisGame.iSpeed
End Sub ' ServeBall

' /////////////////////////////////////////////////////////////////////////////

Sub BallHitPaddle (ThisGame As GameType, MyBall As BallType, MyPlayer As PlayerType, arrZone() As Integer)
    Dim iDeflectionZone As Integer

    BallPaddleSound ThisGame.iSpeed

    ' TURN BALL AROUND
    MyBall.dx = 0 - MyBall.dx

    ' TIME TO SPEED UP BALL?
    If ThisGame.bSpeedChanged = TRUE Then
        If MyBall.dx < 0 Then
            If Abs(MyBall.dx) < ThisGame.iSpeed Then
                MyBall.dx = 0 - ThisGame.iSpeed
            End If
        ElseIf MyBall.dx > 0 Then
            If MyBall.dx < ThisGame.iSpeed Then
                MyBall.dx = ThisGame.iSpeed
            End If
        Else
            ' (BALL DX SHOULD NEVER BE ZERO FOR RIGHT<->LEFT PONG GAMES)
        End If
        ThisGame.bSpeedChanged = FALSE
    End If

    ' MOVE BALL NEXT TO PADDLE (NOT ON IT)
    If MyBall.dx < 0 Then
        MyBall.x = (MyPlayer.x - 1)
    Else
        MyBall.x = (MyPlayer.x + MyPlayer.width)
    End If

    ' DETERMINE WHAT SEGMENT OF THE PADDLE THE BALL HIT
    ' WHICH TELLS US WHAT ANGLE IT BOUNCES AT
    ' (MIDDLE SEGMENT = STRAIGHT)
    If MyBall.y > MyPlayer.y + (MyPlayer.BounceSegmentHeight * 6) Then
        iDeflectionZone = 7
    ElseIf MyBall.y > MyPlayer.y + (MyPlayer.BounceSegmentHeight * 5) Then
        iDeflectionZone = 6
    ElseIf MyBall.y > MyPlayer.y + (MyPlayer.BounceSegmentHeight * 4) Then
        iDeflectionZone = 5
    ElseIf MyBall.y > MyPlayer.y + (MyPlayer.BounceSegmentHeight * 3) Then
        iDeflectionZone = 4
    ElseIf MyBall.y > MyPlayer.y + (MyPlayer.BounceSegmentHeight * 2) Then
        iDeflectionZone = 3
    ElseIf MyBall.y > MyPlayer.y + (MyPlayer.BounceSegmentHeight * 1) Then
        iDeflectionZone = 2
    Else
        iDeflectionZone = 1
    End If

    MyBall.dy = arrZone(ThisGame.iSpeed, iDeflectionZone)
End Sub ' BallHitPaddle

' /////////////////////////////////////////////////////////////////////////////
' Bounces the ball back even if it doesn't hit player (for test mode)

Sub BounceBack (ThisGame As GameType, MyBall As BallType, MyPlayer As PlayerType, iDirection As Integer)
    If iDirection = cLeftDir Then
        BallPaddleSound ThisGame.iSpeed

        ' TURN BALL AROUND
        MyBall.dx = 0 - MyBall.dx

        ' TIME TO SPEED UP BALL?
        If ThisGame.bSpeedChanged = TRUE Then
            If MyBall.dx < 0 Then
                'If Abs(MyBall.dx) < ThisGame.iSpeed Then
                MyBall.dx = 0 - ThisGame.iSpeed
                'End If
            ElseIf MyBall.dx > 0 Then
                'If MyBall.dx < ThisGame.iSpeed Then
                MyBall.dx = ThisGame.iSpeed
                'End If
            Else
                ' (BALL DX SHOULD NEVER BE ZERO FOR RIGHT<->LEFT PONG GAMES)
            End If
            ThisGame.bSpeedChanged = FALSE
        End If

        ' MOVE BALL NEXT TO PADDLE (NOT ON IT)
        If MyBall.dx < 0 Then
            MyBall.x = (MyPlayer.x - 1)
        Else
            MyBall.x = (MyPlayer.x + MyPlayer.width)
        End If

    Else ' iDirection = cRightDir
        ' ****************************************************************************************************************************************************************
        ' TEST MODE BOUNCE BACK FOR PADDLE #2
        ' ****************************************************************************************************************************************************************
        BallPaddleSound ThisGame.iSpeed

        ' TURN BALL AROUND
        MyBall.dx = 0 - MyBall.dx

        ' TIME TO SPEED UP BALL?
        If ThisGame.bSpeedChanged = TRUE Then
            If MyBall.dx < 0 Then
                If Abs(MyBall.dx) < ThisGame.iSpeed Then
                    MyBall.dx = 0 - ThisGame.iSpeed
                End If
            ElseIf MyBall.dx > 0 Then
                If MyBall.dx < ThisGame.iSpeed Then
                    MyBall.dx = ThisGame.iSpeed
                End If
            Else
                ' (BALL DX SHOULD NEVER BE ZERO FOR RIGHT<->LEFT PONG GAMES)
            End If
            ThisGame.bSpeedChanged = FALSE
        End If

        ' MOVE BALL NEXT TO PADDLE (NOT ON IT)
        If MyBall.dx < 0 Then
            MyBall.x = (MyPlayer.x - 1)
        Else
            MyBall.x = (MyPlayer.x + MyPlayer.width)
        End If
    End If
End Sub ' BounceBack

' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
' END PONG ROUTINES
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
' BEGIN ERROR HANDLING HELPER FUNCTIONS
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Sub ErrorClear
    m_sError = ""
    m_sIncludeError = ""
End Sub ' ErrorClear
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
' END ERROR HANDLING HELPER FUNCTIONS
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
' BEGIN PROGRAM METADATA ROUTINES
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

' /////////////////////////////////////////////////////////////////////////////
' Parses out the version # from the filename
' {filename}{version #}.{ext}
' and returns it as a string.

Function GetVersionNum$ (sFileName$)
    Const cDigits = "1234567890"
    Dim sResult As String
    Dim sProgName As String
    Dim iLoop As Integer
    sResult$ = ""
    sProgName$ = NoExt$(sFileName$)
    For iLoop = Len(sProgName) To 1 Step -1
        If InStr(1, cDigits, Mid$(sProgName, iLoop, 1)) = 0 Then
            Exit For
        Else
            sResult = Mid$(sProgName, iLoop, 1) + sResult
        End If
    Next iLoop
    GetVersionNum$ = sResult
End Function ' GetVersionNum$
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
' END PROGRAM METADATA ROUTINES
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
' BEGIN GRAPHIC PRINTING ROUTINES
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

' /////////////////////////////////////////////////////////////////////////////
' Does a _PrintString at the specified row+column.
'
' iRow% and iCol% are 0-based in this version
'
' See also: PrintString, PrintString1, PutCharXY

Sub PrintAt (iRow%, iCol%, sText$)
    _PrintString (iCol% * 8, iRow% * 16), sText$
    '_PrintString (iCol%, iRow%), sText$
End Sub ' PrintAt

' /////////////////////////////////////////////////////////////////////////////
' Does a _PrintString at the specified row+column.
' iRow and iCol are 0-based.
' See also: PrintString1

Sub PrintString0 (iRow As Integer, iCol As Integer, MyString As String)
    Dim iX As Integer
    Dim iY As Integer
    iX = _FontWidth * iCol
    iY = _FontHeight * iRow ' (iRow + 1)
    _PrintString (iX, iY), MyString
End Sub ' PrintString0

' /////////////////////////////////////////////////////////////////////////////
' Does a _PrintString at the specified row+column.
' iRow and iCol are 1-based.
' See also: PrintString

Sub PrintString1 (iRow As Integer, iCol As Integer, MyString As String)
    Dim iX As Integer
    Dim iY As Integer
    iX = _FontWidth * (iCol - 1)
    iY = _FontHeight * (iRow - 1)
    _PrintString (iX, iY), MyString
End Sub ' PrintString1

' /////////////////////////////////////////////////////////////////////////////
' Eliminates the math.

' Text resolution:
'  648 x  480:  80 x 30
'  720 x  480:  90 x 30
'  800 x  600: 100 x 37
' 1024 x  768: 128 x 48
' 1280 x 1024: 160 x 64
' 1920 x 1080: 240 x 67
' 2048 x 1152: 256 x 72 (truncated after 70 rows, 255 columns)
' 3840 x 2160: 480 x135 (truncated after 133 rows, 479 columns)

Sub PrintStringCR1 (iCol As Integer, iRow As Integer, MyString As String)
    Dim iCols As Integer
    Dim iRows As Integer
    Dim iX As Integer
    Dim iY As Integer
    iCols = _Width(0) \ _FontWidth
    iRows = _Height(0) \ _FontHeight
    iX = _FontWidth * (iCol - 1)
    iY = _FontHeight * (iRow - 1)
    _PrintString (iX, iY), MyString
End Sub ' PrintStringCR1

' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
' END GRAPHIC PRINTING ROUTINES
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
' BEGIN COLOR FUNCTIONS
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Function cRed~& ()
    cRed = _RGB32(255, 0, 0)
End Function

Function cOrangeRed~& ()
    cOrangeRed = _RGB32(255, 69, 0)
End Function ' cOrangeRed~&

Function cDarkOrange~& ()
    cDarkOrange = _RGB32(255, 140, 0)
End Function ' cDarkOrange~&

Function cOrange~& ()
    cOrange = _RGB32(255, 165, 0)
End Function ' cOrange~&

Function cGold~& ()
    cGold = _RGB32(255, 215, 0)
End Function ' cGold~&

Function cYellow~& ()
    cYellow = _RGB32(255, 255, 0)
End Function ' cYellow~&

' LONG-HAIRED FRIENDS OF JESUS OR NOT,
' THIS IS NOT YELLOW ENOUGH (TOO CLOSE TO LIME)
' TO USE FOR OUR COMPLEX RAINBOW SEQUENCE:
Function cChartreuse~& ()
    cChartreuse = _RGB32(127, 255, 0)
End Function ' cChartreuse~&

' WE SUBSTITUTE THIS CSS3 COLOR FOR INBETWEEN LIME AND YELLOW:
Function cOliveDrab1~& ()
    cOliveDrab1 = _RGB32(192, 255, 62)
End Function ' cOliveDrab1~&

Function cLime~& ()
    cLime = _RGB32(0, 255, 0)
End Function ' cLime~&

Function cMediumSpringGreen~& ()
    cMediumSpringGreen = _RGB32(0, 250, 154)
End Function ' cMediumSpringGreen~&

' ADDED THIS FOR THE GAUGE COLOR:
Function cSpringGreen~& ()
    cSpringGreen = _RGB32(0, 255, 160)
End Function ' cSpringGreen~&

Function cCyan~& ()
    cCyan = _RGB32(0, 255, 255)
End Function ' cCyan~&

Function cDeepSkyBlue~& ()
    cDeepSkyBlue = _RGB32(0, 191, 255)
End Function ' cDeepSkyBlue~&

Function cDodgerBlue~& ()
    cDodgerBlue = _RGB32(30, 144, 255)
End Function ' cDodgerBlue~&

Function cSeaBlue~& ()
    cSeaBlue = _RGB32(0, 64, 255)
End Function ' cSeaBlue~&

Function cBlue~& ()
    cBlue = _RGB32(0, 0, 255)
End Function ' cBlue~&

Function cBluePurple~& ()
    cBluePurple = _RGB32(64, 0, 255)
End Function ' cBluePurple~&

Function cDeepPurple~& ()
    cDeepPurple = _RGB32(96, 0, 255)
End Function ' cDeepPurple~&

Function cPurple~& ()
    cPurple = _RGB32(128, 0, 255)
End Function ' cPurple~&

Function cPurpleRed~& ()
    cPurpleRed = _RGB32(128, 0, 192)
End Function ' cPurpleRed~&

Function cDarkRed~& ()
    cDarkRed = _RGB32(160, 0, 64)
End Function ' cDarkRed~&

Function cBrickRed~& ()
    cBrickRed = _RGB32(192, 0, 32)
End Function ' cBrickRed~&

Function cDarkGreen~& ()
    cDarkGreen = _RGB32(0, 100, 0)
End Function ' cDarkGreen~&

Function cGreen~& ()
    cGreen = _RGB32(0, 128, 0)
End Function ' cGreen~&

Function cOliveDrab~& ()
    cOliveDrab = _RGB32(107, 142, 35)
End Function ' cOliveDrab~&

Function cLightPink~& ()
    cLightPink = _RGB32(255, 182, 193)
End Function ' cLightPink~&

Function cHotPink~& ()
    cHotPink = _RGB32(255, 105, 180)
End Function ' cHotPink~&

Function cDeepPink~& ()
    cDeepPink = _RGB32(255, 20, 147)
End Function ' cDeepPink~&

Function cMagenta~& ()
    cMagenta = _RGB32(255, 0, 255)
End Function ' cMagenta~&

Function cBlack~& ()
    cBlack = _RGB32(0, 0, 0)
End Function ' cBlack~&

Function cDimGray~& ()
    cDimGray = _RGB32(105, 105, 105)
End Function ' cDimGray~&

Function cGray~& ()
    cGray = _RGB32(128, 128, 128)
End Function ' cGray~&

Function cDarkGray~& ()
    cDarkGray = _RGB32(169, 169, 169)
End Function ' cDarkGray~&

Function cSilver~& ()
    cSilver = _RGB32(192, 192, 192)
End Function ' cSilver~&

Function cLightGray~& ()
    cLightGray = _RGB32(211, 211, 211)
End Function ' cLightGray~&

Function cGainsboro~& ()
    cGainsboro = _RGB32(220, 220, 220)
End Function ' cGainsboro~&

Function cWhiteSmoke~& ()
    cWhiteSmoke = _RGB32(245, 245, 245)
End Function ' cWhiteSmoke~&

Function cWhite~& ()
    cWhite = _RGB32(255, 255, 255)
    'cWhite = _RGB32(254, 254, 254)
End Function ' cWhite~&

Function cDarkBrown~& ()
    cDarkBrown = _RGB32(128, 64, 0)
End Function ' cDarkBrown~&

Function cLightBrown~& ()
    cLightBrown = _RGB32(196, 96, 0)
End Function ' cLightBrown~&

Function cKhaki~& ()
    cKhaki = _RGB32(240, 230, 140)
End Function ' cKhaki~&

Function cEmpty~& ()
    'cEmpty~& = -1
    cEmpty = _RGB32(0, 0, 0, 0)
End Function ' cEmpty~&

' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
' END COLOR FUNCTIONS
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
' BEGIN FILE FUNCTIONS
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
'WORKS IN QB64PE BUT NOT QB64:
'' /////////////////////////////////////////////////////////////////////////////
'' QB64 Phoenix Edition › QB64 Rising › Code and Stuff › Help Me!
'' Using shell to delete a file
'' https://qb64phoenix.com/forum/showthread.php?tid=2618&pid=24683#pid24683
'' a740g
'' #5
'' 04-24-2024, 06:05 AM
''
'' There are no commands to directly make copies or backup of files.
'' But you could write one with a few lines of code like:
''
'' Copies src to dst
'' Set overwite to true if dst should be overwritten if present
'Sub CopyFile (src As String, dst As String, overwrite As _Byte)
'    If _FileExists(src) Then
'        If Not _FileExists(dst) Or (_FileExists(dst) And overwrite) Then
'            _WriteFile dst, _ReadFile$(src)
'        End If
'    End If
'End Sub ' CopyFile

' /////////////////////////////////////////////////////////////////////////////
' QB64 Phoenix Edition › QB64 Rising › Code and Stuff › Help Me!
' Using shell to delete a file
' https://qb64phoenix.com/forum/showthread.php?tid=2618

Sub DeleteFile (sFile As String)
    If _FileExists(sFile) Then
        'Shell "DELETE " + sFile
        'Shell "del " + sFile
        Kill sFile
    End If
End Sub ' DeleteFile

' /////////////////////////////////////////////////////////////////////////////

Function FileExt$ (sFile As String)
    Dim iPos As Integer
    iPos = _InStrRev(sFile, ".")
    If iPos > 0 Then
        If Len(sFile) > 1 Then
            If iPos > 1 Then
                FileExt$ = Right$(sFile, Len(sFile) - iPos)
            Else
                ' dot is first character, return everything after it
                FileExt$ = Right$(sFile, Len(sFile) - 1)
            End If
        Else
            ' file only has one character, the dot, the file extension is blank
            FileExt$ = ""
        End If
    Else
        ' no dot found, the file extension is blank
        FileExt$ = ""
    End If
End Function ' FileExt$

' /////////////////////////////////////////////////////////////////////////////

Function NameOnly$ (sFile As String, sSlash As String)
    Dim iPos As Integer
    'sFile = Replace$(sFile, "/", "\")

    iPos = _InStrRev(sFile, sSlash)
    If iPos > 0 Then
        If Len(sFile) > 1 Then
            If iPos > 1 Then
                NameOnly$ = Right$(sFile, Len(sFile) - iPos)
            Else
                ' slash is first character, return everything after it
                NameOnly$ = Right$(sFile, Len(sFile) - 1)
            End If
        Else
            ' file only has one character, the slash, name is blank
            NameOnly$ = ""
        End If
    Else
        ' slash not found, return the entire thing
        NameOnly$ = sFile
    End If
End Function ' NameOnly$

' /////////////////////////////////////////////////////////////////////////////

Function NoExt$ (sFile As String)
    Dim iPos As Integer
    iPos = _InStrRev(sFile, ".")
    If iPos > 0 Then
        If Len(sFile) > 1 Then
            If iPos > 1 Then
                NoExt$ = Left$(sFile, iPos - 1)
            Else
                ' dot is first character, removing it returns blank!
                ' our version will just return the name unchanged
                ' but you can return blank if you prefer
                NoExt$ = sFile
            End If
        Else
            ' file only has one character, the dot, removing it returns blank!
            ' our version will just return the name unchanged
            ' but you can return blank if you prefer
            NoExt$ = sFile
        End If
    Else
        ' no dot found
        ' return the name unchanged
        NoExt$ = sFile
    End If
End Function ' NoExt$

' /////////////////////////////////////////////////////////////////////////////

Function PathOnly$ (sFile As String, sSlash As String)
    Dim iPos As Integer
    'sFile = Replace$(sFile, "/", "\")

    iPos = _InStrRev(sFile, sSlash)
    If iPos > 0 Then
        If Len(sFile) > 1 Then
            If iPos > 1 Then
                PathOnly$ = Left$(sFile, iPos)
            Else
                ' slash is first character, so not much of a path, return blank
                PathOnly$ = ""
            End If
        Else
            ' file only has one character, the slash, name is blank
            PathOnly$ = ""
        End If
    Else
        ' slash not found, so not a path, return blank
        PathOnly$ = ""
    End If
End Function ' PathOnly$

' /////////////////////////////////////////////////////////////////////////////
' Writes sText to file sFileName.
' If bAppend=TRUE appends to file, else overwrites it.

' Returns blank if successful else returns error message.

' Example:
' ProgramPath$ = Left$(Command$(0), _InStrRev(Command$(0), "\"))
' ProgramName$: m_ProgramName$ = Mid$(Command$(0), _InStrRev(Command$(0), "\") + 1)
' sFileName = ProgramPath$ + ProgramName$ + ".OUT.txt"
' sText = "This is a test." + chr$(13) + "Here is line 2." + chr$(13) + "End."
' sError = PrintFile$(sFileName, sText, FALSE)

Function PrintFile$ (sFileName As String, sText As String, bAppend As Integer)
    Dim sError As String: sError = ""

    If (bAppend = TRUE) Then
        If _FileExists(sFileName) Then
            Open sFileName For Append As #1 ' opens an existing file for appending
        Else
            sError = "Error in PrintFile$ : File not found. Cannot append."
        End If
    Else
        Open sFileName For Output As #1 ' opens and clears an existing file or creates new empty file
    End If

    If Len(sError) = 0 Then
        ' NOTE: WRITE places text in quotes in the file
        'WRITE #1, x, y, z$
        'WRITE #1, sText

        ' PRINT does not put text inside quotes
        Print #1, sText

        Close #1
    End If

    PrintFile$ = sError
End Function ' PrintFile$

' /////////////////////////////////////////////////////////////////////////////
' Fastest way is always to just read the whole life at once and then parse it.

Function ReadTextFile$ (sFileName As String, sDefault As String)
    Dim x$
    If _FileExists(sFileName) Then
        Open sFileName For Binary As #1
        x$ = Space$(LOF(1))
        Get #1, 1, x$
        Close #1
        ReadTextFile$ = x$
    Else
        ReadTextFile$ = sDefault
    End If
End Function ' ReadTextFile$

' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
' END FILE FUNCTIONS
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
' BEGIN CONSTANT TO STRING FUNCTIONS
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

' /////////////////////////////////////////////////////////////////////////////

Function MouseDataPositionToString$ (MyInteger As Integer)
    Dim Mystring As String
    Select Case MyInteger
        Case cForPlayer:
            Mystring = "cForPlayer"
        Case cMouseDX:
            Mystring = "cMouseDX"
        Case cMouseDY:
            Mystring = "cMouseDY"
        Case cMousePosX:
            Mystring = "cMousePosX"
        Case cMousePosY:
            Mystring = "cMousePosY"
        Case cMouseWheel:
            Mystring = "cMouseWheel"
        Case cMouseLeftDown:
            Mystring = "cMouseLeftDown"
        Case cMouseMiddleDown:
            Mystring = "cMouseMiddleDown"
        Case cMouseRightDown:
            Mystring = "cMouseRightDown"
        Case Else:
            Mystring = _Trim$(Str$(MyInteger))
    End Select
    MouseDataPositionToString$ = Mystring
End Function ' MouseDataPositionToString$


' /////////////////////////////////////////////////////////////////////////////

Function VirtualKeyCodeToString$ (MyInteger As Integer)
    Dim Mystring As String

    Select Case MyInteger
        Case VK_LBUTTON:
            Mystring = "VK_LBUTTON"
        Case VK_RBUTTON:
            Mystring = "VK_RBUTTON"
        Case VK_CANCEL:
            Mystring = "VK_CANCEL"
        Case VK_MBUTTON:
            Mystring = "VK_MBUTTON"
        Case VK_XBUTTON1:
            Mystring = "VK_XBUTTON1"
        Case VK_XBUTTON2:
            Mystring = "VK_XBUTTON2"
        Case VK_BACK:
            Mystring = "VK_BACK"
        Case VK_TAB:
            Mystring = "VK_TAB"
        Case VK_CLEAR:
            Mystring = "VK_CLEAR"
        Case VK_RETURN:
            Mystring = "VK_RETURN"
        Case VK_SHIFT:
            Mystring = "VK_SHIFT"
        Case VK_CONTROL:
            Mystring = "VK_CONTROL"
        Case VK_MENU:
            Mystring = "VK_MENU"
        Case VK_PAUSE:
            Mystring = "VK_PAUSE"
        Case VK_CAPITAL:
            Mystring = "VK_CAPITAL"
        Case VK_KANA:
            Mystring = "VK_KANA"
        Case VK_HANGUL:
            Mystring = "VK_HANGUL"
        Case VK_IME_ON:
            Mystring = "VK_IME_ON"
        Case VK_JUNJA:
            Mystring = "VK_JUNJA"
        Case VK_FINAL:
            Mystring = "VK_FINAL"
        Case VK_HANJA:
            Mystring = "VK_HANJA"
        Case VK_KANJI:
            Mystring = "VK_KANJI"
        Case VK_IME_OFF:
            Mystring = "VK_IME_OFF"
        Case VK_ESCAPE:
            Mystring = "VK_ESCAPE"
        Case VK_CONVERT:
            Mystring = "VK_CONVERT"
        Case VK_NONCONVERT:
            Mystring = "VK_NONCONVERT"
        Case VK_ACCEPT:
            Mystring = "VK_ACCEPT"
        Case VK_MODECHANGE:
            Mystring = "VK_MODECHANGE"
        Case VK_SPACE:
            Mystring = "VK_SPACE"
        Case VK_PRIOR:
            Mystring = "VK_PRIOR"
        Case VK_NEXT:
            Mystring = "VK_NEXT"
        Case VK_END:
            Mystring = "VK_END"
        Case VK_HOME:
            Mystring = "VK_HOME"
        Case VK_LEFT:
            Mystring = "VK_LEFT"
        Case VK_UP:
            Mystring = "VK_UP"
        Case VK_RIGHT:
            Mystring = "VK_RIGHT"
        Case VK_DOWN:
            Mystring = "VK_DOWN"
        Case VK_SELECT:
            Mystring = "VK_SELECT"
        Case VK_PRINT:
            Mystring = "VK_PRINT"
        Case VK_EXECUTE:
            Mystring = "VK_EXECUTE"
        Case VK_SNAPSHOT:
            Mystring = "VK_SNAPSHOT"
        Case VK_INSERT:
            Mystring = "VK_INSERT"
        Case VK_DELETE:
            Mystring = "VK_DELETE"
        Case VK_HELP:
            Mystring = "VK_HELP"
        Case VK_0:
            Mystring = "VK_0"
        Case VK_1:
            Mystring = "VK_1"
        Case VK_2:
            Mystring = "VK_2"
        Case VK_3:
            Mystring = "VK_3"
        Case VK_4:
            Mystring = "VK_4"
        Case VK_5:
            Mystring = "VK_5"
        Case VK_6:
            Mystring = "VK_6"
        Case VK_7:
            Mystring = "VK_7"
        Case VK_8:
            Mystring = "VK_8"
        Case VK_9:
            Mystring = "VK_9"
        Case VK_A:
            Mystring = "VK_A"
        Case VK_B:
            Mystring = "VK_B"
        Case VK_C:
            Mystring = "VK_C"
        Case VK_D:
            Mystring = "VK_D"
        Case VK_E:
            Mystring = "VK_E"
        Case VK_F:
            Mystring = "VK_F"
        Case VK_G:
            Mystring = "VK_G"
        Case VK_H:
            Mystring = "VK_H"
        Case VK_I:
            Mystring = "VK_I"
        Case VK_J:
            Mystring = "VK_J"
        Case VK_K:
            Mystring = "VK_K"
        Case VK_L:
            Mystring = "VK_L"
        Case VK_M:
            Mystring = "VK_M"
        Case VK_N:
            Mystring = "VK_N"
        Case VK_O:
            Mystring = "VK_O"
        Case VK_P:
            Mystring = "VK_P"
        Case VK_Q:
            Mystring = "VK_Q"
        Case VK_R:
            Mystring = "VK_R"
        Case VK_S:
            Mystring = "VK_S"
        Case VK_T:
            Mystring = "VK_T"
        Case VK_U:
            Mystring = "VK_U"
        Case VK_V:
            Mystring = "VK_V"
        Case VK_W:
            Mystring = "VK_W"
        Case VK_X:
            Mystring = "VK_X"
        Case VK_Y:
            Mystring = "VK_Y"
        Case VK_Z:
            Mystring = "VK_Z"
        Case VK_LWIN:
            Mystring = "VK_LWIN"
        Case VK_RWIN:
            Mystring = "VK_RWIN"
        Case VK_APPS:
            Mystring = "VK_APPS"
        Case VK_SLEEP:
            Mystring = "VK_SLEEP"
        Case VK_NUMPAD0:
            Mystring = "VK_NUMPAD0"
        Case VK_NUMPAD1:
            Mystring = "VK_NUMPAD1"
        Case VK_NUMPAD2:
            Mystring = "VK_NUMPAD2"
        Case VK_NUMPAD3:
            Mystring = "VK_NUMPAD3"
        Case VK_NUMPAD4:
            Mystring = "VK_NUMPAD4"
        Case VK_NUMPAD5:
            Mystring = "VK_NUMPAD5"
        Case VK_NUMPAD6:
            Mystring = "VK_NUMPAD6"
        Case VK_NUMPAD7:
            Mystring = "VK_NUMPAD7"
        Case VK_NUMPAD8:
            Mystring = "VK_NUMPAD8"
        Case VK_NUMPAD9:
            Mystring = "VK_NUMPAD9"
        Case VK_MULTIPLY:
            Mystring = "VK_MULTIPLY"
        Case VK_ADD:
            Mystring = "VK_ADD"
        Case VK_SEPARATOR:
            Mystring = "VK_SEPARATOR"
        Case VK_SUBTRACT:
            Mystring = "VK_SUBTRACT"
        Case VK_DECIMAL:
            Mystring = "VK_DECIMAL"
        Case VK_DIVIDE:
            Mystring = "VK_DIVIDE"
        Case VK_F1:
            Mystring = "VK_F1"
        Case VK_F2:
            Mystring = "VK_F2"
        Case VK_F3:
            Mystring = "VK_F3"
        Case VK_F4:
            Mystring = "VK_F4"
        Case VK_F5:
            Mystring = "VK_F5"
        Case VK_F6:
            Mystring = "VK_F6"
        Case VK_F7:
            Mystring = "VK_F7"
        Case VK_F8:
            Mystring = "VK_F8"
        Case VK_F9:
            Mystring = "VK_F9"
        Case VK_F10:
            Mystring = "VK_F10"
        Case VK_F11:
            Mystring = "VK_F11"
        Case VK_F12:
            Mystring = "VK_F12"
        Case VK_F13:
            Mystring = "VK_F13"
        Case VK_F14:
            Mystring = "VK_F14"
        Case VK_F15:
            Mystring = "VK_F15"
        Case VK_F16:
            Mystring = "VK_F16"
        Case VK_F17:
            Mystring = "VK_F17"
        Case VK_F18:
            Mystring = "VK_F18"
        Case VK_F19:
            Mystring = "VK_F19"
        Case VK_F20:
            Mystring = "VK_F20"
        Case VK_F21:
            Mystring = "VK_F21"
        Case VK_F22:
            Mystring = "VK_F22"
        Case VK_F23:
            Mystring = "VK_F23"
        Case VK_F24:
            Mystring = "VK_F24"
        Case VK_NUMLOCK:
            Mystring = "VK_NUMLOCK"
        Case VK_SCROLL:
            Mystring = "VK_SCROLL"
        Case VK_LSHIFT:
            Mystring = "VK_LSHIFT"
        Case VK_RSHIFT:
            Mystring = "VK_RSHIFT"
        Case VK_LCONTROL:
            Mystring = "VK_LCONTROL"
        Case VK_RCONTROL:
            Mystring = "VK_RCONTROL"
        Case VK_LMENU:
            Mystring = "VK_LMENU"
        Case VK_RMENU:
            Mystring = "VK_RMENU"
        Case VK_BROWSER_BACK:
            Mystring = "VK_BROWSER_BACK"
        Case VK_BROWSER_FORWARD:
            Mystring = "VK_BROWSER_FORWARD"
        Case VK_BROWSER_REFRESH:
            Mystring = "VK_BROWSER_REFRESH"
        Case VK_BROWSER_STOP:
            Mystring = "VK_BROWSER_STOP"
        Case VK_BROWSER_SEARCH:
            Mystring = "VK_BROWSER_SEARCH"
        Case VK_BROWSER_FAVORITES:
            Mystring = "VK_BROWSER_FAVORITES"
        Case VK_BROWSER_HOME:
            Mystring = "VK_BROWSER_HOME"
        Case VK_VOLUME_MUTE:
            Mystring = "VK_VOLUME_MUTE"
        Case VK_VOLUME_DOWN:
            Mystring = "VK_VOLUME_DOWN"
        Case VK_VOLUME_UP:
            Mystring = "VK_VOLUME_UP"
        Case VK_MEDIA_NEXT_TRACK:
            Mystring = "VK_MEDIA_NEXT_TRACK"
        Case VK_MEDIA_PREV_TRACK:
            Mystring = "VK_MEDIA_PREV_TRACK"
        Case VK_MEDIA_STOP:
            Mystring = "VK_MEDIA_STOP"
        Case VK_MEDIA_PLAY_PAUSE:
            Mystring = "VK_MEDIA_PLAY_PAUSE"
        Case VK_LAUNCH_MAIL:
            Mystring = "VK_LAUNCH_MAIL"
        Case VK_LAUNCH_MEDIA_SELECT:
            Mystring = "VK_LAUNCH_MEDIA_SELECT"
        Case VK_LAUNCH_APP1:
            Mystring = "VK_LAUNCH_APP1"
        Case VK_LAUNCH_APP2:
            Mystring = "VK_LAUNCH_APP2"
        Case VK_OEM_1:
            Mystring = "VK_OEM_1"
        Case VK_OEM_PLUS:
            Mystring = "VK_OEM_PLUS"
        Case VK_OEM_COMMA:
            Mystring = "VK_OEM_COMMA"
        Case VK_OEM_MINUS:
            Mystring = "VK_OEM_MINUS"
        Case VK_OEM_PERIOD:
            Mystring = "VK_OEM_PERIOD"
        Case VK_OEM_2:
            Mystring = "VK_OEM_2"
        Case VK_OEM_3:
            Mystring = "VK_OEM_3"
        Case VK_OEM_4:
            Mystring = "VK_OEM_4"
        Case VK_OEM_5:
            Mystring = "VK_OEM_5"
        Case VK_OEM_6:
            Mystring = "VK_OEM_6"
        Case VK_OEM_7:
            Mystring = "VK_OEM_7"
        Case VK_OEM_8:
            Mystring = "VK_OEM_8"
        Case VK_OEM_102:
            Mystring = "VK_OEM_102"
        Case VK_PROCESSKEY:
            Mystring = "VK_PROCESSKEY"
        Case VK_PACKET:
            Mystring = "VK_PACKET"
        Case VK_ATTN:
            Mystring = "VK_ATTN"
        Case VK_CRSEL:
            Mystring = "VK_CRSEL"
        Case VK_EXSEL:
            Mystring = "VK_EXSEL"
        Case VK_EREOF:
            Mystring = "VK_EREOF"
        Case VK_PLAY:
            Mystring = "VK_PLAY"
        Case VK_ZOOM:
            Mystring = "VK_ZOOM"
        Case VK_NONAME:
            Mystring = "VK_NONAME"
        Case VK_PA1:
            Mystring = "VK_PA1"
        Case VK_OEM_CLEAR:
            Mystring = "VK_OEM_CLEAR"
        Case Else:
            Mystring = _Trim$(Str$(MyInteger))
    End Select
    VirtualKeyCodeToString$ = Mystring
End Function ' VirtualKeyCodeToString$

' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
' END CONSTANT TO STRING FUNCTIONS
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
' BEGIN DRAWING ROUTINES
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

' /////////////////////////////////////////////////////////////////////////////
' DRAW A 2-D BOX (SOLID)
' https://www.qb64.org/wiki/LINE

' Renamed DrawBox/DrawBoxLine to DrawSolidBox

Sub DrawBoxSolid (iX As Integer, iY As Integer, iSize As Integer, fgColor As _Unsigned Long)
    Line (iX, iY)-(iX + iSize, iY + iSize), fgColor, BF ' Draw a solid box
End Sub ' DrawBoxSolid

' /////////////////////////////////////////////////////////////////////////////
' DRAW A 2-D RECTANGLE (SOLID)

Sub DrawRectSolid (iX As Integer, iY As Integer, iSizeW As Integer, iSizeH As Integer, fgColor As _Unsigned Long)
    Line (iX, iY)-(iX + iSizeW, iY + iSizeH), fgColor, BF ' Draw a solid rectangle
End Sub ' DrawRectSolid

' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
' END DRAWING ROUTINES
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
' BEGIN GENERAL PURPOSE ROUTINES #GENERAL
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

' /////////////////////////////////////////////////////////////////////////////

Function AppendString$ (MyString As String, NewString As String, MyDelimiter As String)
    Dim sResult As String: sResult = MyString
    If Len(MyString) > 0 Then
        sResult = sResult + MyDelimiter
    End If
    sResult = sResult + NewString
    AppendString$ = sResult
End Function ' AppendString$

' /////////////////////////////////////////////////////////////////////////////

Sub AppendToStringArray (MyStringArray$(), MyString$)
    ReDim _Preserve MyStringArray$(LBound(MyStringArray$) To UBound(MyStringArray$) + 1)
    MyStringArray$(UBound(MyStringArray$)) = MyString$
End Sub ' AppendToStringArray

' /////////////////////////////////////////////////////////////////////////////
' See also StringTo2dArray

Function Array2dToString$ (MyArray() As String)
    Dim MyString As String
    Dim iY As Integer
    Dim iX As Integer
    Dim sLine As String
    MyString = ""
    For iY = LBound(MyArray, 1) To UBound(MyArray, 1)
        sLine = ""
        For iX = LBound(MyArray, 2) To UBound(MyArray, 2)
            sLine = sLine + MyArray(iY, iX)
        Next iX
        MyString = MyString + sLine + Chr$(13)
    Next iY
    Array2dToString$ = MyString
End Function ' Array2dToString$

' /////////////////////////////////////////////////////////////////////////////

'Function Array2dToStringTest$ (MyArray() As String)
'    Dim MyString As String
'    Dim iY As Integer
'    Dim iX As Integer
'    Dim sLine As String
'    MyString = ""
'    MyString = MyString + "           11111111112222222222333" + Chr$(13)
'    MyString = MyString + "  12345678901234567890123456789012" + Chr$(13)
'    For iY = LBound(MyArray, 1) To UBound(MyArray, 1)
'        sLine = ""
'        sLine = sLine + Right$("  " + cstr$(iY), 2)
'        For iX = LBound(MyArray, 2) To UBound(MyArray, 2)
'            sLine = sLine + MyArray(iY, iX)
'        Next iX
'        sLine = sLine + Right$("  " + cstr$(iY), 2)
'        MyString = MyString + sLine + Chr$(13)
'    Next iY
'    MyString = MyString + "  12345678901234567890123456789012" + Chr$(13)
'    MyString = MyString + "           11111111112222222222333" + Chr$(13)
'    Array2dToStringTest$ = MyString
'End Function ' Array2dToStringTest$

' /////////////////////////////////////////////////////////////////////////////
' use angles in degrees units instead of radians (converted inside sub)
' Note this function uses whatever the default type is, better not be some Integer Type.

Function CosD (degrees)
    CosD = Cos(_D2R(degrees))
End Function ' CosD

' /////////////////////////////////////////////////////////////////////////////
' Integer to string

Function cstr$ (myValue)
    'cstr$ = LTRIM$(RTRIM$(STR$(myValue)))
    cstr$ = _Trim$(Str$(myValue))
End Function ' cstr$

' /////////////////////////////////////////////////////////////////////////////
' Long to string

Function cstrl$ (myValue As Long)
    cstrl$ = _Trim$(Str$(myValue))
End Function ' cstrl$

' /////////////////////////////////////////////////////////////////////////////
' Single to string

Function cstrs$ (myValue As Single)
    ''cstr$ = LTRIM$(RTRIM$(STR$(myValue)))
    cstrs$ = _Trim$(Str$(myValue))
End Function ' cstrs$

' /////////////////////////////////////////////////////////////////////////////
' Unsigned Long to string

Function cstrul$ (myValue As _Unsigned Long)
    cstrul$ = _Trim$(Str$(myValue))
End Function ' cstrul$

' /////////////////////////////////////////////////////////////////////////////
' Simple timestamp function

Function CurrentDateTime$
    CurrentDateTime$ = Mid$(Date$, 7, 4) + "-" + _
        Mid$(Date$, 1, 5) + " " + _
        Time$
End Function ' CurrentDateTime$

' /////////////////////////////////////////////////////////////////////////////
' use angles in degrees units instead of radians (converted inside sub)
' Note this function uses whatever the default type is, better not be some Integer Type.

Function DAtan2 (x1, y1, x2, y2) ' The angle in degrees a 2nd point (x2, y2)  makes to a first point (x1, y1)
    Dim deltaX As Integer
    Dim deltaY As Integer
    Dim rtn As Integer

    ' Delta means change between 1 measure and another for example x2 - x1
    deltaX = x2 - x1
    deltaY = y2 - y1

    ' To find the angle point(x2, y2) makes to (x1, y1) in Degrees
    ' Take DegreeAngle = DAtan2(y2 - y1, x2 - x1)
    rtn = _R2D(_Atan2(deltaY, deltaX))
    If rtn < 0 Then
        DAtan2 = rtn + 360
    Else
        DAtan2 = rtn
    End If
End Function ' DAtan2

' /////////////////////////////////////////////////////////////////////////////
' Hack function, to be replaced with something better

Function DblToInt% (dblOld As Double)
    Dim dblNew As Double
    Dim sValue As String
    Dim iPos As Integer
    dblNew = RoundDouble#(dblOld, 0)
    sValue = DblToStr$(dblNew)
    DblToInt% = Val(sValue)
End Function ' DblToInt%

' /////////////////////////////////////////////////////////////////////////////
' Scientific notation - QB64 Wiki
' https://www.qb64.org/wiki/Scientific_notation

' Example: A string function that displays extremely small or large exponential decimal values.

Function DblToStr$ (n#)
    Dim result$: result$ = ""
    Dim value$
    Dim Xpos%
    Dim expo%
    Dim sign$
    Dim valu$
    Dim dot%
    Dim L%
    Dim add$
    Dim min$
    Dim DP$
    Dim n%
    Dim num$: num$ = ""

    value$ = UCase$(LTrim$(Str$(n#)))
    Xpos% = InStr(value$, "D") + InStr(value$, "E") ' only D or E can be present
    If Xpos% Then
        expo% = Val(Mid$(value$, Xpos% + 1))
        If Val(value$) < 0 Then
            sign$ = "-"
            valu$ = Mid$(value$, 2, Xpos% - 2)
        Else
            valu$ = Mid$(value$, 1, Xpos% - 1)
        End If
        dot% = InStr(valu$, ".")
        L% = Len(valu$)
        If expo% > 0 Then
            add$ = String$(expo% - (L% - dot%), "0")
        End If
        If expo% < 0 Then
            min$ = String$(Abs(expo%) - (dot% - 1), "0")
            DP$ = "."
        End If
        For n% = 1 To L%
            If Mid$(valu$, n%, 1) <> "." Then
                num$ = num$ + Mid$(valu$, n%, 1)
            End If
        Next n%
        result$ = _Trim$(sign$ + DP$ + min$ + num$ + add$)
    Else
        result$ = value$
    End If

    DblToStr$ = result$
End Function ' DblToStr$

' /////////////////////////////////////////////////////////////////////////////

Function DblRoundedToStr$ (dblValue As Double, intNumPlaces As Integer)
    Dim dblNew As Double
    dblNew = RoundDouble#(dblValue, intNumPlaces)
    DblRoundedToStr$ = DblToStr$(dblNew)
End Function ' DblRoundedToStr$

' /////////////////////////////////////////////////////////////////////////////
' Receives an {sDelim} delimited list {sInput}
' returns the list with all duplicate entries removed.

Function DedupeDelimList$ (sInput As String, sDelim As String)
    ReDim arrLines(-1) As String
    Dim sOutput As String
    Dim iLoop As Integer

    split sInput, sDelim, arrLines()
    sOutput = sDelim
    For iLoop = LBound(arrLines) To UBound(arrLines)
        If InStr(1, sOutput, sDelim + arrLines(iLoop) + sDelim) = 0 Then
            sOutput = sOutput + arrLines(iLoop) + sDelim
        End If
    Next iLoop

    DedupeDelimList$ = sOutput
End Function ' DedupeDelimList$

' /////////////////////////////////////////////////////////////////////////////

Function DoubleABS# (dblValue As Double)
    If Sgn(dblValue) = -1 Then
        DoubleABS# = 0 - dblValue
    Else
        DoubleABS# = dblValue
    End If
End Function ' DoubleABS#

' /////////////////////////////////////////////////////////////////////////////
' bplus: The Gold Standard is even better than THE QB64 CIRCLE sub in this respect!
' https://forum.qb64.org/index.php?topic=1044.135

' from Steve Gold standard
' Renamed fcirc to DrawCircleSolid

' Not as fast as DrawCircleTopLeft but pretty fast.

' Example:
' Screen _NewImage(800, 600, 32)
' _ScreenMove 250, 60
' For r = 250 To 0 Step -60
'     DrawCircleSolid 400, 300, r, _RGBA(255, 255, 255, 100)
' Next r

Sub DrawCircleSolid (CX As Integer, CY As Integer, R As Integer, C As _Unsigned Long)
    Dim Radius As Integer, RadiusError As Integer
    Dim X As Integer, Y As Integer

    Radius = Abs(R)
    RadiusError = -Radius
    X = Radius
    Y = 0

    If Radius = 0 Then PSet (CX, CY), C: Exit Sub

    ' Draw the middle span here so we don't draw it twice in the main loop,
    ' which would be a problem with blending turned on.
    Line (CX - X, CY)-(CX + X, CY), C, BF

    While X > Y
        RadiusError = RadiusError + Y * 2 + 1
        If RadiusError >= 0 Then
            If X <> Y + 1 Then
                Line (CX - Y, CY - X)-(CX + Y, CY - X), C, BF
                Line (CX - Y, CY + X)-(CX + Y, CY + X), C, BF
            End If
            X = X - 1
            RadiusError = RadiusError - X * 2
        End If
        Y = Y + 1
        Line (CX - X, CY - Y)-(CX + X, CY - Y), C, BF
        Line (CX - X, CY + Y)-(CX + X, CY + Y), C, BF
    Wend
End Sub ' DrawCircleSolid

' /////////////////////////////////////////////////////////////////////////////
' Draws scaled + rotated text to screen
' by BPlus

' Scale rotate font text strings by B+
' https://qb64phoenix.com/forum/showthread.php?tid=414&highlight=rotate+text

' INPUT:
' S$ is the string to display
' c is the color (will have a transparent background)
' midX and midY is the center of where you want to display the string
' xScale would multiply 8 pixel width of default font
' yScale would multiply the 16 pixel height of the default font
' Rotation is in Radian units, use _D2R to convert Degree units to Radian units

' DEPENDENCIES:
' drwString needs sub RotoZoom2, intended for graphics screens using the default font.

Sub drwString (S$, c As _Unsigned Long, midX, midY, xScale, yScale, Rotation As Single)
    Dim I&
    Dim storeDest&

    I& = _NewImage(_PrintWidth(S$), _FontHeight, 32)
    _Dest I&
    Color c, _RGBA32(0, 0, 0, 0)
    _PrintString (0, 0), S$
    _Dest storeDest&
    RotoZoom2 midX, midY, I&, xScale, yScale, Rotation
    _FreeImage I&
End Sub ' drwString

' /////////////////////////////////////////////////////////////////////////////
' based on code from:
' Qbasic Programs - Download free bas source code
' http://www.thedubber.altervista.org/qbsrc.htm

Sub DrawTextLine (y%, x%, y2%, x2%, c$)
    Dim i%
    Dim steep%
    Dim e%
    Dim sx%
    Dim sy%
    Dim dx%
    Dim dy%

    'bError% = FALSE
    'LOCATE 2, 2: PRINT "(" + STR$(x%) + "," + STR$(y%) + ") to (" + STR$(x2%) + "," + STR$(y2%) + ") of " + CHR$(34) + c$ + CHR$(34);

    i% = 0: steep% = 0: e% = 0
    If (x2% - x%) > 0 Then sx% = 1: Else sx% = -1
    dx% = Abs(x2% - x%)
    If (y2% - y%) > 0 Then sy% = 1: Else sy% = -1
    dy% = Abs(y2% - y%)
    If (dy% > dx%) Then
        steep% = 1
        Swap x%, y%
        Swap dx%, dy%
        Swap sx%, sy%
    End If
    e% = 2 * dy% - dx%
    For i% = 0 To dx% - 1
        If steep% = 1 Then
            'PSET (y%, x%), c%:
            Locate y%, x%
            Print c$;
        Else
            'PSET (x%, y%), c%
            Locate x%, y%
            Print c$;
        End If

        While e% >= 0
            y% = y% + sy%: e% = e% - 2 * dx%
        Wend
        x% = x% + sx%: e% = e% + 2 * dy%
    Next
    'PSET (x2%, y2%), c%
    Locate x2%, y2%
    Print c$;

End Sub ' DrawTextLine

' /////////////////////////////////////////////////////////////////////////////

Sub DumpScreenAndFontSize ()
    Dim iCols As Integer
    Dim iRows As Integer
    'Screen _NewImage(1024, 768, 32): _ScreenMove 0, 0
    iCols = _Width(0) \ _FontWidth
    iRows = _Height(0) \ _FontHeight
    Print "_Width(0)  =" + _Trim$(Str$(_Width(0)))
    Print "_Height(0) =" + _Trim$(Str$(_Height(0)))
    Print "_FontWidth =" + _Trim$(Str$(_FontWidth))
    Print "_FontHeight=" + _Trim$(Str$(_FontHeight))
    Print "iCols = _Width(0)  \ _FontWidth  = " + _Trim$(Str$(iCols))
    Print "iRows = _Height(0) \ _FontHeight = " + _Trim$(Str$(iRows))
End Sub ' DumpScreenAndFontSize

' /////////////////////////////////////////////////////////////////////////////
' Use with timer functions to avoid "after midnight" bug.

' SMcNeill
' More efficient version of ExtendedTimer.
' This stores our day values and only updates them when necessary.
' We really don't need to figure out how many seconds are in today over and over endlessly
' -- just count them once, and when the clock swaps back to 0:0:0, add 24*60*60 seconds to the count.

' Re: how to time something (ie do loop for n seconds)
' https://forum.qb64.org/index.php?topic=4682.0

' SMcNeill, QB64 Developer
' Reply #1 on: Today at 11:26:52 am
'
' One caveat here:  You *can* experience bugs with this after midnight.
'
' Program starts at 23:59:59.
' Add three seconds -- 24:00:02...  (In seconds, and not hours and minutes like this, though hours and minutes are easier to visualize.)
' Clock hits midnight:  0:00:00
'
' At no point will you ever have TIMER become greater than t#.
'
' If you're going to have a program which might run into this issue,
' I'd suggest just plugging in my ExtendedTimer and use it instead:
'
' Most of us write time code to test little snippets for which method might
' be faster for us while we're coding.  The clock resetting on us isn't
' normally such a big deal.  When it is, however, all you have to do is
' swap to the ExtendedTimer function [below]
'
' Returns a value for you based off DAY + TIME, rather than just time alone!
' No midnight clock issues with something like that in our programs.  ;)

' Example using regular Timer:
'    t# = Timer + 3
'    Do
'         '(SOMETHING)
'    Loop Until Timer > t#

' Usage:
'     ' DO SOMETHING FOR 3 SECONDS
'     t# = ExtendedTimer1 + 3
'     Do
'         '(SOMETHING)
'     Loop Until Timer > t#

$If EXTENDEDTIMER = UNDEFINED Then
    $Let EXTENDEDTIMER = TRUE

    Function ExtendedTimer##
        'modified extendedtimer to store the old day's count, and not have to recalculate it every time the routine is called.

        Static olds As _Float, old_day As _Float, oldt As _Float
        Dim m As Integer, d As Integer, y As Integer
        Dim s As _Float, day As String
        If olds = 0 Then 'calculate the day the first time the extended timer runs
            day = Date$
            m = Val(Left$(day, 2))
            d = Val(Mid$(day, 4, 2))
            y = Val(Right$(day, 4)) - 1970
            Select Case m 'Add the number of days for each previous month passed
                Case 2: d = d + 31
                Case 3: d = d + 59
                Case 4: d = d + 90
                Case 5: d = d + 120
                Case 6: d = d + 151
                Case 7: d = d + 181
                Case 8: d = d + 212
                Case 9: d = d + 243
                Case 10: d = d + 273
                Case 11: d = d + 304
                Case 12: d = d + 334
            End Select
            If (y Mod 4) = 2 And m > 2 Then d = d + 1 'add a day if this is leap year and we're past february
            d = (d - 1) + 365 * y 'current month days passed + 365 days per each standard year
            d = d + (y + 2) \ 4 'add in days for leap years passed
            s = d * 24 * 60 * 60 'Seconds are days * 24 hours * 60 minutes * 60 seconds
            old_day = s
        End If
        If Timer < oldt Then 'we went from 23:59:59 (a second before midnight) to 0:0:0 (midnight)
            old_day = s + 83400 'add another worth of seconds to our counter
        End If
        oldt = Timer
        olds = old_day + oldt
        ExtendedTimer## = olds
    End Function ' ExtendedTimer##
$End If

' /////////////////////////////////////////////////////////////////////////////
' Fill a 2D integer array with a specified value

Sub FillIntegerArray2D (MyArray() As Integer, MyValue As Integer)
    Dim iLoop1 As Integer
    Dim iLoop2 As Integer
    For iLoop1 = 1 To UBound(MyArray, 1)
        For iLoop2 = 1 To UBound(MyArray, 2)
            'Print "iLoop1=" + cstr$(iLoop1) + ", iLoop2=" + cstr$(iLoop2)
            MyArray(iLoop1, iLoop2) = MyValue
        Next iLoop2
    Next iLoop1
End Sub ' FillIntegerArray2D

' /////////////////////////////////////////////////////////////////////////////
' Fill a 2D long array with a specified value

Sub FillLongArray2D (MyArray() As Long, MyValue As Long)
    Dim iLoop1 As Integer
    Dim iLoop2 As Integer
    For iLoop1 = 1 To UBound(MyArray, 1)
        For iLoop2 = 1 To UBound(MyArray, 2)
            'Print "iLoop1=" + cstr$(iLoop1) + ", iLoop2=" + cstr$(iLoop2)
            MyArray(iLoop1, iLoop2) = MyValue
        Next iLoop2
    Next iLoop1
End Sub ' FillLongArray2D

' /////////////////////////////////////////////////////////////////////////////

Function FloatRoundedToStr$ (fValue As _Float, intNumPlaces As Integer)
    Dim fNew As _Float
    fNew = RoundNatural##(fValue, intNumPlaces)
    FloatRoundedToStr$ = FloatToStr$(fNew)
End Function ' DblRoundedToStr$

' /////////////////////////////////////////////////////////////////////////////
' Scientific notation - QB64 Wiki
' https://www.qb64.org/wiki/Scientific_notation

' Example: A string function that displays extremely small or large exponential decimal values.

Function FloatToStr$ (n##)
    Dim value$
    Dim Xpos%
    Dim expo%
    Dim sign$
    Dim valu$
    Dim dot%
    Dim L%
    Dim add$
    Dim min$
    Dim DP$
    Dim n As Integer
    Dim num$: num$ = ""

    value$ = UCase$(LTrim$(Str$(n##)))
    Xpos% = InStr(value$, "D") + InStr(value$, "E") 'only D or E can be present
    If Xpos% Then
        expo% = Val(Mid$(value$, Xpos% + 1))
        If Val(value$) < 0 Then
            sign$ = "-"
            valu$ = Mid$(value$, 2, Xpos% - 2)
        Else
            valu$ = Mid$(value$, 1, Xpos% - 1)
        End If
        dot% = InStr(valu$, ".")
        L% = Len(valu$)
        If expo% > 0 Then
            add$ = String$(expo% - (L% - dot%), "0")
        End If
        If expo% < 0 Then
            min$ = String$(Abs(expo%) - (dot% - 1), "0")
            DP$ = "."
        End If
        For n = 1 To L%
            If Mid$(valu$, n, 1) <> "." Then
                num$ = num$ + Mid$(valu$, n, 1)
            End If
        Next n
    Else
        FloatToStr$ = value$
        Exit Function
    End If
    FloatToStr$ = _Trim$(sign$ + DP$ + min$ + num$ + add$)
End Function ' FloatToStr$

' /////////////////////////////////////////////////////////////////////////////
' TODO: find the newer formatting function?

Function FormatNumber$ (myValue, iDigits As Integer)
    Dim strValue As String
    strValue = DblToStr$(myValue) + String$(iDigits, " ")
    If myValue < 1 Then
        If myValue < 0 Then
            strValue = Replace$(strValue, "-.", "-0.")
        ElseIf myValue > 0 Then
            strValue = "0" + strValue
        End If
    End If
    FormatNumber$ = Left$(strValue, iDigits)
End Function ' FormatNumber$

' /////////////////////////////////////////////////////////////////////////////
' From: Bitwise Manipulations By Steven Roman
' http://www.romanpress.com/Articles/Bitwise_R/Bitwise.htm

' Returns the 8-bit binary representation
' of an integer iInput where 0 <= iInput <= 255

Function GetBinary$ (iInput1 As Integer)
    Dim sResult As String
    Dim iLoop As Integer
    Dim iInput As Integer: iInput = iInput1

    sResult = ""

    If iInput >= 0 And iInput <= 255 Then
        For iLoop = 1 To 8
            sResult = LTrim$(RTrim$(Str$(iInput Mod 2))) + sResult
            iInput = iInput \ 2
            'If iLoop = 4 Then sResult = " " + sResult
        Next iLoop
    End If

    GetBinary$ = sResult
End Function ' GetBinary$

' /////////////////////////////////////////////////////////////////////////////
' wonderfully inefficient way to read if a bit is set
' ival = GetBit256%(int we are comparing, int containing the bits we want to read)

' See also: GetBit256%, SetBit256%

Function GetBit256% (iNum1 As Integer, iBit1 As Integer)
    Dim iResult As Integer
    Dim sNum As String
    Dim sBit As String
    Dim iLoop As Integer
    Dim bContinue As Integer
    'DIM iTemp AS INTEGER
    Dim iNum As Integer: iNum = iNum1
    Dim iBit As Integer: iBit = iBit1

    iResult = FALSE
    bContinue = TRUE

    If iNum < 256 And iBit <= 128 Then
        sNum = GetBinary$(iNum)
        sBit = GetBinary$(iBit)
        For iLoop = 1 To 8
            If Mid$(sBit, iLoop, 1) = "1" Then
                'if any of the bits in iBit are false, return false
                If Mid$(sNum, iLoop, 1) = "0" Then
                    iResult = FALSE
                    bContinue = FALSE
                    Exit For
                End If
            End If
        Next iLoop
        If bContinue = TRUE Then
            iResult = TRUE
        End If
    End If

    GetBit256% = iResult
End Function ' GetBit256%

' /////////////////////////////////////////////////////////////////////////////
' Returns the text character at positon x%, y%

' Does the same as:
'   Locate y%, x%
'   GetCharXY% = Screen(CsrLin, Pos(0))

' See also: GetColorXY&

Function GetCharXY% (x%, y%)
    GetCharXY% = Screen(y%, x%, 0) ' when 3rd parameter = 0 returns character code
End Function ' GetCharXY%

' /////////////////////////////////////////////////////////////////////////////
' Returns the text color at positon x%, y%

' See also: GetCharXY%

Function GetColorXY& (x%, y%)
    GetColorXY& = Screen(y%, x%, 1) ' when 3rd parameter = 1 returns character color
End Function ' GetColorXY

' /////////////////////////////////////////////////////////////////////////////
' Simple timestamp function
' Format: {YYYY}-{MM}-{DD} {hh}:[mm}:{ss}

' Uses:
'     TIME$
'         The TIME$ Function returns a STRING representation
'         of the current computer time in a 24 hour format.
'         https://qb64phoenix.com/qb64wiki/index.php/TIME$
'     DATE$
'         The DATE$ function returns the current computer date
'         as a string in the format "mm-dd-yyyy".
'         https://qb64phoenix.com/qb64wiki/index.php/DATE$
'
' TODO: support template where
'       {yyyy} = 4 digit year
'       {mm}   = 2 digit month
'       {dd}   = 2 digit day
'       {hh}   = 2 digit hour (12-hour)
'       {rr}   = 2 digit hour (24-hour)
'       {nn}   = 2 digit minute
'       {ss}   = 2 digit second
'       {ampm} = AM/PM

' We got the nn for minute from Microsoft > Office VBA Reference > DateDiff function
' https://docs.microsoft.com/en-us/office/vba/language/reference/user-interface-help/datediff-function

' PRINT "Current date time (simple format) = " + Chr$(34) + GetCurrentDateTime$("{yyyy}-{mm}-{dd} {rr}:{nn}:{ss}") + Chr$(34)
' PRINT "Current date time (US format)     = " + Chr$(34) + GetCurrentDateTime$("{mm}/{dd}/{yyyy} {hh}:{nn}:{ss} {ampm}") + Chr$(34)
' PRINT "Filename timestamp                = " + Chr$(34) + GetCurrentDateTime$("{yyyy}{mm}{dd}_{rr}{nn}{ss}") + Chr$(34)

Function GetCurrentDateTime$ (sTemplate$)
    Dim sDate$: sDate$ = Date$
    Dim sTime$: sTime$ = Time$
    Dim sYYYY$: sYYYY$ = Mid$(sDate$, 7, 4)
    Dim sMM$: sMM$ = Mid$(sDate$, 1, 2)
    Dim sDD$: sDD$ = Mid$(sDate$, 4, 2)
    Dim sHH24$: sHH24$ = Mid$(sTime$, 1, 2)
    Dim sHH$: sHH$ = ""
    Dim sMI$: sMI$ = Mid$(sTime$, 4, 2)
    Dim sSS$: sSS$ = Mid$(sTime$, 7, 2)
    Dim iHour%: iHour% = Val(sHH24$)
    Dim sAMPM$: sAMPM$ = ""
    Dim result$: result$ = ""

    ' FIGURE OUT AM/PM
    If InStr(sTemplate$, "{ampm}") > 0 Then
        If iHour% = 0 Then
            sAMPM$ = "AM"
            iHour% = 12
        ElseIf iHour% > 0 And iHour% < 12 Then
            sAMPM$ = "AM"
        ElseIf iHour% = 12 Then
            sAMPM$ = "PM"
        Else
            sAMPM$ = "PM"
            iHour% = iHour% - 12
        End If
        sHH$ = Right$("00" + _Trim$(Str$(iHour%)), 2)
    End If

    ' POPULATE TEMPLATE
    result$ = sTemplate$
    result$ = Replace$(result$, "{yyyy}", sYYYY$)
    result$ = Replace$(result$, "{mm}", sMM$)
    result$ = Replace$(result$, "{dd}", sDD$)
    result$ = Replace$(result$, "{hh}", sHH$)
    result$ = Replace$(result$, "{rr}", sHH24$)
    result$ = Replace$(result$, "{nn}", sMI$)
    result$ = Replace$(result$, "{ss}", sSS$)
    result$ = Replace$(result$, "{ampm}", sAMPM$)

    ' RETURN RESULT
    GetCurrentDateTime$ = result$
End Function ' GetCurrentDateTime$

' /////////////////////////////////////////////////////////////////////////////
' From: Bitwise Manipulations By Steven Roman
' http://www.romanpress.com/Articles/Bitwise_R/Bitwise.htm

' Returns the integer that corresponds to a binary string of length 8

Function GetIntegerFromBinary% (sBinary1 As String)
    Dim iResult As Integer
    Dim iLoop As Integer
    Dim strBinary As String
    Dim sBinary As String: sBinary = sBinary1

    iResult = 0
    strBinary = Replace$(sBinary, " ", "") ' Remove any spaces
    For iLoop = 0 To Len(strBinary) - 1
        iResult = iResult + 2 ^ iLoop * Val(Mid$(strBinary, Len(strBinary) - iLoop, 1))
    Next iLoop

    GetIntegerFromBinary% = iResult
End Function ' GetIntegerFromBinary%

' /////////////////////////////////////////////////////////////////////////////
' Receives a {sDelimeter} delimited list of numbers {MyString}
' and splits it up into an integer array arrInteger()
' beginning at index {iMinIndex}.

Sub GetIntegerArrayFromDelimList (MyString As String, sDelimiter As String, iMinIndex As Integer, arrInteger() As Integer)
    ReDim arrString(-1) As String
    Dim CleanString As String
    Dim iLoop As Integer
    Dim iCount As Integer: iCount = iMinIndex - 1

    ReDim arrInteger(-1) As Integer

    'DebugPrint "GetIntegerArrayFromDelimList " + _
    '    "MyString=" + chr$(34) + MyString + chr$(34) + ", " + _
    '    "sDelimiter=" + chr$(34) + sDelimiter + chr$(34) + ", " + _
    '    "iMinIndex=" + cstr$(iMinIndex) + ", " + _
    '    "arrInteger()"

    If Len(sDelimiter) > 0 Then
        CleanString = MyString
        If sDelimiter <> " " Then
            CleanString = Replace$(CleanString, " ", "")
        End If

        split CleanString, sDelimiter, arrString()
        iCount = iMinIndex - 1
        For iLoop = LBound(arrString) To UBound(arrString)
            If IsNum%(arrString(iLoop)) = TRUE Then
                iCount = iCount + 1
                ReDim _Preserve arrInteger(iMinIndex To iCount) As Integer
                arrInteger(iCount) = Val(arrString(iLoop))
                'DebugPrint "5633 arrInteger(" + cstr$(iCount) + ") = VAL(arrString(" + cstr$(iLoop) + ")) = " + cstr$(arrInteger(iCount))

            End If
        Next iLoop
    Else
        If IsNum%(MyString) = TRUE Then
            ReDim _Preserve arrInteger(iMinIndex To iMinIndex) As Integer
            arrInteger(iMinIndex) = Val(MyString)
        End If
    End If

    'CleanString=""
    'for iLoop=lbound(arrInteger) to ubound(arrInteger)
    'CleanString = CleanString + iifstr$(iLoop=lbound(arrInteger), "", ",") + cstr$(arrInteger(iLoop))
    'next iLoop
    'DebugPrint "arrInteger=(" + CleanString + ")"
End Sub ' GetIntegerArrayFromDelimList

' /////////////////////////////////////////////////////////////////////////////
' Gets the # of seconds so far today

Function GetTimeSeconds& ()
    Dim result&: result& = 0
    Dim sTime$: sTime$ = Time$
    Dim sHH24$: sHH24$ = Mid$(sTime$, 1, 2)
    Dim sMI$: sMI$ = Mid$(sTime$, 4, 2)
    Dim sSS$: sSS$ = Mid$(sTime$, 7, 2)

    result& = result& + Val(sSS$)
    result& = result& + (Val(sMI$) * 60)
    result& = result& + ((Val(sHH24$) * 60) * 60)

    ' RETURN RESULT
    GetTimeSeconds& = result&
End Function ' GetTimeSeconds&

' /////////////////////////////////////////////////////////////////////////////
' FOR BITWISE OPERATIONS

Function HasBit% (iByte As Integer, iBit As Integer)
    ''TODO: precalculate
    'dim shared m_arrBitValue(1 To 8) As Integer
    'dim iLoop as Integer
    'For iLoop = 0 To 7
    '   m_arrBitValue(iLoop + 1) = 2 ^ iLoop
    'Next iLoop
    'HasBit% = ((iByte And m_arrBitValue(iBit)) = m_arrBitValue(iBit))
    Dim iBitValue As Integer
    iBitValue = 2 ^ (iBit - 1)
    HasBit% = ((iByte And iBitValue) = iBitValue)
End Function ' HasBit%

' /////////////////////////////////////////////////////////////////////////////
' IIF function for QB for integers

Function IIF (Condition, IfTrue, IfFalse)
    If Condition Then IIF = IfTrue Else IIF = IfFalse
End Function

' /////////////////////////////////////////////////////////////////////////////
' IIF function for QB for strings

Function IIFS$ (Condition, IfTrue$, IfFalse$)
    If Condition Then IIFS$ = IfTrue$ Else IIFS$ = IfFalse$
End Function

' /////////////////////////////////////////////////////////////////////////////

Function IntPadLeft$ (iValue As Integer, iWidth As Integer)
    IntPadLeft$ = Right$(String$(iWidth, " ") + _Trim$(Str$(iValue)), iWidth)
End Function ' IntPadLeft$

' /////////////////////////////////////////////////////////////////////////////

Function IntPadRight$ (iValue As Integer, iWidth As Integer)
    IntPadRight$ = Left$(_Trim$(Str$(iValue)) + String$(iWidth, " "), iWidth)
End Function ' IntPadRight$

' /////////////////////////////////////////////////////////////////////////////
' Returns TRUE if number n is even
' https://slaystudy.com/qbasic-program-to-check-if-number-is-even-or-odd/
' see also: IsOdd%

Function IsEven% (n)
    If n Mod 2 = 0 Then
        IsEven% = TRUE
    Else
        IsEven% = FALSE
    End If
End Function ' IsEven%

' /////////////////////////////////////////////////////////////////////////////
' Returns TRUE if value text$ is numeric.

Function IsNum% (text$)
    IsNum% = IsNumber%(text$)
End Function ' IsNum%

'' OLD IsNum% CHECK FAILS FOR NUMBERS LIKE "002" AND "2.000":
'' from https://www.qb64.org/forum/index.php?topic=896.0
'Function IsNum% (text$)
'    Dim a$
'    Dim b$
'    a$ = _Trim$(text$)
'    b$ = _Trim$(Str$(Val(text$)))
'    If a$ = b$ Then
'        IsNum% = TRUE
'    Else
'        IsNum% = FALSE
'    End If
'End Function ' IsNum%

' /////////////////////////////////////////////////////////////////////////////
' Returns TRUE if value OriginalString$ is numeric else returns FALSE.

' Re: Does a Is Number function exist in QB64?
' https://www.qb64.org/forum/index.php?topic=896.15

' Version 2 by madscijr
' Returns TRUE (-1) if string is an integer, FALSE (0) if not

' Version 1 by MWheatley
' Reply #18 on: January 01, 2019, 11:24:30 AM
' returns 1 if string is an integer, 0 if not

Function IsNumber% (OriginalString$)
    Dim bResult%: bResult% = FALSE
    Dim iLoop%
    Dim TestString$
    Dim iDecimalCount%
    Dim sNextChar$

    If Len(OriginalString$) > 0 Then
        TestString$ = ""
        If Left$(OriginalString$, 1) = "+" Then
            TestString$ = Right$(OriginalString$, Len(OriginalString$) - 1)
        ElseIf Left$(OriginalString$, 1) = "-" Then
            TestString$ = Right$(OriginalString$, Len(OriginalString$) - 1)
        Else
            TestString$ = OriginalString$
        End If
        If Len(TestString$) > 0 Then
            bResult% = TRUE
            iDecimalCount% = 0
            For iLoop% = 1 To Len(TestString$)
                sNextChar$ = Mid$(TestString$, iLoop%, 1)
                If sNextChar$ = "." Then
                    iDecimalCount% = iDecimalCount% + 1
                    If iDecimalCount% > 1 Then
                        ' TOO MANY DECIMAL POINTS, INVALID!
                        bResult% = FALSE
                        Exit For
                    End If
                ElseIf Asc(sNextChar$) < 48 Or Asc(sNextChar$) > 57 Then
                    ' NOT A NUMERAL OR A DECIMAL, INVALID!
                    bResult% = FALSE
                    Exit For
                End If
            Next iLoop%
        End If
    End If
    IsNumber% = bResult%
End Function ' IsNumber%

' /////////////////////////////////////////////////////////////////////////////

'Sub IsNumberTest
'    Dim in$
'    Cls
'    IsNumberTest1 "1"
'    IsNumberTest1 "01"
'    IsNumberTest1 "001"
'    IsNumberTest1 "-1"
'    IsNumberTest1 "-01"
'    IsNumberTest1 "-001"
'    IsNumberTest1 "+1"
'    IsNumberTest1 "+01"
'    IsNumberTest1 "+001"
'    IsNumberTest1 ".1"
'    IsNumberTest1 ".01"
'    IsNumberTest1 ".001"
'    IsNumberTest1 ".10"
'    IsNumberTest1 ".100"
'    IsNumberTest1 "..100"
'    IsNumberTest1 "100."
'    Input "PRESS ENTER TO CONTINUE TEST";in$
'    Cls
'    IsNumberTest1 "0.10"
'    IsNumberTest1 "00.100"
'    IsNumberTest1 "000.1000"
'    IsNumberTest1 "000..1000"
'    IsNumberTest1 "000.1000.00"
'    IsNumberTest1 "+1.00"
'    IsNumberTest1 "++1.00"
'    IsNumberTest1 "+-1.00"
'    IsNumberTest1 "-1.00"
'    IsNumberTest1 "-+1.00"
'    IsNumberTest1 " 1"
'    IsNumberTest1 "1 "
'    IsNumberTest1 "1. 01"
'    IsNumberTest1 "+1 "
'End Sub ' IsNumberTest
'Sub IsNumberTest1(MyString As String)
'    Const cWidth = 16
'    Dim sInput As String : sInput = left$(Chr$(34) + MyString + Chr$(34) + String$(cWidth, " "), cWidth)
'    Dim sResult As String : sResult = right$(String$(2, " ") + _Trim$(Str$(IsNumber%(MyString))), 2)
'    Print "IsNumber%(" + sInput + ") returns " + sResult
'End Sub ' IsNumberTest1

' /////////////////////////////////////////////////////////////////////////////
' Returns TRUE if number n is odd
' https://slaystudy.com/qbasic-program-to-check-if-number-is-even-or-odd/
' see also: IsEven%

Function IsOdd% (n)
    If n Mod 2 = 1 Then
        IsOdd% = TRUE
    Else
        IsOdd% = FALSE
    End If
End Function ' IsOdd%

' /////////////////////////////////////////////////////////////////////////////
' Combines all elements of in$() into a single string
' with delimiter$ separating the elements.

' Split and join strings
' https://www.qb64.org/forum/index.php?topic=1073.0

Function join$ (in$(), delimiter$)
    Dim result$
    Dim i As Long
    result$ = in$(LBound(in$))
    For i = LBound(in$) + 1 To UBound(in$)
        result$ = result$ + delimiter$ + in$(i)
    Next i
    join$ = result$
End Function ' join$

' /////////////////////////////////////////////////////////////////////////////

Function LeftPadString$ (myString$, toWidth%, padChar$)
    LeftPadString$ = Right$(String$(toWidth%, padChar$) + myString$, toWidth%)
End Function ' LeftPadString$

' /////////////////////////////////////////////////////////////////////////////
' ABS was returning strange values with type LONG
' so I created this which does not.

' See also: UnsignedLongABS

Function LongABS& (lngValue As Long)
    If Sgn(lngValue) = -1 Then
        LongABS& = 0 - lngValue
    Else
        LongABS& = lngValue
    End If
End Function ' LongABS&

' /////////////////////////////////////////////////////////////////////////////
' Remove scientific Notation to String (~40 LOC)
' SMcNeill Jan 7, 2020
' https://www.qb64.org/forum/index.php?topic=1555.msg112989#msg112989

' Last Function in code marked Best Answer (removed debug comments and
' blank lines added these 2 lines.)

Function N2S$ (EXP$)
    ReDim t$, sign$, l$, r$, r&&
    ReDim dp As Long, dm As Long, ep As Long, em As Long, check1 As Long, l As Long, i As Long
    t$ = LTrim$(RTrim$(EXP$))
    If Left$(t$, 1) = "-" Or Left$(t$, 1) = "N" Then sign$ = "-": t$ = Mid$(t$, 2)
    dp = InStr(t$, "D+"): dm = InStr(t$, "D-")
    ep = InStr(t$, "E+"): em = InStr(t$, "E-")
    check1 = Sgn(dp) + Sgn(dm) + Sgn(ep) + Sgn(em)
    If check1 < 1 Or check1 > 1 Then N2S = _Trim$(EXP$): Exit Function ' If no scientic notation is found, or if we find more than 1 type, it's not SN!
    Select Case l ' l now tells us where the SN starts at.
        Case Is < dp: l = dp
        Case Is < dm: l = dm
        Case Is < ep: l = ep
        Case Is < em: l = em
    End Select
    l$ = Left$(t$, l - 1) ' The left of the SN
    r$ = Mid$(t$, l + 1): r&& = Val(r$) ' The right of the SN, turned into a workable long
    If InStr(l$, ".") Then ' Location of the decimal, if any
        If r&& > 0 Then
            r&& = r&& - Len(l$) + 2
        Else
            r&& = r&& + 1
        End If
        l$ = Left$(l$, 1) + Mid$(l$, 3)
    End If
    Select Case r&&
        Case 0 ' what the heck? We solved it already?
            ' l$ = l$
        Case Is < 0
            For i = 1 To -r&&
                l$ = "0" + l$
            Next
            l$ = "." + l$
        Case Else
            For i = 1 To r&&
                l$ = l$ + "0"
            Next
            l$ = l$
    End Select
    N2S$ = sign$ + l$
End Function ' N2S$

' /////////////////////////////////////////////////////////////////////////////

Function PadLeft$ (MyString As String, iLength As Integer)
    Dim sValue As String
    sValue = String$(iLength, " ") + MyString
    sValue = Right$(sValue, iLength)
    PadLeft$ = sValue
End Function ' PadLeft$

' /////////////////////////////////////////////////////////////////////////////

Function PadRight$ (MyString As String, iLength As Integer)
    Dim sValue As String
    sValue = MyString + String$(iLength, " ")
    sValue = Left$(sValue, iLength)
    PadRight$ = sValue
End Function ' PadRight$

' /////////////////////////////////////////////////////////////////////////////
' Pauses for iDS deciseconds (iDS * 100 ms)

Sub PauseDecisecond (iDS As Integer)
    Dim iCount As Integer
    iCount = 0
    Do
        iCount = iCount + 1
        _Limit 10 ' run 10x every second
    Loop Until iCount = iDS
End Sub ' PauseDecisecond

' /////////////////////////////////////////////////////////////////////////////
' Returns TRUE if point (x1%, y1%) is adjacent to point (x2%, y2%)

Function PointsAreAdjacent% (x1%, y1%, x2%, y2%)
    Dim bResult%: bResult% = FALSE

    ' x or y can be the same, but not both
    If (x1% <> x2%) Or (y1% <> y2%) Then
        If (x1% = x2%) Or ((x1% = (x2% + 1)) Or (x2% = (x1% + 1))) Then
            If (y1% = y2%) Or ((y1% = (y2% + 1)) Or (y2% = (y1% + 1))) Then
                bResult% = TRUE
            End If
        End If
    End If
    PointsAreAdjacent% = bResult%
End Function ' PointsAreAdjacent%



' /////////////////////////////////////////////////////////////////////////////
' Prints MyString$, iLinesPerPage% lines at a time,
' then waits for user to press a key to continue,
' before printing the next iLinesPerPage% lines.

Sub PrintPaged (MyString$, iLinesPerPage%)
    Dim delim$
    ReDim arrTest$(0)
    Dim iLoop%
    Dim iCount%
    Dim in$
    _KeyClear ' CLEAR KEYBOARD BUFFER

    delim$ = Chr$(13)
    split MyString$, delim$, arrTest$()
    iCount% = 0
    For iLoop% = LBound(arrTest$) To UBound(arrTest$)
        iCount% = iCount% + 1
        If iCount% > iLinesPerPage% Then
            Print
            Print "PRESS ANY KEY TO CONTINUE"
            Sleep: _KeyClear ' CLEAR KEYBOARD BUFFER
            Print
            iCount% = 0
        End If
        Print arrTest$(iLoop%)
    Next iLoop%

    _KeyClear ' CLEAR KEYBOARD BUFFER
End Sub ' PrintPaged

' /////////////////////////////////////////////////////////////////////////////
' iNum% = PromptForIntegerInRange%("Please type a number between {min} and {max} (or blank to quit).", 1, 4, 0) ' prompt, min, max, default

Function PromptForIntegerInRange% (sPrompt$, iMin%, iMax%, iDefault%)
    Dim iValue%
    Dim bFinished%
    Dim sPrompt1$
    Dim in$

    If Len(sPrompt$) > 0 Then
        sPrompt1$ = sPrompt$
    Else
        sPrompt1$ = "Please type a number between {min} and {max} (or blank to quit)."
    End If

    sPrompt1$ = Replace$(sPrompt1$, "{min}", cstr$(iMin%))
    sPrompt1$ = Replace$(sPrompt1$, "{max}", cstr$(iMax%))

    bFinished% = FALSE
    Do
        Print sPrompt1$

        Input in$
        in$ = _Trim$(in$)
        If Len(in$) > 0 Then
            If IsNumber(in$) Then
                iValue% = Val(in$)
                If iValue% >= iMin% And iValue% <= iMax% Then
                    'bFinished% = TRUE
                    Exit Do
                Else
                    Print "Number out of range."
                    Print
                End If
            Else
                Print "Not a valid number."
                Print
            End If
        Else
            iValue% = iDefault%
            Exit Do
            'bFinished% = TRUE
        End If
    Loop Until bFinished% = TRUE

    PromptForIntegerInRange% = iValue%
End Function ' PromptForIntegerInRange%

' /////////////////////////////////////////////////////////////////////////////
' Prints text character char$ at positoin x%,y% in color mycolor~&.

Sub PutCharXY (x%, y%, char$, myColor~&)
    Color myColor~&
    Locate y%, x%
    Print char$;
End Sub ' PutCharXY

' /////////////////////////////////////////////////////////////////////////////
' Initializes random number generator seed.

' NOTE:
' using # of seconds so far in the day
' may be slightly more random than Randomize Timer
' unless user runs program at exact same time every day

Sub InitializeRandom
    Dim t9#
    t9# = (Timer * 1000000) Mod 32767
    Randomize t9#
End Sub ' InitializeRandom

' /////////////////////////////////////////////////////////////////////////////
' Initializes random number generator seed.

' *** NOT SURE IF THIS ONE WORKS ***

Sub InitializeRandom1
    Dim iSeed As Integer
    iSeed = GetTimeSeconds& Mod 32767
    Randomize iSeed
End Sub ' InitializeRandom1

' /////////////////////////////////////////////////////////////////////////////
' Generate random value between Min and Max inclusive.

' Note: random-number generator should be initialized with
'       InitializeRandom or Randomize Timer

Function RandomNumber% (Min%, Max%)
    Dim NumSpread%

    '' SET RANDOM SEED
    ''Randomize ' Initialize random-number generator.
    'Randomize Timer

    NumSpread% = (Max% - Min%) + 1
    RandomNumber% = Int(Rnd * NumSpread%) + Min% ' GET RANDOM # BETWEEN Max% AND Min%
End Function ' RandomNumber%

' /////////////////////////////////////////////////////////////////////////////

$If  Then
    Sub RandomNumberTest
    Dim iCols As Integer: iCols = 10
    Dim iRows As Integer: iRows = 20
    Dim iLoop As Integer
    Dim iX As Integer
    Dim iY As Integer
    Dim sError As String
    Dim sFileName As String
    Dim sText As String
    Dim bAppend As Integer
    Dim iMin As Integer
    Dim iMax As Integer
    Dim iNum As Integer
    Dim iErrorCount As Integer
    Dim sInput$

    sFileName = "c:\temp\maze_test_1.txt"
    sText = "Count" + Chr$(9) + "Min" + Chr$(9) + "Max" + Chr$(9) + "Random"
    bAppend = FALSE
    sError = PrintFile$(sFileName, sText, bAppend)
    If Len(sError) = 0 Then
    bAppend = TRUE
    iErrorCount = 0

    iMin = 0
    iMax = iCols - 1
    For iLoop = 1 To 100
    iNum = RandomNumber%(iMin, iMax)
    sText = Str$(iLoop) + Chr$(9) + Str$(iMin) + Chr$(9) + Str$(iMax) + Chr$(9) + Str$(iNum)
    sError = PrintFile$(sFileName, sText, bAppend)
    If Len(sError) > 0 Then
    iErrorCount = iErrorCount + 1
    Print Str$(iLoop) + ". ERROR"
    Print "    " + "iMin=" + Str$(iMin)
    Print "    " + "iMax=" + Str$(iMax)
    Print "    " + "iNum=" + Str$(iNum)
    Print "    " + "Could not write to file " + Chr$(34) + sFileName + Chr$(34) + "."
    Print "    " + sError
    End If
    Next iLoop

    iMin = 0
    iMax = iRows - 1
    For iLoop = 1 To 100
    iNum = RandomNumber%(iMin, iMax)
    sText = Str$(iLoop) + Chr$(9) + Str$(iMin) + Chr$(9) + Str$(iMax) + Chr$(9) + Str$(iNum)
    sError = PrintFile$(sFileName, sText, bAppend)
    If Len(sError) > 0 Then
    iErrorCount = iErrorCount + 1
    Print Str$(iLoop) + ". ERROR"
    Print "    " + "iMin=" + Str$(iMin)
    Print "    " + "iMax=" + Str$(iMax)
    Print "    " + "iNum=" + Str$(iNum)
    Print "    " + "Could not write to file " + Chr$(34) + sFileName + Chr$(34) + "."
    Print "    " + sError
    End If
    Next iLoop

    Print "Finished generating numbers. Errors: " + Str$(iErrorCount)
    Else
    Print "Error creating file " + Chr$(34) + sFileName + Chr$(34) + "."
    Print sError
    End If

    Input "Press <ENTER> to continue", sInput$
    End Sub ' RandomNumberTest
$End If

' /////////////////////////////////////////////////////////////////////////////
' [Replace$] replaces all instances of the [Find] sub-string
' with the [Add] sub-string within the [Text] string.

' SUMMARY:
'   Purpose:  A library of custom functions that transform strings.
'   Author:   Dustinian Camburides (dustinian@gmail.com)
'   Platform: QB64 (www.qb64.org)
'   Revision: 1.6
'   Updated:  5/28/2012

' INPUT:
'   Text: The input string; the text that's being manipulated.
'   Find: The specified sub-string; the string sought within the [Text] string.
'   Add: The sub-string that's being added to the [Text] string.

' FROM: String Manipulation
' found at abandoned, outdated and now likely malicious qb64 dot net website
' http://www.qb64.[net]/forum/index_topic_5964-0/

Function Replace$ (Text1 As String, Find1 As String, Add1 As String)
    ' VARIABLES:
    Dim Text2 As String
    Dim Find2 As String
    Dim Add2 As String
    Dim lngLocation As Long ' The address of the [Find] substring within the [Text] string.
    Dim strBefore As String ' The characters before the string to be replaced.
    Dim strAfter As String ' The characters after the string to be replaced.

    ' INITIALIZE:
    ' MAKE COPIES SO THE ORIGINAL IS NOT MODIFIED (LIKE ByVal IN VBA)
    Text2 = Text1
    Find2 = Find1
    Add2 = Add1

    lngLocation = InStr(1, Text2, Find2)

    ' PROCESSING:
    ' While [Find2] appears in [Text2]...
    While lngLocation
        ' Extract all Text2 before the [Find2] substring:
        strBefore = Left$(Text2, lngLocation - 1)

        ' Extract all text after the [Find2] substring:
        strAfter = Right$(Text2, ((Len(Text2) - (lngLocation + Len(Find2) - 1))))

        ' Return the substring:
        Text2 = strBefore + Add2 + strAfter

        ' Locate the next instance of [Find2]:
        lngLocation = InStr(1, Text2, Find2)

        ' Next instance of [Find2]...
    Wend

    ' OUTPUT:
    Replace$ = Text2
End Function ' Replace$

' /////////////////////////////////////////////////////////////////////////////

$If  Then
    Sub ReplaceTest
    Dim in$

    Print "-------------------------------------------------------------------------------"
    Print "ReplaceTest"
    Print

    Print "Original value"
    in$ = "Thiz iz a teZt."
    Print "in$ = " + Chr$(34) + in$ + Chr$(34)
    Print

    Print "Replacing lowercase " + Chr$(34) + "z" + Chr$(34) + " with " + Chr$(34) + "s" + Chr$(34) + "..."
    in$ = Replace$(in$, "z", "s")
    Print "in$ = " + Chr$(34) + in$ + Chr$(34)
    Print

    Print "Replacing uppercase " + Chr$(34) + "Z" + Chr$(34) + " with " + Chr$(34) + "s" + Chr$(34) + "..."
    in$ = Replace$(in$, "Z", "s")
    Print "in$ = " + Chr$(34) + in$ + Chr$(34)
    Print

    Print "ReplaceTest finished."
    End Sub ' ReplaceTest
$End If

' /////////////////////////////////////////////////////////////////////////////

Function RightPadString$ (myString$, toWidth%, padChar$)
    RightPadString$ = Left$(myString$ + String$(toWidth%, padChar$), toWidth%)
End Function ' RightPadString$

' /////////////////////////////////////////////////////////////////////////////
' This sub gives really nice control over displaying an Image.
' by BPlus

' Scale rotate font text strings by B+
' https://qb64phoenix.com/forum/showthread.php?tid=414&highlight=rotate+text

' USED BY: drwString

Sub RotoZoom2 (centerX As Long, centerY As Long, Image As Long, xScale As Single, yScale As Single, Rotation As Single)
    Dim px(3) As Single: Dim py(3) As Single
    Dim W&
    Dim H&
    Dim sinr!
    Dim cosr!
    Dim i&
    Dim x2&
    Dim y2&

    W& = _Width(Image&): H& = _Height(Image&)
    px(0) = -W& / 2: py(0) = -H& / 2: px(1) = -W& / 2: py(1) = H& / 2
    px(2) = W& / 2: py(2) = H& / 2: px(3) = W& / 2: py(3) = -H& / 2
    sinr! = Sin(-Rotation): cosr! = Cos(-Rotation)
    For i& = 0 To 3
        x2& = (px(i&) * cosr! + sinr! * py(i&)) * xScale + centerX
        y2& = (py(i&) * cosr! - px(i&) * sinr!) * yScale + centerY
        px(i&) = x2&: py(i&) = y2&
    Next
    _MapTriangle (0, 0)-(0, H& - 1)-(W& - 1, H& - 1), Image& To(px(0), py(0))-(px(1), py(1))-(px(2), py(2))
    _MapTriangle (0, 0)-(W& - 1, 0)-(W& - 1, H& - 1), Image& To(px(0), py(0))-(px(3), py(3))-(px(2), py(2))
End Sub ' RotoZoom2

'' /////////////////////////////////////////////////////////////////////////////
'' https://qb64phoenix.com/forum/showthread.php?tid=644
'' From: bplus
'' Date: 07-18-2022, 03:16 PM
'' Here is a Round$ that acts the way you'd expect in under 100 LOC
'' b = b + ...
'
'Function Round$ (anyNumber, dp As Long)
'    ' 5 and up at decimal place dp+1 > +1 at decimal place   4 and down  > +0 at dp
'    ' 2 1 0.-1 -2 -3 -4 ...  pick dp like this for this Round$ Function
'    sn$ = N2S$(Str$(anyNumber + .5 * 10 ^ dp)) ' get rid of sci notation, steve trims it so next find dot
'    dot = InStr(sn$, ".")
'    If dot Then
'        predot = dot - 1
'        postdot = Len(sn$) - (dot + 1)
'    Else
'        predot = Len(sn$)
'        postdot = 0
'    End If
'    ' xxx.yyyyyy  dp = -2
'    '      ^ dp
'    If dp >= 0 Then
'        Rtn$ = Mid$(sn$, 1, predot - dp) + String$(dp, "0")
'    Else
'        Rtn$ = Mid$(sn$, 1, predot) + "." + Mid$(sn$, dot + 1, -dp)
'    End If
'    If Rtn$ = "" Then
'        Round$ = "0"
'    Else
'        Round$ = Rtn$
'    End If
'End Function ' Round$
'
'' /////////////////////////////////////////////////////////////////////////////
''
''Sub RoundTest
''   Print Round$(.15, 0) '  0
''   Print Round$(.15, -1) ' .2
''   Print Round$(.15, -2) ' .15
''   Print Round$(.15, -3) ' .150
''   Print
''   Print Round$(3555, 0) ' 3555
''   Print Round$(3555, 1) ' 3560
''   Print Round$(3555, 2) ' 3600 'good
''   Print Round$(3555, 3) ' 4000
''   Print
''   Print Round$(23.149999, -1) ' 23.1
''   Print Round$(23.149999, -2) ' 23.15
''   Print Round$(23.149999, -3) ' 23.150
''   Print Round$(23.149999, -4) ' 23.1500
''   Print
''   Print Round$(23.143335, -1) ' 23.1 OK?
''   Print Round$(23.143335, -2) ' 23.14
''   Print Round$(23.143335, -3) ' 23.143
''   Print Round$(23.143335, -4) ' 23.1433
''   Print Round$(23.143335, -5) ' 23.14334
''   Print
''   Dim float31 As _Float
''   float31 = .310000000000009
''   Print Round$(.31, -2) ' .31
''   Print Round$(.31##, -2)
''   Print Round$(float31, -2)
''End Sub ' RoundTest

' /////////////////////////////////////////////////////////////////////////////
' Rounding functions.

' FROM:
' https://www.qb64.org/forum/index.php?topic=3605.0

' Quote from: SMcNeill on Today at 03:53:48 PM
'
' Sometimes, you guys make things entirely too  complicated.
' There ya go!  Three functions to either round naturally,
' always round down, or always round up, to whatever number of digits you desire.
' EDIT:  Modified to add another option to round scientific,
' since you had it's description included in your example.

' =============================================================================
' ROUNDING FUNCTIONS FOR TYPE _FLOAT

' Receives + returns _FLOAT myVar## (-1.18E-4932 to +1.18E+4932)

Function RoundNatural## (num##, digits%)
    RoundNatural## = Int(num## * 10 ^ digits% + .5) / 10 ^ digits%
End Function

Function RoundUp## (num##, digits%)
    RoundUp## = _Ceil(num## * 10 ^ digits%) / 10 ^ digits%
End Function

Function RoundDown## (num##, digits%)
    RoundDown## = Int(num## * 10 ^ digits%) / 10 ^ digits%
End Function

' old name: Round_Scientific##
Function RoundScientific## (num##, digits%)
    RoundScientific## = _Round(num## * 10 ^ digits%) / 10 ^ digits%
End Function

' =============================================================================
' ROUNDING FUNCTIONS FOR TYPE DOUBLE

Function RoundDouble# (num#, digits%)
    RoundDouble# = Int(num# * 10 ^ digits% + .5) / 10 ^ digits%
End Function

Function RoundUpDouble# (num#, digits%)
    RoundUpDouble# = _Ceil(num# * 10 ^ digits%) / 10 ^ digits%
End Function

Function RoundDownDouble# (num#, digits%)
    RoundDownDouble# = Int(num# * 10 ^ digits%) / 10 ^ digits%
End Function

Function RoundScientificDouble# (num#, digits%)
    RoundScientificDouble# = _Round(num# * 10 ^ digits%) / 10 ^ digits%
End Function

' =============================================================================
' ROUNDING FUNCTIONS FOR TYPE SINGLE

Function RoundSingle! (num!, digits%)
    RoundSingle! = Int(num! * 10 ^ digits% + .5) / 10 ^ digits%
End Function

' NOTE: not sure this one works: when digits%=3, it rounds .31 to .32
Function RoundUpSingle! (num!, digits%)
    RoundUpSingle! = _Ceil(num! * 10 ^ digits%) / 10 ^ digits%
End Function

Function RoundDownSingle! (num!, digits%)
    RoundDownSingle! = Int(num! * 10 ^ digits%) / 10 ^ digits%
End Function

Function RoundScientificSingle! (num!, digits%)
    RoundScientificSingle! = _Round(num! * 10 ^ digits%) / 10 ^ digits%
End Function

' /////////////////////////////////////////////////////////////////////////////
' fantastically inefficient way to set a bit

' example use: arrMaze(iX, iY) = SetBit256%(arrMaze(iX, iY), cS, FALSE)

' See also: GetBit256%, SetBit256%

' newint=SetBit256%(oldint, int containing the bits we want to set, value to set them to)
Function SetBit256% (iNum1 As Integer, iBit1 As Integer, bVal1 As Integer)
    Dim sNum As String
    Dim sBit As String
    Dim sVal As String
    Dim iLoop As Integer
    Dim strResult As String
    Dim iResult As Integer
    Dim iNum As Integer: iNum = iNum1
    Dim iBit As Integer: iBit = iBit1
    Dim bVal As Integer: bVal = bVal1

    If iNum < 256 And iBit <= 128 Then
        sNum = GetBinary$(iNum)
        sBit = GetBinary$(iBit)
        If bVal = TRUE Then
            sVal = "1"
        Else
            sVal = "0"
        End If
        strResult = ""
        For iLoop = 1 To 8
            If Mid$(sBit, iLoop, 1) = "1" Then
                strResult = strResult + sVal
            Else
                strResult = strResult + Mid$(sNum, iLoop, 1)
            End If
        Next iLoop
        iResult = GetIntegerFromBinary%(strResult)
    Else
        iResult = iNum
    End If

    SetBit256% = iResult
End Function ' SetBit256%

' /////////////////////////////////////////////////////////////////////////////

$If  Then
    Sub ShowDegreesAndRadians
    Dim iDegree As Integer
    Dim sngRadian As Single

    DebugPrint "Degree   Radian"
    DebugPrint "------   ------"
    For iDegree = 0 To 360
    sngRadian = _D2R(iDegree)

    'DebugPrint LeftPadString$(cstr$(iDegree), 3, " ") + "   " + LeftPadString$(cstr$(iRadian), 3, " ")

    DebugPrint LeftPadString$(cstr$(iDegree), 3, " ") + "   " + SngToStr$(sngRadian)

    'Print "SngToStr$(MyValue)           =" + SngToStr$(MyValue)
    'Print "SngRoundedToStr$(MyValue, 12)=" + SngRoundedToStr$(MyValue, 12)

    Next iDegree
    End Sub ' ShowDegreesAndRadians
$End If

' /////////////////////////////////////////////////////////////////////////////
' use angles in degrees units instead of radians (converted inside sub)
' Note this function uses whatever the default type is, better not be some Integer Type.

Function SinD (degrees)
    SinD = Sin(_D2R(degrees))
End Function ' SinD

' /////////////////////////////////////////////////////////////////////////////

Function SmallestOf3% (i1%, i2%, i3%)
    Dim iMin%
    iMin% = i1%
    If i2% < iMin% Then iMin% = i2%
    If i3% < iMin% Then iMin% = i3%
    SmallestOf3% = iMin%
End Function ' SmallestOf3

' /////////////////////////////////////////////////////////////////////////////
' Receives a Single, rounds it to intNumPlaces places,
' and returns the result as a string.

Function SngRoundedToStr$ (sngValue As Single, intNumPlaces As Integer)
    Dim sngNew As Single
    sngNew = RoundSingle!(sngValue, intNumPlaces)
    SngRoundedToStr$ = SngToStr$(sngNew)
End Function ' SngRoundedToStr$

' /////////////////////////////////////////////////////////////////////////////
' Receives a Single, rounds it to 0 places,
' and returns the result as an Integer.

' NOTE: Hack function, to be replaced with something better?

Function SngToInt% (sngOld As Single)
    Dim sngNew As Single
    Dim sValue As String
    Dim iPos As Integer
    sngNew = RoundSingle!(sngOld, 0)
    sValue = SngToStr$(sngNew)
    SngToInt% = Val(sValue)
End Function ' SngToInt%

' /////////////////////////////////////////////////////////////////////////////
' Converts a Single to a string, formatted without scientific notation.

' Scientific notation - QB64 Wiki
' https://www.qb64.org/wiki/Scientific_notation

' Example usage:
' A string function that displays extremely small or large exponential
' decimal values.

Function SngToStr$ (n!)
    Dim result$: result$ = ""
    Dim value$
    Dim Xpos%
    Dim expo%
    Dim sign$
    Dim valu$
    Dim dot%
    Dim L%
    Dim add$
    Dim min$
    Dim DP$
    Dim n%
    Dim num$: num$ = ""

    value$ = UCase$(LTrim$(Str$(n!)))
    Xpos% = InStr(value$, "D") + InStr(value$, "E") ' only D or E can be present
    If Xpos% Then
        expo% = Val(Mid$(value$, Xpos% + 1))
        If Val(value$) < 0 Then
            sign$ = "-"
            valu$ = Mid$(value$, 2, Xpos% - 2)
        Else
            valu$ = Mid$(value$, 1, Xpos% - 1)
        End If
        dot% = InStr(valu$, ".")
        L% = Len(valu$)
        If expo% > 0 Then
            add$ = String$(expo% - (L% - dot%), "0")
        End If
        If expo% < 0 Then
            min$ = String$(Abs(expo%) - (dot% - 1), "0")
            DP$ = "."
        End If
        For n% = 1 To L%
            If Mid$(valu$, n%, 1) <> "." Then
                num$ = num$ + Mid$(valu$, n%, 1)
            End If
        Next n%
        result$ = _Trim$(sign$ + DP$ + min$ + num$ + add$)
    Else
        result$ = value$
    End If

    SngToStr$ = result$
End Function ' SngToStr$

' /////////////////////////////////////////////////////////////////////////////
' Splits a string in$ by delimeter delimiter$
' into an array result$().

' Split and join strings
' https://www.qb64.org/forum/index.php?topic=1073.0
'
' FROM luke, QB64 Developer
' Date: February 15, 2019, 04:11:07 AM
'
' Given a string of words separated by spaces (or any other character),
' splits it into an array of the words. I've no doubt many people have
' written a version of this over the years and no doubt there's a million
' ways to do it, but I thought I'd put mine here so we have at least one
' version. There's also a join function that does the opposite
' array -> single string.
'
' Code is hopefully reasonably self explanatory with comments and a little demo.
' Note, this is akin to Python/JavaScript split/join, PHP explode/implode.

' Split in$ into pieces, chopping at every occurrence of delimiter$.
' Multiple consecutive occurrences of delimiter$ are treated as a single instance.
' The chopped pieces are stored in result$().

' delimiter$ must be one character long.
' result$() must have been REDIMmed previously.

' Modified to handle multi-character delimiters

Sub split (in$, delimiter$, result$())
    Dim start As Integer
    Dim finish As Integer
    Dim iDelimLen As Integer
    ReDim result$(-1)

    iDelimLen = Len(delimiter$)

    start = 1
    Do
        While Mid$(in$, start, iDelimLen) = delimiter$
            start = start + iDelimLen
            If start > Len(in$) Then
                Exit Sub
            End If
        Wend
        finish = InStr(start, in$, delimiter$)
        If finish = 0 Then
            finish = Len(in$) + 1
        End If

        ReDim _Preserve result$(0 To UBound(result$) + 1)

        result$(UBound(result$)) = Mid$(in$, start, finish - start)
        start = finish + 1
    Loop While start <= Len(in$)
End Sub ' split

' /////////////////////////////////////////////////////////////////////////////

$If  Then
    Sub SplitTest
    Dim in$
    Dim delim$
    ReDim arrTest$(0)
    Dim iLoop%

    delim$ = Chr$(10)
    in$ = "this" + delim$ + "is" + delim$ + "a" + delim$ + "test"
    Print "in$ = " + Chr$(34) + in$ + Chr$(34)
    Print "delim$ = " + Chr$(34) + delim$ + Chr$(34)
    split in$, delim$, arrTest$()

    For iLoop% = LBound(arrTest$) To UBound(arrTest$)
    Print "arrTest$(" + LTrim$(RTrim$(Str$(iLoop%))) + ") = " + Chr$(34) + arrTest$(iLoop%) + Chr$(34)
    Next iLoop%

    Print
    Print "Split test finished."
    End Sub ' SplitTest
$End If

' /////////////////////////////////////////////////////////////////////////////

$If  Then
    Sub SplitAndReplaceTest
    Dim in$
    Dim out$
    Dim iLoop%
    ReDim arrTest$(0)

    Print "-------------------------------------------------------------------------------"
    Print "SplitAndReplaceTest"
    Print

    Print "Original value"
    in$ = "This line 1 " + Chr$(13) + Chr$(10) + "and line 2" + Chr$(10) + "and line 3 " + Chr$(13) + "finally THE END."
    out$ = in$
    out$ = Replace$(out$, Chr$(13), "\r")
    out$ = Replace$(out$, Chr$(10), "\n")
    out$ = Replace$(out$, Chr$(9), "\t")
    Print "in$ = " + Chr$(34) + out$ + Chr$(34)
    Print

    Print "Fixing linebreaks..."
    in$ = Replace$(in$, Chr$(13) + Chr$(10), Chr$(13))
    in$ = Replace$(in$, Chr$(10), Chr$(13))
    out$ = in$
    out$ = Replace$(out$, Chr$(13), "\r")
    out$ = Replace$(out$, Chr$(10), "\n")
    out$ = Replace$(out$, Chr$(9), "\t")
    Print "in$ = " + Chr$(34) + out$ + Chr$(34)
    Print

    Print "Splitting up..."
    split in$, Chr$(13), arrTest$()

    For iLoop% = LBound(arrTest$) To UBound(arrTest$)
    out$ = arrTest$(iLoop%)
    out$ = Replace$(out$, Chr$(13), "\r")
    out$ = Replace$(out$, Chr$(10), "\n")
    out$ = Replace$(out$, Chr$(9), "\t")
    Print "arrTest$(" + _Trim$(Str$(iLoop%)) + ") = " + Chr$(34) + out$ + Chr$(34)
    Next iLoop%
    Print

    Print "SplitAndReplaceTest finished."
    End Sub ' SplitAndReplaceTest
$End If

' /////////////////////////////////////////////////////////////////////////////
' Converts a chr$(13) delimited string
' into a 2-dimensional array.

' Usage:
' Dim StringArray(1 To 48, 1 To 128) As String
' StringTo2dArray StringArray(), GetMap$

' Version 2 with indexed array(row, columm)
' Renamed StringToArray to StringTo2dArray.

' See also: Array2dToString$

Sub StringTo2dArray (MyArray() As String, MyString As String)
    Dim sDelim As String
    ReDim arrLines(0) As String
    Dim iRow As Integer
    Dim iCol As Integer
    Dim sChar As String
    Dim iDim1 As Integer
    Dim iDim2 As Integer
    Dim iIndex1 As Integer
    Dim iIndex2 As Integer

    iDim1 = LBound(MyArray, 1)
    iDim2 = LBound(MyArray, 2)
    sDelim = Chr$(13)
    split MyString, sDelim, arrLines()
    For iRow = LBound(arrLines) To UBound(arrLines)
        If iRow <= UBound(MyArray, 1) Then
            For iCol = 1 To Len(arrLines(iRow))
                If iCol <= UBound(MyArray, 2) Then
                    sChar = Mid$(arrLines(iRow), iCol, 1)

                    If Len(sChar) > 1 Then
                        sChar = Left$(sChar, 1)
                    Else
                        If Len(sChar) = 0 Then
                            sChar = "."
                        End If
                    End If

                    iIndex1 = iRow + iDim1
                    iIndex2 = (iCol - 1) + iDim2
                    MyArray(iIndex1, iIndex2) = sChar
                    'DebugPrint "MyArray(" + cstr$(iIndex1) + ", " + cstr$(iIndex2) + " = " + chr$(34) + sChar + chr$(34)
                Else
                    ' Exit if out of bounds
                    Exit For
                End If
            Next iCol
        Else
            ' Exit if out of bounds
            Exit For
        End If
    Next iRow
End Sub ' StringTo2dArray

' /////////////////////////////////////////////////////////////////////////////

Function StrPadLeft$ (sValue As String, iWidth As Integer)
    StrPadLeft$ = Right$(String$(iWidth, " ") + sValue, iWidth)
End Function ' StrPadLeft$

' /////////////////////////////////////////////////////////////////////////////

Function StrJustifyRight$ (sValue As String, iWidth As Integer)
    StrJustifyRight$ = Right$(String$(iWidth, " ") + sValue, iWidth)
End Function ' StrJustifyRight$

' /////////////////////////////////////////////////////////////////////////////

Function StrPadRight$ (sValue As String, iWidth As Integer)
    StrPadRight$ = Left$(sValue + String$(iWidth, " "), iWidth)
End Function ' StrPadRight$

' /////////////////////////////////////////////////////////////////////////////

Function StrJustifyLeft$ (sValue As String, iWidth As Integer)
    StrJustifyLeft$ = Left$(sValue + String$(iWidth, " "), iWidth)
End Function ' StrJustifyLeft$

' /////////////////////////////////////////////////////////////////////////////
' div: int1% = num1% \ den1%
' mod: rem1% = num1% MOD den1%

Function StrJustifyCenter$ (sValue As String, iWidth As Integer)
    Dim iLen0 As Integer
    Dim iLen1 As Integer
    Dim iLen2 As Integer
    Dim iExtra As Integer

    iLen0 = Len(sValue)
    If iWidth = iLen0 Then
        ' no extra space: return unchanged
        StrJustifyCenter$ = sValue
    ElseIf iWidth > iLen0 Then
        If IsOdd%(iWidth) Then
            iWidth = iWidth - 1
        End If

        ' center
        iExtra = iWidth - iLen0
        iLen1 = iExtra \ 2
        iLen2 = iLen1 + (iExtra Mod 2)
        StrJustifyCenter$ = String$(iLen1, " ") + sValue + String$(iLen2, " ")
    Else
        ' string is too long: truncate
        StrJustifyCenter$ = Left$(sValue, iWidth)
    End If
End Function ' StrJustifyCenter$

' /////////////////////////////////////////////////////////////////////////////
' Use to pretty print TRUE and FALSE values.

Function TrueFalse$ (myValue)
    If myValue = TRUE Then
        TrueFalse$ = "TRUE"
    Else
        TrueFalse$ = "FALSE"
    End If
End Function ' TrueFalse$

' /////////////////////////////////////////////////////////////////////////////
' ABS was returning strange values with type _UNSIGNED LONG
' so I created this which does not.

' See also: LongABS

Function UnsignedLongABS~& (ulValue As _Unsigned Long)
    If Sgn(ulValue) = -1 Then
        UnsignedLongABS~& = 0 - ulValue
    Else
        UnsignedLongABS~& = ulValue
    End If
End Function ' UnsignedLongABS~&

' /////////////////////////////////////////////////////////////////////////////

Sub WaitForEnter
    Dim in$
    Input "Press <ENTER> to continue", in$
End Sub ' WaitForEnter

' /////////////////////////////////////////////////////////////////////////////
' WaitForKey "Press <ESC> to continue", 27, 0
' WaitForKey "Press <ENTER> to begin;", 13, 0
' waitforkey "", 65, 5

Sub WaitForKey (prompt$, KeyCode&, DelaySeconds%)
    ' SHOW PROMPT (IF SPECIFIED)
    If Len(prompt$) > 0 Then
        If Right$(prompt$, 1) <> ";" Then
            Print prompt$
        Else
            Print Right$(prompt$, Len(prompt$) - 1);
        End If
    End If

    ' WAIT FOR KEY
    Do: Loop Until _KeyDown(KeyCode&) ' leave loop when specified key pressed

    ' PAUSE AFTER (IF SPECIFIED)
    If DelaySeconds% < 1 Then
        _KeyClear: '_DELAY 1
    Else
        _KeyClear: _Delay DelaySeconds%
    End If
End Sub ' WaitForKey

' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
' END GENERAL PURPOSE ROUTINES #GENERAL
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
' BEGIN DEBUGGING ROUTINES #DEBUG
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

' /////////////////////////////////////////////////////////////////////////////

Sub DebugLog (sText As String)
    If cDebugEnabled = TRUE Then
        Dim sTime As String
        Dim sResult As String
        ReDim arrLines(0) As String
        Dim iLoop As Integer
        Dim sNextLine As String

        If _FileExists(m_sDebugFile) = FALSE Then
            sResult = PrintFile$(m_sDebugFile, "", FALSE)
        End If

        If Len(sResult) = 0 Then
            sTime = GetCurrentDateTime$("{mm}/{dd}/{yyyy} {hh}:{nn}:{ss} {ampm}")
            split sText, Chr$(13), arrLines()
            For iLoop = LBound(arrLines) To UBound(arrLines)
                sNextLine = sTime + " " + arrLines(iLoop)
                sResult = PrintFile$(m_sDebugFile, sNextLine, TRUE)
            Next iLoop
        End If
    End If
End Sub ' DebugLog

' /////////////////////////////////////////////////////////////////////////////

Sub DebugLog1 (sText As String)
    If cDebugEnabled = TRUE Then
        Dim sResult As String
        If _FileExists(m_sDebugFile) Then
            sResult = PrintFile$(m_sDebugFile, sText, TRUE)
        Else
            sResult = PrintFile$(m_sDebugFile, sText, FALSE)
        End If
    End If
End Sub ' DebugLog

' /////////////////////////////////////////////////////////////////////////////
' Prints MyString to console with linebreaks.

' Thanks to:
' SpriggsySpriggs for how to use the QB64 debug console:
' https://www.qb64.org/forum/index.php?topic=3949.0

Sub DebugPrint (MyString As String)
    'If cDebugEnabled = TRUE Then
    '    ReDim arrLines(-1) As String
    '    Dim iLoop As Integer
    '    split MyString, Chr$(13), arrLines()
    '    For iLoop = LBound(arrLines) To UBound(arrLines)
    '        _Echo arrLines(iLoop)
    '    Next iLoop
    'End If
End Sub ' DebugPrint

' /////////////////////////////////////////////////////////////////////////////
' Simply prints s$ to console (no linebreaks).

Sub DebugPrint1 (s$)
    'If cDebugEnabled = TRUE Then
    '    _Echo s$
    'End If
End Sub ' DebugPrint1

' /////////////////////////////////////////////////////////////////////////////
' Writes sText to a debug file in the EXE folder.
' Debug file is named the same thing as the program EXE name with ".txt" at the end.
' For example the program "C:\QB64\MyProgram.BAS" running as
' "C:\QB64\MyProgram.EXE" would have an output file "C:\QB64\MyProgram.EXE.txt".
' If the file doesn't exist, it is created, otherwise it is appended to.

Sub PrintDebugFile (sText As String)
    Dim sFileName As String
    Dim sError As String
    Dim sOut As String

    sFileName = m_ProgramPath$ + m_ProgramName$ + ".txt"
    sError = ""
    If _FileExists(sFileName) = FALSE Then
        sOut = ""
        sOut = sOut + "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" + Chr$(13) + Chr$(10)
        sOut = sOut + "PROGRAM : " + m_ProgramName$ + Chr$(13) + Chr$(10)
        sOut = sOut + "RUN DATE: " + CurrentDateTime$ + Chr$(13) + Chr$(10)
        sOut = sOut + "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" + Chr$(13) + Chr$(10)
        sError = PrintFile$(sFileName, sOut, FALSE)
    End If
    If Len(sError) = 0 Then
        sError = PrintFile$(sFileName, sText, TRUE)
    End If
    If Len(sError) <> 0 Then
        Print CurrentDateTime$ + " PrintDebugFile FAILED: " + sError
    End If
End Sub ' PrintDebugFile

' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
' END DEBUGGING ROUTINES @DEBUG
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

' ################################################################################################################################################################
' #REFERENCE

' =============================================================================
' SOME USEFUL STUFF FOR REFERENCE:

' Type Name               Type suffix symbol   Minimum value                  Maximum value                Size in Bytes
' ---------------------   ------------------   ----------------------------   --------------------------   -------------
' _BIT                    `                    -1                             0                            1/8
' _BIT * n                `n                   -128                           127                          n/8
' _UNSIGNED _BIT          ~`                   0                              1                            1/8
' _BYTE                   %%                   -128                           127                          1
' _UNSIGNED _BYTE         ~%%                  0                              255                          1
' INTEGER                 %                    -32,768                        32,767                       2
' _UNSIGNED INTEGER       ~%                   0                              65,535                       2
' LONG                    &                    -2,147,483,648                 2,147,483,647                4
' _UNSIGNED LONG          ~&                   0                              4,294,967,295                4
' _INTEGER64              &&                   -9,223,372,036,854,775,808     9,223,372,036,854,775,807    8
' _UNSIGNED _INTEGER64    ~&&                  0                              18,446,744,073,709,551,615   8
' SINGLE                  ! or none            -2.802597E-45                  +3.402823E+38                4
' DOUBLE                  #                    -4.490656458412465E-324        +1.797693134862310E+308      8
' _FLOAT                  ##                   -1.18E-4932                    +1.18E+4932                  32(10 used)
' _OFFSET                 %&                   -9,223,372,036,854,775,808     9,223,372,036,854,775,807    Use LEN
' _UNSIGNED _OFFSET       ~%&                  0                              18,446,744,073,709,551,615   Use LEN
' _MEM                    none                 combined memory variable type  N/A                          Use LEN

' div: int1% = num1% \ den1%
' mod: rem1% = num1% MOD den1%

' @END

"PongSub33.bas":
Code: (Select All)
' ################################################################################################################################################################
' MULTI-MOUSE PONG sub-program "PongSub"
' ################################################################################################################################################################

' MULTI-MOUSE + KEYBOARD READER FOR MULTI MOUSE PONG v0.33 by Softintheheadware

' -------------------------------------------------------------------------------
' ABOUT
' -------------------------------------------------------------------------------
' Subprogram for "PONGMAIN.BAS"

' *****************************************************************************
' NOTES:
'
' The following header files must be in same folder as this program:
' "makeint.h"
' "winproc.h"
' *****************************************************************************

' -------------------------------------------------------------------------------
' TO DO
' -------------------------------------------------------------------------------
' Some issues and things to fix:
'
' * Hide the real mouse cursor and reactivate it when program closes.
'
' * Detect moving the scroll wheel.
'
' * Get it working with _FullScreen _SquarePixels.
'   When I tried that mode things got really weird.
'
' * Read input from multiple keyboards - need to figure out how to do the
'   unions in the RAWINPUT structure type in "Pongsub".
'   (Just need someone to figure this out, I have tried.)
'
' * Figure out how to get the same functionality for Mac & Linux.

' -------------------------------------------------------------------------------
' THANK YOU
' -------------------------------------------------------------------------------
' For the multi-mouse function, credit and thanks are due to:
' * jstookey who started the work that made this possible
' * SpriggsySpriggs who ported the hard stuff (APIs, events) to QB64 & QB64PE
' * SMcNeill who helped with so many things, most recently keeping the main window on top, getting file attributes
' * Steffan-68 for feedback, code for managing windows and ideas
' * DSMan195276 for the network code that lets the reader and main program talk smoothly
' * euklides, Ed Davis, mdijkens for file attributes code
' * grymmjack for words of encouragement
' * the QB64 and QB64PE communities for help with everything
' * (if I forgot anyone let me know!)

' -------------------------------------------------------------------------------
' CHANGES
' -------------------------------------------------------------------------------
' DATE        WHO        WHAT
' 2004-04-22  jstookey   added the ability to detect whether RawMouse is
'                        available or not so the application can either use a
'                        different multi-mouse system, or exit gracefully
'                        (thanks to Mark Healey).
' 2005-04-24  jstookey   Modified the code work with the latest version of
'                        MinGW. The new MinGW incorporates rawinput, so my
'                        winuser header and library is obsolete.
' 2006-03-05  jstookey   Initialized is_absolute and is_virtual_desktop to
'                        work better with newer versions of VStudio.
'                        Code at: https://jstookey.com/multiple-mice-raw-input/
' 2022-09-07  madscijr   Turned into a command line EXE that is called from
'                        QB64 with SpriggsySpriggs' pipecom from
'                        https://github.com/SpriggsySpriggs/Spriggsys-API-Collection/blob/master/Cross-Platform%20(Windows%2C%20Macintosh%2C%20Linux)/pipecomqb64.bas
'                        This version doesn't work.
' 2022-09-08  Spriggsy   Converted C to pure QB64 code.
' 2022-09-09  madscijr   Added demo code to move multiple objects on screen
'                        with separate mice independently.
' 2022-09-09  Spriggsy   Added a screen refresh.
' 2022-09-10  madscijr   Added detecting mouse buttons.
' 2024-05-19  madscijr   Try having the program write mice coordinates / button
'                        states to a file that main program "always on top"
'                        without focus can read.
' 2024-05-23  madscijr   Now we get mice coordinates from subprogram via TCPIP.
'                        A lot faster than using files!
'                        Thanks to DSMan195276 for the networking code.
' 2024-06-19  madscijr   Now we get absolute mouse coordinates not just dx, dy
'                        and can read the keyboard (just a single keyboard).
'                        Updated the graphics / display code to use layers.

' -------------------------------------------------------------------------------
' RAW INPUT RESOURCES
' -------------------------------------------------------------------------------
' Multiple Mice in Windows using Raw Input by jstookey
' * https://jstookey.com/multiple-mice-raw-input/
'
' One of the original QB64 threads
' * https://qb64phoenix.com/forum/showthread.php?tid=864
'
' Using Raw Input from C# to handle multiple keyboards by Emma Burrows, Steve Messer
' * https://www.codeproject.com/Articles/17123/Using-Raw-Input-from-C-to-handle-multiple-keyboard
'
' Microsoft's Raw Input API docs at pages around:
' * https://learn.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-rawinputheader
' * https://learn.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-rawinputdevicelist
'
' Looking at RAWINPUT for more detail (HACKADAY.IO)
' * https://hackaday.io/project/5364-cheap-windows-jogkeyboard-controller-for-cncs/log/16843-looking-at-rawinput-for-more-detail
'
' TimothyTimbers Raw Input Class for indie Game Developers:
' * https://www.unknowncheats.me/forum/c-and-c-/64318-raw-input-class-indie-game-developers.html
'
' WINDOWS PROGRAMMING: ACCESSING RAW INPUT by DAVID OREJUELA
' * https://davidorejuela.blogspot.com/2013/12/windows-programming-accessing-raw-input.html
'
' Explorations in Game Development: Why Raw Input?
' * https://explore-gamedev.blogspot.com/2013/09/why-raw-input.html

' Forum threads:
' * https://stackoverflow.com/questions/44935905/why-i-can-not-retrieve-rawinput-data-from-mouse
' * https://stackoverflow.com/questions/6423729/get-current-cursor-position
' * https://www.gamedev.net/forums/topic/700010-winapi-raw-input-confusion/
' * https://cplusplus.com/forum/windows/95700/
' * https://www.codeproject.com/Questions/118950/Raw-input-in-QT-library
' * https://docs.unity3d.com/ScriptReference/Windows.Input.ForwardRawInput.html
' * https://forum.freecad.org/viewtopic.php?style=2&t=28306&start=40
' * https://java-native-access.github.io/jna/5.4.0/javadoc/com/sun/jna/platform/win32/WinUser.RAWINPUTDEVICELIST.html
' * https://community.appeon.com/index.php/qna/q-a/how-can-i-catch-tab-key
' * https://forum.3dconnexion.com/viewtopic.php?t=2698
' * https://en.sfml-dev.org/forums/index.php?topic=15879.0
' * https://www.autoitscript.com/forum/topic/95105-hid-human-interface-device-communications-in-xp/page/2/
' * https://forum.unity.com/threads/new-input-system-get-raw-mouse-delta-from-wm_input.1177393/
' * https://forums.codeguru.com/showthread.php?541051-WM_Input-runtime-crash
' * https://discourse.libsdl.org/t/sdl-fixed-allocation-and-alignment-of-raw-input-buffers/48112
' * https://microsoft.public.dotnet.framework.interop.narkive.com/gWykTvfJ/reading-raw-data-from-a-hid-device
' * https://forum.qt.io/topic/66064/how-to-get-mouse-actual-position
' * https://forum.powerbasic.com/forum/user-to-user-discussions/powerbasic-for-windows/55985-raw-keyboard-hid-input-discussion
' * https://handmade.network/forums/t/7638-how_to_read_joystick_data_from_raw_input
' * https://microsoft.public.development.device.drivers.narkive.com/UWm0qmMb/getrawinputdata-usb-keyboard-with-power-keys
' * https://www.quakeworld.nu/forum/topic/3634/46374/getting-sensitivity-to-match-quake-
' * https://discourse.libsdl.org/t/sdl-fixed-windows-rawinput-crash/50150
' * https://squid.nt.tuwien.ac.at/gitlab/platzgummer/qgroundcontrol/commit/779f13f4e38c8d06fc2a74e594017d984e42c58e.diff
' * https://forums.codeguru.com/showthread.php?511656-How-to-get-interpreted-mouse-coords-from-raw-mouse-input
' * https://blog.naver.com/promaker72/50102194598
' * https://ubuntuforums.org/showthread.php?t=1543385

' Other pages with Raw Input info:
' * https://dev.to/igorsegallafa/avoiding-the-use-of-auto-clicker-keyboard-tools-5469
' * https://dev.opencascade.org/doc/refman/html/class_w_n_t___h_i_d_space_mouse.html
' * https://chromium.googlesource.com/experimental/chromium/src/+/refs/wip/bajones/webvr/device/gamepad/raw_input_data_fetcher_win.cc
' * https://bobobobo.wordpress.com/2010/04/21/rawinput/
' * https://sidestore.io/SideSource/interfaces/RawInput.html



Option Explicit
_Title "PongSub"
$NoPrefix
'$Console:Only
'Console Off

' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
' BEGIN CONSTANTS
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Const cProgName = "PongSub"
Const FALSE = 0
Const TRUE = Not FALSE
Const cDebugEnabled = FALSE

' FORM ALPHA VALUES
Const cInvisible = 1 ' for some reason a value of 0 (fully invisible) doesn't let the window get the focus, so we use 1
Const cTransparent = 160
Const cVisible = 255

' MIN/MAX VALUES FOR MOUSE TEST
Const cMinX = 1
Const cMaxX = 354 ' 160 ' 79 ' 80
Const cMinY = 1 ' 16
Const cMaxY = 45 ' 30 24
Const cMinWheel = 0
Const cMaxWheel = 255
Const cMinPX = 1
Const cMaxPX = 1024
Const cMinPY = 1
Const cMaxPY = 768

' CONSTANT FOR 2ND DIMENSION OF arrFile ARRAY
Const cFileName = 0
Const cFileData = 1
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
' END CONSTANTS
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

' ================================================================================================================================================================
' BEGIN API CONSTANTS
' ================================================================================================================================================================

' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
' FOR CONTROLLING WINDOW ON TOP, ETC.
Const SWP_NOSIZE = &H0001 'ignores cx and cy size parameters
'Const SWP_NOMOVE = &H0002 'ignores x and y position parameters
'Const SWP_NOZORDER = &H0004 'keeps z order and ignores hWndInsertAfter parameter
'Const SWP_NOREDRAW = &H0008 'does not redraw window changes
Const SWP_NOACTIVATE = &H0010 'does not activate window
'Const SWP_FRAMECHANGED = &H0020
'Const SWP_SHOWWINDOW = &H0040
'Const SWP_HIDEWINDOW = &H0080
'Const SWP_NOCOPYBITS = &H0100
'Const SWP_NOOWNERZORDER = &H0200
'Const SWP_NOSENDCHANGING = &H0400
'Const SWP_DRAWFRAME = SWP_FRAMECHANGED
'Const SWP_NOREPOSITION = SWP_NOOWNERZORDER
'Const SWP_DEFERERASE = &H2000
'Const SWP_ASYNCWINDOWPOS = &H4000
Const HWND_TOP = 0 'window at top of z order no focus
Const HWND_BOTTOM = 1 'window at bottom of z order no focus
Const HWND_TOPMOST = -1 'window above all others no focus unless active
Const HWND_NOTOPMOST = -2 'window below active no focus

' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
' FOR RAW INPUT API
Const COLOR_WINDOW = 5
Const CS_HREDRAW = &H0002
Const CS_VREDRAW = &H0001
Const CW_USEDEFAULT = &H80000000
Const DT_CENTER = &H00000001
Const DT_LEFT = &H00000000
Const DT_RIGHT = &H00000002
Const DT_VCENTER = &H00000004
Const DT_WORDBREAK = &H00000010
Const DT_SINGLELINE = &H00000020

Const Edit = 101
Const EM_GETSEL = &H00B0
Const EM_SETSEL = &H00B1
Const EN_CHANGE = &H0300
Const EN_KILLFOCUS = &H0200
Const EN_SETFOCUS = &H0100
Const GCL_HICON = -14
Const GCL_HICONSM = -34
Const Hid_Bottom = 66
Const Hid_Left = 33
Const Hid_Right = 34
Const HWND_DESKTOP = 0
Const ICON_BIG = 1
Const ICON_SMALL = 0
Const IDC_ARROW = 32512
Const IDI_APPLICATION = 32512
Const KEYEVENTF_KEYUP = &H0002
Const KL_NAMELENGTH = 9
Const LabelInfo = 201
Const MOUSE_ATTRIBUTES_CHANGED = &H04
Const MOUSE_MOVE_ABSOLUTE = &H01
Const MOUSE_MOVE_NOCOALESCE = &H08
Const MOUSE_MOVE_RELATIVE = &H00
Const MOUSE_VIRTUAL_DESKTOP = &H02
Const NULL = 0
Const RI_KEY_BREAK = 1
Const RI_KEY_E0 = 2
Const RI_KEY_E1 = 4
Const RI_KEY_MAKE = 0
Const RI_KEY_TERMSRV_SET_LED = 8
Const RI_KEY_TERMSRV_SHADOW = &H10
Const RID_INPUT = &H10000003
Const RIDEV_EXINPUTSINK = &H00001000
Const RIDI_DEVICEINFO = &H2000000B

Const RIM_TYPEMOUSE = 0
Const RIM_TYPEKEYBOARD = 1
Const RIM_TYPEHID = 2
Const RIM_TYPEUNKNOWN = -1 ' just a made up value to indicate type unknown

Const SIZE_MINIMIZED = 1
Const SW_SHOW = 5

' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
' BEGIN Virtual-Key Codes
' https://learn.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes
' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
' NOTE: raw.data.Keyboard.vKey may require set extended bit
Const VK_LBUTTON = &H01 ' dec = 1, Left mouse button
Const VK_RBUTTON = &H02 ' dec = 2, Right mouse button
Const VK_CANCEL = &H03 ' dec = 3, Control-break processing
Const VK_MBUTTON = &H04 ' dec = 4, Middle mouse button
Const VK_XBUTTON1 = &H05 ' dec = 5, X1 mouse button
Const VK_XBUTTON2 = &H06 ' dec = 6, X2 mouse button
'??? = &H07 ' dec = 7, Reserved
Const VK_BACK = &H08 ' dec = 8, BACKSPACE key
Const VK_TAB = &H09 ' dec = 9, TAB key
'??? = &H0A-0B ' dec = 10-11, Reserved
Const VK_CLEAR = &H0C ' dec = 12, CLEAR key
Const VK_RETURN = &H0D ' dec = 13, ENTER key
'??? = &H0E-0F ' dec = 14-15, Unassigned
Const VK_SHIFT = &H10 ' dec = 16, SHIFT key
Const VK_CONTROL = &H11 ' dec = 17, CTRL key
Const VK_MENU = &H12 ' dec = 18, ALT key
Const VK_PAUSE = &H13 ' dec = 19, PAUSE key
Const VK_CAPITAL = &H14 ' dec = 20, CAPS LOCK key
Const VK_KANA = &H15 ' dec = 21, IME Kana mode
Const VK_HANGUL = &H15 ' dec = 21, IME Hangul mode
Const VK_IME_ON = &H16 ' dec = 22, IME On
Const VK_JUNJA = &H17 ' dec = 23, IME Junja mode
Const VK_FINAL = &H18 ' dec = 24, IME final mode
Const VK_HANJA = &H19 ' dec = 25, IME Hanja mode
Const VK_KANJI = &H19 ' dec = 25, IME Kanji mode
Const VK_IME_OFF = &H1A ' dec = 26, IME Off
Const VK_ESCAPE = &H1B ' dec = 27, ESC key
Const VK_CONVERT = &H1C ' dec = 28, IME convert
Const VK_NONCONVERT = &H1D ' dec = 29, IME nonconvert
Const VK_ACCEPT = &H1E ' dec = 30, IME accept
Const VK_MODECHANGE = &H1F ' dec = 31, IME mode change request
Const VK_SPACE = &H20 ' dec = 32, SPACEBAR
Const VK_PRIOR = &H21 ' dec = 33, PAGE UP key
Const VK_NEXT = &H22 ' dec = 34, PAGE DOWN key
Const VK_END = &H23 ' dec = 35, END key
Const VK_HOME = &H24 ' dec = 36, HOME key
Const VK_LEFT = &H25 ' dec = 37, LEFT ARROW key
Const VK_UP = &H26 ' dec = 38, UP ARROW key
Const VK_RIGHT = &H27 ' dec = 39, RIGHT ARROW key
Const VK_DOWN = &H28 ' dec = 40, DOWN ARROW key
Const VK_SELECT = &H29 ' dec = 41, SELECT key
Const VK_PRINT = &H2A ' dec = 42, PRINT key
Const VK_EXECUTE = &H2B ' dec = 43, EXECUTE key
Const VK_SNAPSHOT = &H2C ' dec = 44, PRINT SCREEN key
Const VK_INSERT = &H2D ' dec = 45, INS key
Const VK_DELETE = &H2E ' dec = 46, DEL key
Const VK_HELP = &H2F ' dec = 47, HELP key

' MADE OUR OWN CONSTANTS FOR THESE:
Const VK_0 = &H30 ' dec = 48, 0 key
Const VK_1 = &H31 ' dec = 49, 1 key
Const VK_2 = &H32 ' dec = 50, 2 key
Const VK_3 = &H33 ' dec = 51, 3 key
Const VK_4 = &H34 ' dec = 52, 4 key
Const VK_5 = &H35 ' dec = 53, 5 key
Const VK_6 = &H36 ' dec = 54, 6 key
Const VK_7 = &H37 ' dec = 55, 7 key
Const VK_8 = &H38 ' dec = 56, 8 key
Const VK_9 = &H39 ' dec = 57, 9 key
'??? = &H3A-40 ' dec = 58-64, Undefined
Const VK_A = &H41 ' dec = 65, A key
Const VK_B = &H42 ' dec = 66, B key
Const VK_C = &H43 ' dec = 67, C key
Const VK_D = &H44 ' dec = 68, D key
Const VK_E = &H45 ' dec = 69, E key
Const VK_F = &H46 ' dec = 70, F key
Const VK_G = &H47 ' dec = 71, G key
Const VK_H = &H48 ' dec = 72, H key
Const VK_I = &H49 ' dec = 73, I key
Const VK_J = &H4A ' dec = 74, J key
Const VK_K = &H4B ' dec = 75, K key
Const VK_L = &H4C ' dec = 76, L key
Const VK_M = &H4D ' dec = 77, M key
Const VK_N = &H4E ' dec = 78, N key
Const VK_O = &H4F ' dec = 79, O key
Const VK_P = &H50 ' dec = 80, P key
Const VK_Q = &H51 ' dec = 81, Q key
Const VK_R = &H52 ' dec = 82, R key
Const VK_S = &H53 ' dec = 83, S key
Const VK_T = &H54 ' dec = 84, T key
Const VK_U = &H55 ' dec = 85, U key
Const VK_V = &H56 ' dec = 86, V key
Const VK_W = &H57 ' dec = 87, W key
Const VK_X = &H58 ' dec = 88, X key
Const VK_Y = &H59 ' dec = 89, Y key
Const VK_Z = &H5A ' dec = 90, Z key

' Microsoft's Virtual-Key Codes constants (continued):
Const VK_LWIN = &H5B ' dec = 91, Left Windows key
Const VK_RWIN = &H5C ' dec = 92, Right Windows key
Const VK_APPS = &H5D ' dec = 93, Applications key
'??? = &H5E ' dec = 94, Reserved
Const VK_SLEEP = &H5F ' dec = 95, Computer Sleep key
Const VK_NUMPAD0 = &H60 ' dec = 96, Numeric keypad 0 key
Const VK_NUMPAD1 = &H61 ' dec = 97, Numeric keypad 1 key
Const VK_NUMPAD2 = &H62 ' dec = 98, Numeric keypad 2 key
Const VK_NUMPAD3 = &H63 ' dec = 99, Numeric keypad 3 key
Const VK_NUMPAD4 = &H64 ' dec = 100, Numeric keypad 4 key
Const VK_NUMPAD5 = &H65 ' dec = 101, Numeric keypad 5 key
Const VK_NUMPAD6 = &H66 ' dec = 102, Numeric keypad 6 key
Const VK_NUMPAD7 = &H67 ' dec = 103, Numeric keypad 7 key
Const VK_NUMPAD8 = &H68 ' dec = 104, Numeric keypad 8 key
Const VK_NUMPAD9 = &H69 ' dec = 105, Numeric keypad 9 key
Const VK_MULTIPLY = &H6A ' dec = 106, Multiply key
Const VK_ADD = &H6B ' dec = 107, Add key
Const VK_SEPARATOR = &H6C ' dec = 108, Separator key
Const VK_SUBTRACT = &H6D ' dec = 109, Subtract key
Const VK_DECIMAL = &H6E ' dec = 110, Decimal key
Const VK_DIVIDE = &H6F ' dec = 111, Divide key
Const VK_F1 = &H70 ' dec = 112, F1 key
Const VK_F2 = &H71 ' dec = 113, F2 key
Const VK_F3 = &H72 ' dec = 114, F3 key
Const VK_F4 = &H73 ' dec = 115, F4 key
Const VK_F5 = &H74 ' dec = 116, F5 key
Const VK_F6 = &H75 ' dec = 117, F6 key
Const VK_F7 = &H76 ' dec = 118, F7 key
Const VK_F8 = &H77 ' dec = 119, F8 key
Const VK_F9 = &H78 ' dec = 120, F9 key
Const VK_F10 = &H79 ' dec = 121, F10 key
Const VK_F11 = &H7A ' dec = 122, F11 key
Const VK_F12 = &H7B ' dec = 123, F12 key
Const VK_F13 = &H7C ' dec = 124, F13 key
Const VK_F14 = &H7D ' dec = 125, F14 key
Const VK_F15 = &H7E ' dec = 126, F15 key
Const VK_F16 = &H7F ' dec = 127, F16 key
Const VK_F17 = &H80 ' dec = 128, F17 key
Const VK_F18 = &H81 ' dec = 129, F18 key
Const VK_F19 = &H82 ' dec = 130, F19 key
Const VK_F20 = &H83 ' dec = 131, F20 key
Const VK_F21 = &H84 ' dec = 132, F21 key
Const VK_F22 = &H85 ' dec = 133, F22 key
Const VK_F23 = &H86 ' dec = 134, F23 key
Const VK_F24 = &H87 ' dec = 135, F24 key
'??? = &H88-8F ' dec = 136-143, Reserved
Const VK_NUMLOCK = &H90 ' dec = 144, NUM LOCK key
Const VK_SCROLL = &H91 ' dec = 145, SCROLL LOCK key
'??? = &H92-96 ' dec = 146-150, OEM specific
'??? = &H97-9F ' dec = 151-159, Unassigned
Const VK_LSHIFT = &HA0 ' dec = 160, Left SHIFT key
Const VK_RSHIFT = &HA1 ' dec = 161, Right SHIFT key
Const VK_LCONTROL = &HA2 ' dec = 162, Left CONTROL key
Const VK_RCONTROL = &HA3 ' dec = 163, Right CONTROL key
Const VK_LMENU = &HA4 ' dec = 164, Left ALT key
Const VK_RMENU = &HA5 ' dec = 165, Right ALT key
Const VK_BROWSER_BACK = &HA6 ' dec = 166, Browser Back key
Const VK_BROWSER_FORWARD = &HA7 ' dec = 167, Browser Forward key
Const VK_BROWSER_REFRESH = &HA8 ' dec = 168, Browser Refresh key
Const VK_BROWSER_STOP = &HA9 ' dec = 169, Browser Stop key
Const VK_BROWSER_SEARCH = &HAA ' dec = 170, Browser Search key
Const VK_BROWSER_FAVORITES = &HAB ' dec = 171, Browser Favorites key
Const VK_BROWSER_HOME = &HAC ' dec = 172, Browser Start and Home key
Const VK_VOLUME_MUTE = &HAD ' dec = 173, Volume Mute key
Const VK_VOLUME_DOWN = &HAE ' dec = 174, Volume Down key
Const VK_VOLUME_UP = &HAF ' dec = 175, Volume Up key
Const VK_MEDIA_NEXT_TRACK = &HB0 ' dec = 176, Next Track key
Const VK_MEDIA_PREV_TRACK = &HB1 ' dec = 177, Previous Track key
Const VK_MEDIA_STOP = &HB2 ' dec = 178, Stop Media key
Const VK_MEDIA_PLAY_PAUSE = &HB3 ' dec = 179, Play/Pause Media key
Const VK_LAUNCH_MAIL = &HB4 ' dec = 180, Start Mail key
Const VK_LAUNCH_MEDIA_SELECT = &HB5 ' dec = 181, Select Media key
Const VK_LAUNCH_APP1 = &HB6 ' dec = 182, Start Application 1 key
Const VK_LAUNCH_APP2 = &HB7 ' dec = 183, Start Application 2 key
'??? = &HB8-B9 ' dec = 184-137, Reserved
Const VK_OEM_1 = &HBA ' dec = 186, Used for miscellaneous characters; it can vary by keyboard. For the US standard keyboard, the ;: key
Const VK_OEM_PLUS = &HBB ' dec = 187, For any country/region, the + key
Const VK_OEM_COMMA = &HBC ' dec = 188, For any country/region, the , key
Const VK_OEM_MINUS = &HBD ' dec = 189, For any country/region, the - key
Const VK_OEM_PERIOD = &HBE ' dec = 190, For any country/region, the . key
Const VK_OEM_2 = &HBF ' dec = 191, Used for miscellaneous characters; it can vary by keyboard. For the US standard keyboard, the /? key
Const VK_OEM_3 = &HC0 ' dec = 192, Used for miscellaneous characters; it can vary by keyboard. For the US standard keyboard, the `~ key
'??? = &HC1-DA ' dec = 193-218, Reserved
Const VK_OEM_4 = &HDB ' dec = 219, Used for miscellaneous characters; it can vary by keyboard. For the US standard keyboard, the [{ key
Const VK_OEM_5 = &HDC ' dec = 220, Used for miscellaneous characters; it can vary by keyboard. For the US standard keyboard, the \\| key
Const VK_OEM_6 = &HDD ' dec = 221, Used for miscellaneous characters; it can vary by keyboard. For the US standard keyboard, the ]} key
Const VK_OEM_7 = &HDE ' dec = 222, Used for miscellaneous characters; it can vary by keyboard. For the US standard keyboard, the '" key
Const VK_OEM_8 = &HDF ' dec = 223, Used for miscellaneous characters; it can vary by keyboard.
'??? = &HE0 ' dec = 224, Reserved
'??? = &HE1 ' dec = 225, OEM specific
Const VK_OEM_102 = &HE2 ' dec = 226, The <> keys on the US standard keyboard, or the \\| key on the non-US 102-key keyboard
'??? = &HE3-E4 ' dec = 227-228, OEM specific
Const VK_PROCESSKEY = &HE5 ' dec = 229, IME PROCESS key
'??? = &HE6 ' dec = 230, OEM specific
Const VK_PACKET = &HE7 ' dec = 231, Used to pass Unicode characters as if they were keystrokes. The VK_PACKET key is the low word of a 32-bit Virtual Key value used for non-keyboard input methods. For more information, see Remark in KEYBDINPUT, SendInput, WM_KEYDOWN, and WM_KEYUP
'??? = &HE8 ' dec = 232, Unassigned
'??? = &HE9-F5 ' dec = 233-245, OEM specific
Const VK_ATTN = &HF6 ' dec = 246, Attn key
Const VK_CRSEL = &HF7 ' dec = 247, CrSel key
Const VK_EXSEL = &HF8 ' dec = 248, ExSel key
Const VK_EREOF = &HF9 ' dec = 249, Erase EOF key
Const VK_PLAY = &HFA ' dec = 250, Play key
Const VK_ZOOM = &HFB ' dec = 251, Zoom key
Const VK_NONAME = &HFC ' dec = 252, Reserved
Const VK_PA1 = &HFD ' dec = 253, PA1 key
Const VK_OEM_CLEAR = &HFE ' dec = 254, Clear key
' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
' END Virtual-Key Codes
' ----------------------------------------------------------------------------------------------------------------------------------------------------------------

' Messages a window receives through or sends from its WindowProc function:
' DefWindowProcA function (winuser.h)
' https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-defwindowproca
Const WM_APP = &H08000 ' dec=32768
Const WM_APPCOMMAND = &H0319 ' dec=793
Const WM_CHAR = &H0102 ' dec=258
Const WM_COMMAND = &H0111 ' dec=273
Const WM_DEADCHAR = &H0103 ' dec=259
Const WM_DESTROY = &H0002 ' dec=2
Const WM_INITDIALOG = &H0110 ' dec=272
Const WM_INPUT = &H00FF ' dec=255
Const WM_KEYDOWN = &H0100 ' dec=256
Const WM_KEYUP = &H0101 ' dec=257
Const WM_MOUSEMOVE = &H0200 ' dec=512
Const WM_NCACTIVATE = &H0086 ' dec=134
Const WM_NEXTDLGCTL = &H28 ' dec=40
Const WM_PAINT = &H000F ' dec=15
Const WM_SETICON = &H0080 ' dec=128
Const WM_SIZE = &H0005 ' dec=5
Const WM_SYSCHAR = &H0106 ' dec=262
Const WM_SYSDEADCHAR = &H0107 ' dec=263
Const WM_SYSKEYDOWN = &H0104 ' dec=260
Const WM_SYSKEYUP = &H0105 ' dec=261
Const WM_UNICHAR = &H0109 ' dec=265

' CONSTANTS USED FOR WINDOWS STYLES & FEATURES, SEE:
' Window Styles
' https://learn.microsoft.com/en-us/windows/win32/winmsg/window-styles
' Window Features
' https://learn.microsoft.com/en-us/windows/win32/winmsg/window-features
Const WS_CAPTION = &H00C00000 ' dec=12582912
Const WS_CHILD = &H40000000 ' dec=1073741824
Const WS_MAXIMIZEBOX = &H00010000 ' dec=65536
Const WS_MINIMIZEBOX = &H00020000 ' dec=131072
Const WS_OVERLAPPED = &H00000000 ' dec=0
Const WS_SYSMENU = &H00080000 ' dec=524288
Const WS_THICKFRAME = &H00040000 ' dec=262144
Const WS_VISIBLE = &H10000000 ' dec=268435456
Const WS_OVERLAPPEDWINDOW = WS_OVERLAPPED Or WS_CAPTION Or WS_SYSMENU Or WS_THICKFRAME Or WS_MINIMIZEBOX Or WS_MAXIMIZEBOX

' CONSTANTS USED BY MapVirtualKey FOR PARAMETER uMapType
' https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-mapvirtualkeya
Const MAPVK_VK_TO_VSC = 0 ' The uCode parameter is a virtual-key code and is translated into a scan code. If it is a virtual-key code that does not distinguish between left- and right-hand keys, the left-hand scan code is returned. If there is no translation, the function returns 0.
Const MAPVK_VSC_TO_VK = 1 ' The uCode parameter is a scan code and is translated into a virtual-key code that does not distinguish between left- and right-hand keys. If there is no translation, the function returns 0. Windows Vista and later: the high byte of the uCode value can contain either 0xe0 or 0xe1 to specify the extended scan code.
Const MAPVK_VK_TO_CHAR = 2 ' The uCode parameter is a virtual-key code and is translated into an unshifted character value in the low order word of the return value. Dead keys (diacritics) are indicated by setting the top bit of the return value. If there is no translation, the function returns 0. See Remarks.
Const MAPVK_VSC_TO_VK_EX = 3 ' The uCode parameter is a scan code and is translated into a virtual-key code that distinguishes between left- and right-hand keys. If there is no translation, the function returns 0. Windows Vista and later: the high byte of the uCode value can contain either 0xe0 or 0xe1 to specify the extended scan code.
Const MAPVK_VK_TO_VSC_EX = 4 ' Windows Vista and later: The uCode parameter is a virtual-key code and is translated into a scan code. If it is a virtual-key code that does not distinguish between left- and right-hand keys, the left-hand scan code is returned. If the scan code is an extended scan code, the high byte of the returned value will contain either 0xe0 or 0xe1 to specify the extended scan code. If there is no translation, the function returns 0.

' ================================================================================================================================================================
' END API CONSTANTS
' ================================================================================================================================================================

' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
' BEGIN RAW INPUT TYPES
' FOR TYPE CONVERSION SEE: "QB64PE C Libraries" at:
' https://qb64phoenix.com/qb64wiki/index.php/C_Libraries
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
'RAWINPUTDEVICE structure (winuser.h)
'https://learn.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-rawinputdevice
'typedef struct tagRAWINPUTDEVICE {
'  USHORT usUsagePage;
'  USHORT usUsage;
'  DWORD  dwFlags;
'  HWND   hwndTarget;
'} RAWINPUTDEVICE, *PRAWINPUTDEVICE, *LPRAWINPUTDEVICE;

' Spriggsy's version:
Type RAWINPUTDEVICE
    As Unsigned Integer usUsagePage, usUsage
    As Unsigned Long dwFlags
    As Offset hwndTarget
End Type

' ^^^ Should "Unsigned Integer" be "_UNSIGNED INTEGER"
'     and    "Unsigned Long" be "_UNSIGNED LONG"
'     and    "Offset" be "_OFFSET" like this?:
'
'TYPE RAWINPUTDEVICE
'    usUsagePage AS _UNSIGNED INTEGER ' WORD
'    usUsage     AS _UNSIGNED INTEGER ' WORD
'    dwFlags     AS _UNSIGNED LONG ' DWORD
'    hwndTarget  AS _OFFSET ' DWORD
'END TYPE

' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
'RAWINPUTDEVICELIST structure (winuser.h)
'https://learn.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-rawinputdevicelist
'typedef struct tagRAWINPUTDEVICELIST {
'  HANDLE hDevice;
'  DWORD  dwType;
'} RAWINPUTDEVICELIST, *PRAWINPUTDEVICELIST;

' Spriggsy's version:
Type RAWINPUTDEVICELIST
    As Offset hDevice
    As Unsigned Long dwType
    $If 64BIT Then
        As String * 4 alignment
    $End If
End Type

' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
'POINT structure (windef.h)
'https://learn.microsoft.com/en-us/windows/win32/api/windef/ns-windef-point
'typedef struct tagPOINT {
'  LONG x;
'  LONG y;
'} POINT, *PPOINT, *NPPOINT, *LPPOINT;

Type POINT
    As Long x, y
End Type

' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
'MSG structure (winuser.h)
'https://learn.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-msg
'typedef struct tagMSG {
'  HWND   hwnd;
'  UINT   message;
'  WPARAM wParam;
'  LPARAM lParam;
'  DWORD  time;
'  POINT  pt;
'  DWORD  lPrivate;
'} MSG, *PMSG, *NPMSG, *LPMSG;

Type MSG
    As Offset hwnd
    As Unsigned Long message
    As Unsigned Offset wParam
    As Offset lParam
    As Long time
    As POINT pt
    As Long lPrivate
End Type

' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
'WNDCLASSEXA structure (winuser.h)
'https://learn.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-wndclassexa
'typedef struct WNDCLASSEXA {
'  UINT      cbSize;
'  UINT      style;
'  WNDPROC   lpfnWndProc;
'  int       cbClsExtra;
'  int       cbWndExtra;
'  HINSTANCE hInstance;
'  HICON     hIcon;
'  HCURSOR   hCursor;
'  HBRUSH    hbrBackground;
'  LPCSTR    lpszMenuName;
'  LPCSTR    lpszClassName;
'  HICON     hIconSm;
'} WNDCLASSEXA, *PWNDCLASSEXA, *NPWNDCLASSEXA, *LPWNDCLASSEXA;
Type WNDCLASSEX
    As Unsigned Long cbSize, style
    As Offset lpfnWndProc
    As Long cbClsExtra, cbWndExtra
    As Offset hInstance, hIcon, hCursor, hbrBackground, lpszMenuName, lpszClassName, hIconSm
End Type

' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
'RECT structure (windef.h)
'https://learn.microsoft.com/en-us/windows/win32/api/windef/ns-windef-rect
'typedef struct tagRECT {
'  LONG left;     Specifies the x-coordinate of the upper-left corner of the rectangle.
'  LONG top;      Specifies the y-coordinate of the upper-left corner of the rectangle.
'  LONG right;    Specifies the x-coordinate of the lower-right corner of the rectangle.
'  LONG bottom;   Specifies the y-coordinate of the lower-right corner of the rectangle.
'} RECT, *PRECT, *NPRECT, *LPRECT;
Type RECT
    As Long left, top, right, bottom
End Type

' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
'PAINTSTRUCT structure (winuser.h)
'https://learn.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-paintstruct
'typedef struct tagPAINTSTRUCT {
'  HDC  hdc;
'  BOOL fErase;
'  RECT rcPaint;
'  BOOL fRestore;
'  BOOL fIncUpdate;
'  BYTE rgbReserved[32];
'} PAINTSTRUCT, *PPAINTSTRUCT, *NPPAINTSTRUCT, *LPPAINTSTRUCT;
Type PAINTSTRUCT
    As Offset hdc
    As Long fErase
    $If 64BIT Then
        As String * 4 alignment
    $End If
    As RECT rcPaint
    As Long fRestore, fIncUpdate
    As String * 32 rgbReserved
End Type

' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
'RAWINPUTHEADER structure (winuser.h)
'https://learn.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-rawinputheader
'typedef struct tagRAWINPUTHEADER {
'  DWORD  dwType;
'  DWORD  dwSize;
'  HANDLE hDevice;
'  WPARAM wParam;
'} RAWINPUTHEADER, *PRAWINPUTHEADER, *LPRAWINPUTHEADER;

' Spriggsy's version:
Type RAWINPUTHEADER
    As Unsigned Long dwType, dwSize
    As Offset hDevice
    As Unsigned Offset wParam
End Type

' ^^^ Doesn't match the types I expected, should it be these?:
'TYPE RAWINPUTHEADER
'    dwType  AS _UNSIGNED LONG ' DWORD
'    dwSize  AS _UNSIGNED LONG ' DWORD
'    hDevice AS _UNSIGNED LONG ' DWORD <- should this be _OFFSET ?
'    wParam  AS LONG
'END TYPE

' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
'RAWMOUSE structure (winuser.h)
'https://learn.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-rawmouse
'typedef struct tagRAWMOUSE {
'  USHORT usFlags;
'  union {
'    ULONG ulButtons;
'    struct {
'      USHORT usButtonFlags;
'      USHORT usButtonData;
'    } DUMMYSTRUCTNAME;
'  } DUMMYUNIONNAME2;
'  ULONG  ulRawButtons;
'  LONG   lLastX;
'  LONG   lLastY;
'  ULONG  ulExtraInformation;
'} RAWMOUSE, *PRAWMOUSE, *LPRAWMOUSE;

' Spriggsy's simplified version:
Type RAWMOUSE
    As Unsigned Integer usFlags
    $If 64BIT Then
        As String * 2 alignment
    $End If
    'As Unsigned Long ulButtons  'commented out because I'm creating this value using MAKELONG
    As Unsigned Integer usButtonFlags, usButtonData
    As Unsigned Long ulRawButtons
    As Long lLastX, lLastY
    As Unsigned Long ulExtraInformation
End Type

' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
'RAWKEYBOARD structure (winuser.h)
'https://learn.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-rawkeyboard
'typedef struct tagRAWKEYBOARD {
'  USHORT MakeCode;
'  USHORT Flags;
'  USHORT Reserved;
'  USHORT VKey;
'  UINT   Message;
'  ULONG  ExtraInformation;
'} RAWKEYBOARD, *PRAWKEYBOARD, *LPRAWKEYBOARD;
Type RAWKEYBOARD
    MakeCode As _Unsigned Integer ' USHORT
    Flags As _Unsigned Integer ' USHORT
    Reserved As _Unsigned Integer ' USHORT
    VKey As _Unsigned Integer ' USHORT
    Message As _Unsigned Long ' UINT
    ExtraInformation As _Unsigned _Offset ' ULONG
End Type

' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
'RAWINPUT structure (winuser.h)
'https://learn.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-rawinput
'typedef struct tagRAWINPUT {
'  RAWINPUTHEADER header;
'  union {
'    RAWMOUSE    mouse;
'    RAWKEYBOARD keyboard;
'    RAWHID      hid;
'  } data;
'} RAWINPUT, *PRAWINPUT, *LPRAWINPUT;

' Spriggsy's simplified version:
Type RAWINPUT
    As RAWINPUTHEADER header
    As RAWMOUSE mouse
    'As RAWKEYBOARD keyboard <- ADDING THIS CAUSES THE PROGRAM TO CRASH ON MOUSE INPUT
End Type

' Simplified copy for keyboard:
Type RAWINPUT_K
    As RAWINPUTHEADER header
    As RAWKEYBOARD keyboard
End Type

' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
'RID_DEVICE_INFO_MOUSE structure (winuser.h)
'https://learn.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-rid_device_info_mouse
'typedef struct tagRID_DEVICE_INFO_MOUSE {
'  DWORD dwId;
'  DWORD dwNumberOfButtons;
'  DWORD dwSampleRate;
'  BOOL  fHasHorizontalWheel;
'} RID_DEVICE_INFO_MOUSE, *PRID_DEVICE_INFO_MOUSE;
Type RID_DEVICE_INFO_MOUSE
    dwId As _Unsigned Long
    dwNumberOfButtons As _Unsigned Long
    dwSampleRate As _Unsigned Long
    fHasHorizontalWheel As Integer
End Type

' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
'RID_DEVICE_INFO_KEYBOARD structure (winuser.h)
'https://learn.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-rid_device_info_keyboard
'typedef struct tagRID_DEVICE_INFO_KEYBOARD {
'  DWORD dwType;
'  DWORD dwSubType;
'  DWORD dwKeyboardMode;
'  DWORD dwNumberOfFunctionKeys;
'  DWORD dwNumberOfIndicators;
'  DWORD dwNumberOfKeysTotal;
'} RID_DEVICE_INFO_KEYBOARD, *PRID_DEVICE_INFO_KEYBOARD;
Type RID_DEVICE_INFO_KEYBOARD
    dwType As _Unsigned Long ' DWORD
    dwSubType As _Unsigned Long ' DWORD
    dwKeyboardMode As _Unsigned Long ' DWORD
    dwNumberOfFunctionKeys As _Unsigned Long ' DWORD
    dwNumberOfIndicators As _Unsigned Long ' DWORD
    dwNumberOfKeysTotal As _Unsigned Long ' DWORD
End Type

' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
'RID_DEVICE_INFO_HID structure (winuser.h)
'https://learn.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-rid_device_info_hid
'typedef struct tagRID_DEVICE_INFO_HID {
'  DWORD  dwVendorId;
'  DWORD  dwProductId;
'  DWORD  dwVersionNumber;
'  USHORT usUsagePage;
'  USHORT usUsage;
'} RID_DEVICE_INFO_HID, *PRID_DEVICE_INFO_HID;
Type RID_DEVICE_INFO_HID
    dwVendorId As _Unsigned Long ' DWORD
    dwProductId As _Unsigned Long ' DWORD
    dwVersionNumber As _Unsigned Long ' DWORD
    usUsagePage As _Unsigned Integer ' USHORT
    usUsage As _Unsigned Integer ' USHORT
End Type

' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
' NEEDS FIXING:

'RID_DEVICE_INFO structure (winuser.h)
'https://learn.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-rid_device_info
'typedef struct tagRID_DEVICE_INFO {
'  DWORD cbSize;
'  DWORD dwType;
'  union {
'    RID_DEVICE_INFO_MOUSE    mouse;
'    RID_DEVICE_INFO_KEYBOARD keyboard;
'    RID_DEVICE_INFO_HID      hid;
'  } DUMMYUNIONNAME1;
'} RID_DEVICE_INFO, *PRID_DEVICE_INFO, *LPRID_DEVICE_INFO;

' ^^^ NOT SURE HOW TO DEFINE THIS, SHOULD IT BE SOMETHING LIKE THIS?:

'Type DUMMYUNIONNAME1
'    My_RID_DEVICE_INFO_MOUSE As _Offset ' pointer to VAR A1
'    My_RID_DEVICE_INFO_KEYBOARD As _Offset ' pointer to VAR A2
'    My_RID_DEVICE_INFO_HID As _Offset ' pointer to VAR A3
'End Type
'Type RID_DEVICE_INFO
'    cbSize As _Unsigned Long ' DWORD
'    dwType As _Unsigned Long ' DWORD
'    My_DUMMYUNIONNAME1 As _Offset ' pointer to DUMMYUNIONNAME1
'End Type

' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
'RAWHID structure (winuser.h)
'https://learn.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-rawhid
'typedef struct tagRAWHID {
'  DWORD dwSizeHid;
'  DWORD dwCount;
'  BYTE  bRawData[1];
'} RAWHID, *PRAWHID, *LPRAWHID;
Type RAWHID
    dwSizeHid As _Unsigned Long ' DWORD
    dwCount As _Unsigned Long ' DWORD
    bRawData As _Unsigned _Byte ' bRawData[1] AS BYTE
End Type

' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
' END RAW INPUT TYPES
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
' BEGIN CUSTOM TYPES
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
' UDT TO HOLD THE INFO FOR EACH MOUSE (READ MICE SUB)
Type MouseInfoType
    ID As String ' player identifier or mouse device ID

    char As String ' cursor character

    dx As Integer ' mouse x movement -1=left, 1=right, 0=none
    dy As Integer ' mouse y movement -1=up  , 1=down , 0=none

    px As Long ' pointer x position (hires) for absolute position of mouse from raw input api
    py As Long ' pointer y position (hires) for absolute position of mouse from raw input api

    ' Multimouse:
    pdx As Long ' mouse x movement (hires) can be greater than just -1 or +1
    pdy As Long ' mouse y movement (hires) can be greater than just -1 or +1

    wheel As Integer ' mouse wheel value
    'wheelOld As Integer ' old mouse wheel value

    LeftDown As Integer ' tracks left mouse button state, TRUE=down
    'LeftDownOld As Integer ' old left mouse button state, TRUE=down

    MiddleDown As Integer ' tracks middle mouse button state, TRUE=down
    'MiddleDownOld As Integer ' old middle mouse button state, TRUE=down

    RightDown As Integer ' tracks right mouse button state, TRUE=down
    'RightDownOld As Integer ' old right mouse button state, TRUE=down
End Type ' MouseInfoType

' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
' END CUSTOM TYPES
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
' BEGIN API DECLARATIONS
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

' ================================================================================================================================================================
' BEGIN CustomType Library definitions
' ================================================================================================================================================================
' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
' FOR RAW INPUT API
' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
Declare CustomType Library
    'DECLARE FUNCTION GetRawInputDeviceList LIB "USER32.DLL" ALIAS "GetRawInputDeviceList"( _
    '    BYREF pRawInputDeviceList AS RAWINPUTDEVICELIST, _
    '    BYREF puiNumDevices AS _UNSIGNED LONG, _
    '    BYVAL cbSize AS _UNSIGNED LONG _
    '    ) AS _UNSIGNED LONG
    Function GetRawInputDeviceList~& (ByVal pRawInputDeviceList As Offset, Byval puiNumDevices As Offset, Byval cbSize As Unsigned Long)

    Sub GetRawInputDeviceList (ByVal pRawInputDeviceList As Offset, Byval puiNumDevices As Offset, Byval cbSize As Unsigned Long)

    'DECLARE FUNCTION RegisterRawInputDevices LIB "USER32.DLL" ALIAS "RegisterRawInputDevices"( _
    '    BYREF pRawInputDevices AS RAWINPUTDEVICE, _
    '    BYVAL uiNumDevices AS _UNSIGNED LONG, _
    '    BYVAL cbSize AS _UNSIGNED LONG _
    '    ) AS LONG
    Function RegisterRawInputDevices& (ByVal pRawInputDevices As Offset, Byval uiNumDevices As Unsigned Long, Byval cbSize As Unsigned Long)

    Function GetModuleHandle%& (ByVal lpModulename As Offset)
    Function LoadIcon%& (ByVal hInstance As Offset, Byval lpIconName As Offset)
    Function LoadCursor%& (ByVal hInstance As Offset, Byval lpCursorName As Offset)
    Function RegisterClassEx~% (ByVal wndclassex As Offset)
    Function CreateWindowEx%& (ByVal dwExStyle As Unsigned Long, Byval lpClassName As Offset, Byval lpWindowName As Offset, Byval dwStyle As Unsigned Long, Byval x As Long, Byval y As Long, Byval nWidth As Long, Byval nHeight As Long, Byval hWndParent As Offset, Byval hMenu As Offset, Byval hInstance As Offset, Byval lpParam As Offset)
    Sub ShowWindow (ByVal hWnd As Offset, Byval nCmdShow As Long)
    Sub UpdateWindow (ByVal hWnd As Offset)
    Function GetMessage& (ByVal lpMsg As Offset, Byval hWnd As Offset, Byval wMsgFilterMin As Unsigned Long, Byval wMsgFilterMax As Unsigned Long)
    Sub TranslateMessage (ByVal lpMsg As Offset)
    Sub DispatchMessage (ByVal lpMsg As Offset)
    Sub PostQuitMessage (ByVal nExitCode As Long)
    Function DefWindowProc%& (ByVal hWnd As Offset, Byval Msg As Unsigned Long, Byval wParam As Unsigned Offset, Byval lParam As Offset)

    'DECLARE FUNCTION GetRawInputData LIB "USER32.DLL" ALIAS "GetRawInputData"( _
    '    BYVAL hRawInput AS _UNSIGNED LONG, _
    '    BYVAL uiCommand AS _UNSIGNED LONG, _
    '    BYREF pData AS _OFFSET, _
    '    BYREF pcbSize AS _UNSIGNED LONG, _
    '    BYVAL cbSizeHeader AS _UNSIGNED LONG _
    '    ) AS _UNSIGNED LONG
    Sub GetRawInputData (ByVal hRawInput As Offset, Byval uiCommand As Unsigned Long, Byval pData As Offset, Byval pcbSize As Offset, Byval cbSizeHeader As Unsigned Long)

    Function GetRawInputData~& (ByVal hRawInput As Offset, Byval uiCommand As Unsigned Long, Byval pData As Offset, Byval pcbSize As Offset, Byval cbSizeHeader As Unsigned Long)

    Sub InvalidateRect (ByVal hWnd As Offset, Byval lpRect As Offset, Byval bErase As Long)

    'DECLARE FUNCTION SendMessage LIB "USER32.DLL" ALIAS "SendMessageA"( _
    '    BYVAL hWnd AS _OFFSET, _
    '    BYVAL Msg AS _UNSIGNED LONG, _
    '    BYVAL wParam AS _UNSIGNED LONG, _
    '    BYVAL lParam AS LONG _
    '    ) AS LONG
    Sub SendMessage (ByVal hWnd As Offset, Byval Msg As Unsigned Long, Byval wParam As Unsigned Offset, Byval lParam As Offset)

    Function BeginPaint%& (ByVal hWnd As Offset, Byval lpPaint As Offset)

    'Public Declare Function GetClientRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
    Sub GetClientRect (ByVal hWnd As Offset, Byval lpRect As Offset)

    'Public Declare Function DrawText Lib "user32" Alias "DrawTextA" (ByVal hdc As Long, ByVal lpStr As String, ByVal nCount As Long, lpRect As RECT, ByVal wFormat As Long) As Long
    Sub DrawText (ByVal hdc As Offset, Byval lpchText As Offset, Byval cchText As Long, Byval lprc As Offset, Byval format As Unsigned Long)

    'Public Declare Function OffsetRect Lib "user32" (lpRect As RECT, ByVal X As Long, ByVal Y As Long) As Long
    Sub OffsetRect (ByVal lprc As Offset, Byval dx As Long, Byval dy As Long)

    Sub EndPaint (ByVal hWnd As Offset, Byval lpPaint As Offset)

End Declare ' CustomType Library

' Header file "makeint.h" must be in same folder as this program.
Declare CustomType Library ".\makeint"
    Function MAKEINTRESOURCE%& Alias "MAKEINTRSC" (ByVal i As _Offset)
End Declare

' ================================================================================================================================================================
' END CustomType Library definitions
' ================================================================================================================================================================

' ================================================================================================================================================================
' BEGIN Library definitions
' ================================================================================================================================================================
Declare Library
    Function MAKELPARAM%& (ByVal l As Integer, Byval h As Integer)
    Function MAKELONG~& (ByVal l As Unsigned Integer, Byval h As Unsigned Integer)
End Declare

$If 64BIT Then
    Declare Library ".\internal\c\c_compiler\x86_64-w64-mingw32\include\windowsx"
    $Else
    Declare Library ".\internal\c\c_compiler\i686-w64-mingw32\include\windowsx"
    $End If
    Function GET_Y_LPARAM& (ByVal lp As Offset)
    Function GET_X_LPARAM& (ByVal lp As Offset)
End Declare

' Header file "winproc.h" must be in same folder as this program.
Declare Library ".\winproc"
    Function WindowProc%& ()
End Declare

' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
' Needed for acquiring the hWnd of the window
' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
Declare Library
    Function FindWindow& (ByVal ClassName As _Offset, WindowName$) ' To get hWnd handle
End Declare

' ================================================================================================================================================================
' END Library definitions
' ================================================================================================================================================================

' ================================================================================================================================================================
' BEGIN Dynamic Library definitions
' ================================================================================================================================================================

Declare Dynamic Library "user32"
    ' FOR CONTROLLING WINDOW ON TOP, ETC.:
    Function FindWindowA%& (ByVal lpClassName%&, Byval lpWindowName%&)
    Function SetWindowPos& (ByVal hWnd%&, Byval hWndInsertAfter%&, Byval X&, Byval Y&, Byval cx&, Byval cy&, Byval uFlags~&)
    Function GetForegroundWindow%&

    ' To make window invisible
    Function SetLayeredWindowAttributes& (ByVal hwnd As _Offset, Byval crKey As Long, Byval bAlpha As _Unsigned _Byte, Byval dwFlags As Long)
    Function GetWindowLong& Alias "GetWindowLongA" (ByVal hwnd As _Offset, Byval nIndex As Long)
    Function SetWindowLong& Alias "SetWindowLongA" (ByVal hwnd As _Offset, Byval nIndex As Long, Byval dwNewLong As Long)

    '' To hide the cursor
    'Function ShowCursor& (ByVal bShow As Long)

End Declare

Declare Dynamic Library "kernel32"
    Function GetLastError~& ()
End Declare

' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
' To keep focus on window
' ----------------------------------------------------------------------------------------------------------------------------------------------------------------
'Declare Dynamic Library "user32"
'    Sub ShowWindow (ByVal hWnd As _Offset, Byval nCmdShow As Long)
'End Declare

' ================================================================================================================================================================
' END Dynamic Library definitions
' ================================================================================================================================================================

' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
' END API DECLARATIONS
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
' BEGIN GLOBAL VARIABLES
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

' GLOBAL VARIABLES TO TRACK ERROR STATE
Dim Shared m_sError As String: m_sError = ""
Dim Shared m_sIncludeError As String: m_sIncludeError = ""

' BASIC PROGRAM METADATA
Dim Shared m_ProgramPath$: m_ProgramPath$ = Left$(Command$(0), _InStrRev(Command$(0), "\"))
Dim Shared m_ProgramName$: m_ProgramName$ = Mid$(Command$(0), _InStrRev(Command$(0), "\") + 1)
Dim Shared m_sTriggerFile As String: m_sTriggerFile = m_ProgramPath$ + "Pong.DELETE-TO-CLOSE"
Dim Shared m_sDebugFile As String: m_sDebugFile = m_ProgramPath$ + m_ProgramName$ + ".txt"


' RAW INPUT VARIABLES
Dim Shared rawinputdevices As String
Dim Shared hDlg As _Unsigned Long ' DWORD

' MOUSE VARIABLES
Dim Shared arrMouse(0 To 8) As MouseInfoType ' STORES INFO FOR EACH MOUSE
Dim Shared iMouseCount As Integer ' # OF MICE ATTACHED

Dim Shared iMinX As Long
Dim Shared iMaxX As Long
Dim Shared iMinY As Long
Dim Shared iMaxY As Long

' KEYBOARD VARIABLES
'Dim Shared arrKeyIndex(8) As String ' STORES KEYBOARD ID
'Dim Shared arrLastKeyDown(8) As Integer ' STORES LAST KEY PRESSED
'Dim Shared arrLastKeyUp(8) As Integer ' STORES LAST KEY RELEASED
'Dim Shared iKeyBoardCount As Integer ' # OF KEYBOARDS ATTACHED
Dim Shared iLastKeyDown As Integer
Dim Shared iLastKeyUp As Integer

' NETWORK VARIABLES
Dim Shared uintPort As _Unsigned Integer ' port
Dim Shared lngConn As Long ' c&
Dim Shared iData As Integer ' i
Dim Shared sOutput As String ' s$

' HANDLE FOR THE PROGRAM WINDOW
Dim Shared MyHwnd As _Offset ' _Integer64 hwnd%&
Dim Shared hwndMain As _Offset

' SCREEN SIZE
Dim Shared lngScreenWidth As Long
Dim Shared lngScreenHeight As Long
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
' END GLOBAL VARIABLES
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
' EXECUTION STARTS HERE!
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

' ENABLE / DISABLE DEBUG CONSOLE WINDOW
'If cDebugEnabled = TRUE Then
'    $Console
'    _Delay 4
'    _Console On
'    _Echo "Started " + m_ProgramName$
'    _Echo "Debugging on..."
'End If

' INITIALIZE
iMinX = 0
iMaxX = 1024 '_DesktopWidth '3583
iMinY = 0
iMaxY = 768 '_DesktopHeight ' 8202
lngScreenWidth = 1024 ' _DESKTOPWIDTH
lngScreenHeight = 768 ' _DESKTOPHEIGHT

' START THE MAIN ROUTINE
main

' DEACTIVATE DEBUGGING WINDOW
'If cDebugEnabled = TRUE Then
'    _Console Off
'End If

' EXIT PROGRAM
System ' return control to the operating system

' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
' BEGIN GLOBAL ERROR HANDLER
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ErrorHandler:
m_sError = "Error #" + _Trim$(Str$(Err)) + " at line " + _Trim$(Str$(_ErrorLine)) + "."
m_sIncludeError = "File " + Chr$(34) + _InclErrorFile$ + Chr$(34) + " at line " + _Trim$(Str$(_InclErrorLine)) + "."
Resume Next
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
' END GLOBAL ERROR HANDLER
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
' BEGIN MAIN ROUTINES
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

' /////////////////////////////////////////////////////////////////////////////

Sub main
    Dim sPort As String
    Dim iLoop As Integer
    Dim in$
    Dim MyTime##

    ' MAKE SURE WE HAVE INPUT
    sPort = Command$(1)
    If Len(sPort) > 0 Then
        If IsNumber%(sPort) = TRUE Then
            ' OPEN CONNECTION
            uintPort = Val(sPort)
            lngConn = _OpenClient("tcp/ip:" + _Trim$(Str$(uintPort)) + ":localhost")
            'Print lngConn
            DebugLog "lngConn = _OpenClient(" + Chr$(34) + "tcp/ip:" + Chr$(34) + "+ _Trim$(Str$(uintPort)) + " + Chr$(34) + ":localhost" + Chr$(34) + ") = " + _Trim$(Str$(lngConn))

            ' INITIALIZE
            iMinX = 0
            iMaxX = 1024 '3583
            iMinY = 0
            iMaxY = 768 '8202

            ' ****************************************************************************************************************************************************************
            ' ****************************************************************************************************************************************************************
            ' SET UP WINDOW TO BE SAME SIZE AS, AND OVERLAPPED WITH HOST WINDOW
            ' ****************************************************************************************************************************************************************
            ' ****************************************************************************************************************************************************************
            ' SET UP WINDOW
            'Screen _NewImage(1024, 768, 32)
            Screen 12 ' SCREEN 12 can use 16 color attributes with a black background. 256K possible RGB color hues. Background colors can be used with QB64.

            ' window needs to be lined up directly under the main program, so the mouse coordinates align with the display
            _ScreenMove 0, 0 ' <<< NOT WORKING, HOW DO WE DO THIS IN THE EVENT MODEL?

            '' ATTEMPT FULLSCREEN <- NOT REALLY WORKING
            '_FULLSCREEN _STRETCH, _SMOOTH
            'IF _FULLSCREEN = 0 THEN _FULLSCREEN _OFF 'check that a full screen mode initialized

            ' MAXIMIZE WINDOW
            'DOESN'T WORK: $RESIZE:STRETCH
            'DOESN'T WORK: $RESIZE:SMOOTH

            ' TRY JUST SAVING THE DESKTOP SIZE AND USING THAT WHEN DOING A NEW SCREEN
            ' Use _DESKTOPWIDTH and _DESKTOPHEIGHT to find the current desktop resolution to place the program’s window.
            lngScreenWidth = 1024 '_DesktopWidth
            lngScreenHeight = 768 '_DesktopHeight

            ' CLICK ON SCREEN TO GIVE IT THE FOCUS
            _ScreenClick 0, 0
            ''_SCREENCLICK column%, row%[, button%]

            ' CREATE TRIGGER FILE
            Open m_sTriggerFile For Output As #1
            Print #1, "Deleting this file will cause program " + m_ProgramName$ + " to stop running."
            Close #1

            ' WAIT UNTIL FILE IS CREATED
            ' (time out after 10 seconds)
            MyTime## = ExtendedTimer + 10
            Do
                If _FileExists(m_sTriggerFile) = TRUE Then Exit Do
            Loop Until Timer > MyTime##
            If _FileExists(m_sTriggerFile) = FALSE Then
                m_sError = "Trigger file not found: " + Chr$(34) + m_sTriggerFile + Chr$(34)
            End If

            If Len(m_sError) = 0 Then
                ' GET HANDLE TO THE PROGRAM WINDOW
                Do
                    MyHwnd = _WindowHandle
                Loop Until MyHwnd

                ' GIVE CONTROL TO THE EVENT-ORIENTED CODE
                System Val(Str$(WinMain))
            Else
                Print "ERROR: " + m_sError
            End If
        Else
            Print "Invalid non-numeric input " + Chr$(34) + sPort + Chr$(34) + ". Exiting."
        End If
    Else
        Print "No input. Exiting."
    End If

End Sub ' main

' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
' END MAIN ROUTINES
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
' BEGIN RAW INPUT FUNCTIONS
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

' /////////////////////////////////////////////////////////////////////////////
' Runs first

Function WinMain~%& ()
    'Dim As Offset hwndMain
    Dim As Offset hInst
    Dim As Offset hWndTop

    Dim As MSG msg
    Dim As WNDCLASSEX wndclass
    Dim As String szMainWndClass
    Dim As String szWinTitle
    Dim As Unsigned Integer reg
    Dim sData As String

    Dim iKeyLoop As Integer
    Dim iKeyCode As Integer

    Dim iLoop As Integer

    Dim sOperation As String

    Dim sResult As String

    Dim sDebug As String

    Dim iResult As Long

    'DEBUG: TRY FULL SCREEN <- PROGRAM CRASHES!
    '_FullScreen _SquarePixels

    hInst = GetModuleHandle(0)
    szMainWndClass = "WinTestWin" + Chr$(0)
    szWinTitle = cProgName + Chr$(0)
    wndclass.lpszClassName = Offset(szMainWndClass)
    wndclass.cbSize = Len(wndclass)
    wndclass.style = CS_HREDRAW Or CS_VREDRAW
    wndclass.lpfnWndProc = WindowProc
    wndclass.hInstance = hInst 'GetModuleHandle(0) will return the hInstance of this EXE
    wndclass.hIcon = LoadIcon(0, MAKEINTRESOURCE(IDI_APPLICATION))
    wndclass.hIconSm = LoadIcon(0, MAKEINTRESOURCE(IDI_APPLICATION))
    wndclass.hCursor = LoadCursor(0, MAKEINTRESOURCE(IDC_ARROW))
    wndclass.hbrBackground = COLOR_WINDOW + 1
    reg = RegisterClassEx(Offset(wndclass)) 'I prefer to use the output of RegisterClassEx rather than the window name

    ' INITIALIZE RAW INPUT
    InitRawInput

    If Len(m_sError) = 0 Then
        ' SET WINDOW SiZE + INITIALIZE WINDOW
        'Q: HOW CAN WE USE THE QB64PE PROGRAM'S WINDOW HANDLE e.g. _WindowHandle ?
        hwndMain = CreateWindowEx( _
            0, _
            MAKELPARAM(reg, 0), _
            Offset(szWinTitle), _
            WS_OVERLAPPEDWINDOW, _
            0, _
            0, _
            lngScreenWidth, _
            lngScreenHeight, _
            0, _
            0, _
            hInst, _
            0)
        ShowWindow hwndMain, SW_SHOW

        ' TURN SUB WINDOW INVISIBLE
        ''SetWindowOpacity MyHwnd, cInvisible
        'SetWindowOpacity hwndMain, cTransparent ' <- USE THIS FOR TESTING
        'SetWindowOpacity hwndMain, 50 ' <- USE THIS FOR TESTING
        SetWindowOpacity hwndMain, cInvisible

        ' KEEP WINDOW VISIBLE
        'DEBUG: SUBSTITUTE _WindowHandle
        'UpdateWindow _WindowHandle
        UpdateWindow hwndMain

        ' MOVE WINDOW TO TOP
        '' GET WINDOW HANDLES
        'hWndThis = _WindowHandle ' FindWindowA(0, _OFFSET(t))
        hWndTop = GetForegroundWindow%& ' find currently focused process handle

        ' GET FOCUS
        If hwndMain <> hWndTop Then
            _ScreenClick 240, 240 ' add 40 to x and y to focus on positioned window
        End If

        ' MOVE TO TOP
        'Function SetWindowPos& (ByVal hWnd%&, Byval hWndInsertAfter%&, Byval X&, Byval Y&, Byval cx&, Byval cy&, Byval uFlags~&)
        'If SetWindowPos(hwndMain, HWND_TOPMOST, 200, 200, 0, 0, SWP_NOSIZE Or SWP_NOACTIVATE) = 0 Then
        If SetWindowPos(hwndMain, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE Or SWP_NOACTIVATE) = 0 Then
            'sNextError = "SetWindowPos failed. 0x" + LCase$(Hex$(GetLastError))
            m_sError = "SetWindowPos failed. 0x" + LCase$(Hex$(GetLastError))
        End If

        '' DEBUG
        'DebugLog ""
        'DebugLog "AFTER InitRawInput:"
        'For iLoop = LBound(arrMouse) To UBound(arrMouse)
        '   DebugLog "    arrMouse(" + _Trim$(Str$(iLoop)) + ").ID = " + chr$(34) + arrMouse(iLoop).ID + chr$(34)
        'Next iLoop
        'DebugLog ""

        ' IF EVERYTHING IS WORKING, CONTINUE
        If Len(m_sError) = 0 Then
            ' START THE INPUT ROUTINES
            InitInputVars

            '' DEBUG
            'DebugLog "AFTER InitInputVars:"
            'For iLoop = LBound(arrMouse) To UBound(arrMouse)
            '   DebugLog "    arrMouse(" + _Trim$(Str$(iLoop)) + ").ID = " + chr$(34) + arrMouse(iLoop).ID + chr$(34)
            'Next iLoop
            'DebugLog ""

            ' SEND SUB WINDOW HANDLE BACK TO MAIN
            _Delay 2

            sData = "w:" + _Trim$(Str$(hwndMain)) + Chr$(13)
            sDebug = "w:" + _Trim$(Str$(hwndMain)) + "\n"

            _Delay 2

            DebugLog "Put #lngConn, , sData"
            DebugLog "Put #" + _Trim$(Str$(lngConn)) + ", , " + Chr$(34) + sDebug + Chr$(34)

            ' SET ERROR TRAPPING
            On Error GoTo ErrorHandler

            ' TRY RETURNING WINDOW HANDLE TO MAIN PROGRAM
            Put #lngConn, , sData

            ' RESUME NORMAL ERROR TRAPPING
            On Error GoTo 0

            If Len(m_sError) = 0 Then
                _Delay 2
                DebugLog "MAIN PROGRAM LOOP..."

                ' *** STOPS THE MOUSE FROM WORKING! ***
                '' HIDE THE MOUSE CURSOR
                'iResult = ShowCursor(0) ' hide cursor

                ' MAIN PROGRAM LOOP
                While GetMessage(Offset(msg), 0, 0, 0)
                    TranslateMessage Offset(msg)
                    DispatchMessage Offset(msg)

                    ' QUIT IF TRIGGER FILE IS GONE
                    If _FileExists(m_sTriggerFile) = FALSE Then
                        '' SHOW THE MOUSE CURSOR AGAIN
                        'iResult = ShowCursor(1) ' show cursor

                        ' EXIT
                        System
                    End If

                    ' KEEP WINDOW ON TOP
                    If _WindowHasFocus = 0 Then
                        _ScreenIcon
                        ''ShowWindow MyHwnd, 1
                        'ShowWindow hwndMain, 1
                        ShowWindow hwndMain, SW_SHOW
                    End If
                Wend
            Else
                m_sError = "Error, can't return hwndMain: " + m_sError
                DebugLog m_sError
            End If
        Else
            m_sError = "Error, can't setup subprogram window: " + m_sError
            DebugLog m_sError
        End If
    End If

    ' SEND ANY ERROR MESSAGES BACK TO MAIN
    If Len(m_sError) > 0 Then
        ' SHOW EROR MESSAGE
        If cDebugEnabled Then
            Screen 0
            Cls
            Print m_ProgramName$ + " failed:"
            Print m_sError
            Print
        End If

        ' TRY TO RETURN ERROR
        _Delay 2
        sData = "e:" + m_sError + Chr$(13)

        m_sError = ""

        ' SET ERROR TRAPPING
        On Error GoTo ErrorHandler

        ' TRY RETURNING ERROR MESSAGE TO MAIN PROGRAM
        Put #lngConn, , sData

        ' RESUME NORMAL ERROR TRAPPING
        On Error GoTo 0

        _Delay 2

        ' SHOW EROR MESSAGE
        If cDebugEnabled Then
            If Len(m_sError) > 0 Then
                Print "Could not return error to main program: " + m_sError
                Print
            End If

            Print "PRESS ANY KEY TO CONTINUE"
            Sleep
        End If
    End If

    ' RETURN A VALUE
    WinMain = msg.wParam
End Function ' WinMain

' /////////////////////////////////////////////////////////////////////////////
' Handles main window events

' MESSAGE TYPES FOR READING THE KEYBOARD:
' WM_CHAR
' WM_KEYDOWN
' WM_KEYUP
' WM_SYSCHAR
' WM_SYSKEYDOWN
' WM_SYSKEYUP

Function MainWndProc%& (hwnd As Offset, nMsg As Unsigned Long, wParam As Unsigned Offset, lParam As Offset)
    ' EVENT HANDLER VARIABLES PART 1
    Static As Offset hwndButton
    Static As Long cx, cy
    Dim As Offset hdc
    Dim As PAINTSTRUCT ps
    Dim As RECT rc
    Dim As RECT TargetRect
    Dim As MEM lpb
    Dim As Unsigned Long dwSize
    Dim As RAWINPUT rawm ' MOUSE VERSION
    Dim As RAWINPUT_K rawk ' KEYBOARD VERSION
    Dim As Long tmpx, tmpy
    Static As Long maxx
    Dim As RAWINPUTHEADER rih

    ' TEMP VARIABLES FOR DISPLAYING FORMATTED VALUES TO SCREEN
    Dim strNextID As String
    Dim iIndex As Integer
    Dim iRowOffset As Integer
    Dim iLine As Integer
    Dim iLen As Integer
    Dim iCount As Integer
    Dim sCount As String
    Dim sText As String
    Dim sX As String
    Dim sY As String
    Dim sPX As String
    Dim sPY As String
    Dim sWheel As String
    Dim sLeftDown As String
    Dim sMiddleDown As String
    Dim sRightDown As String
    Dim sLeftCount As String
    Dim sMiddleCount As String
    Dim sRightCount As String
    Dim sNext As String
    Dim iNewX As Integer
    Dim iNewY As Integer
    Dim iDX As Integer
    Dim iDY As Integer
    Dim iInputType As Integer

    ' EVENT HANDLER VARIABLES PART 2
    Dim pRawInput As _Offset ' RAWINPUT POINTER
    Dim zKeyName As String ' ASCIIZ * 50 = NULL-terminated string
    Dim sRawInput As String
    Dim sBuffer As String
    Dim ScanCode As _Unsigned Long ' DWORD
    Static hFocusBak As _Unsigned Long ' DWORD
    Dim RawInputDevCount As Long
    Dim KeyboardTypeCount As Long
    Dim RawInputDeviceIndex As Long
    Dim ByteCount As Long
    Dim int_wParam As Integer
    Dim vbCrLf As String: vbCrLf = Chr$(13) + Chr$(10)
    Dim vbCr As String: vbCr = Chr$(13)
    Dim vbLf As String: vbLf = Chr$(10)
    ReDim arrText$(0)

    ' HANDLE EVENT MESSAGES
    Select Case nMsg
        Case WM_DESTROY:
            'DebugPrint "nMsg = WM_DESTROY"
            PostQuitMessage 0
            MainWndProc = 0
            Exit Function

        Case WM_INPUT:
            'DebugPrint "nMsg = WM_INPUT"

            ' MOUSE VERSION:
            GetRawInputData lParam, RID_INPUT, 0, Offset(dwSize), Len(rih)

            ' KEYBOARD VERSION:
            'GetRawInputData(CBLPARAM, %RID_INPUT, BYVAL %NULL, ByteCount, SIZEOF(RAWINPUTHEADER)) ' Get size of raw input buffer

            lpb = MemNew(dwSize)
            If lpb.SIZE = 0 Then
                MainWndProc = 0
                Exit Function
            End If

            ' GET THE RAW INPUT
            If GetRawInputData(lParam, RID_INPUT, lpb.OFFSET, Offset(dwSize), Len(rih)) <> dwSize Then
                'TODO: BUBBLE UP THE ERROR MESSAGE?
                Print "GetRawInputData doesn't return correct size!"
                'DebugPrint "WRONG SIZE: GetRawInputData doesn't return correct size!"
            End If

            ' IDENTIFY TYPE OF INPUT
            Select Case dwSize
                Case Len(rawm):
                    ' MOUSE INPUT
                    'DebugPrint "dwSize = Len(rawm) so MOUSE INPUT DETECTED"
                    iInputType = RIM_TYPEMOUSE
                    MemGet lpb, lpb.OFFSET, rawm
                Case Len(rawk):
                    ' KEYBOARD INPUT
                    'DebugPrint "dwSize = Len(rawk) so KEYBOARD INPUT DETECTED"
                    iInputType = RIM_TYPEKEYBOARD
                    MemGet lpb, lpb.OFFSET, rawk
                Case Else:
                    ' SOME OTHER TYPE (MAYBE HID) BUT ONE WE CAN'T PROCESS
                    'DebugPrint "dwSize = SOME OTHER TYPE (MAYBE HID)"
                    iInputType = RIM_TYPEUNKNOWN
            End Select

            If iInputType = RIM_TYPEMOUSE Then
                'DebugLog "iInputType = RIM_TYPEMOUSE"

                If rawm.header.dwType = RIM_TYPEMOUSE Then
                    'DebugLog "    rawm.header.dwType = RIM_TYPEMOUSE"

                    tmpx = rawm.mouse.lLastX
                    tmpy = rawm.mouse.lLastY
                    maxx = tmpx

                    ' UPDATE RANGE OF MOUSE COORDINATES
                    If GET_X_LPARAM(lParam) < iMinX Then iMinX = GET_X_LPARAM(lParam)
                    If GET_X_LPARAM(lParam) > iMaxX Then iMaxX = GET_X_LPARAM(lParam)
                    If GET_Y_LPARAM(lParam) < iMinY Then iMinY = GET_Y_LPARAM(lParam)
                    If GET_Y_LPARAM(lParam) > iMaxY Then iMaxY = GET_Y_LPARAM(lParam)

                    ' IDENTIFY WHICH MOUSE IT IS
                    strNextID = _Trim$(Str$(rawm.header.hDevice))
                    'DebugPrint "    strNextID = " + Chr$(34) + strNextID + Chr$(34)
                    'DebugLog "        strNextID = " + Chr$(34) + strNextID + Chr$(34)

                    ' GET ARRAY INDEX FROM strnextID
                    iIndex = GetMouseIndex%(strNextID)
                    'DebugPrint "    iIndex =  GetMouseIndex%(" + chr$(34) + strNextID + chr$(34) + ") = " + _Trim$(Str$(iIndex))
                    'DebugLog "    iIndex =  GetMouseIndex%(" + chr$(34) + strNextID + chr$(34) + ") = " + _Trim$(Str$(iIndex))

                    ' DETECT INPUT
                    If iIndex >= LBound(arrMouse) Then
                        'DebugLog "            iIndex >= LBound(arrMouse)"

                        If iIndex <= UBound(arrMouse) Then
                            'DebugLog "                iIndex <= UBound(arrMouse)"

                            'DebugLog "                    iIndex = " + _Trim$(Str$(iIndex))


                            ' INCREMENT/DECREMENT FIXED DELTA X
                            If rawm.mouse.lLastX < 0 Then
                                arrMouse(iIndex).dx = -1
                                'arrMouse(iIndex).x = arrMouse(iIndex).x - 1
                            ElseIf rawm.mouse.lLastX > 0 Then
                                arrMouse(iIndex).dx = 1
                                'arrMouse(iIndex).x = arrMouse(iIndex).x + 1
                            End If
                            'DebugLog "                    arrMouse(iIndex).dx = " + _Trim$(Str$(arrMouse(iIndex).dx))

                            ' INCREMENT/DECREMENT FIXED DELTA Y
                            If rawm.mouse.lLastY < 0 Then
                                arrMouse(iIndex).dy = -1
                                'arrMouse(iIndex).y = arrMouse(iIndex).y - 1
                            ElseIf rawm.mouse.lLastY > 0 Then
                                arrMouse(iIndex).dy = 1
                                'arrMouse(iIndex).y = arrMouse(iIndex).y + 1
                            End If
                            'DebugLog "                    arrMouse(iIndex).dy = " + _Trim$(Str$(arrMouse(iIndex).dy))


                            ' INCREMENT/DECREMENT TRUE DELTA
                            arrMouse(iIndex).pdx = rawm.mouse.lLastX
                            arrMouse(iIndex).pdy = rawm.mouse.lLastY
                            arrMouse(iIndex).px = arrMouse(iIndex).px + arrMouse(iIndex).pdx
                            arrMouse(iIndex).py = arrMouse(iIndex).py + arrMouse(iIndex).pdy

                            ' CHECK HIRES CURSOR BOUNDARIES
                            If arrMouse(iIndex).px < cMinPX Then arrMouse(iIndex).px = cMinPX
                            If arrMouse(iIndex).px > cMaxPX Then arrMouse(iIndex).px = cMaxPX
                            If arrMouse(iIndex).py < cMinPY Then arrMouse(iIndex).py = cMinPY
                            If arrMouse(iIndex).py > cMaxPY Then arrMouse(iIndex).py = cMaxPY

                            'DebugLog "                    arrMouse(iIndex).px = " + _Trim$(Str$(arrMouse(iIndex).px))
                            'DebugLog "                    arrMouse(iIndex).py = " + _Trim$(Str$(arrMouse(iIndex).py))

                            ' =============================================================================
                            ' left button = 1 when down, 2 when released
                            If ((rawm.mouse.usButtonFlags And 1) = 1) Then
                                arrMouse(iIndex).LeftDown = TRUE
                            ElseIf ((rawm.mouse.usButtonFlags And 2) = 2) Then
                                arrMouse(iIndex).LeftDown = FALSE
                            End If
                            'DebugLog "                    arrMouse(iIndex).LeftDown = " + TrueFalse$(arrMouse(iIndex).LeftDown)

                            ' =============================================================================
                            ' middle button = 16 when down, 32 when released
                            If ((rawm.mouse.usButtonFlags And 16) = 16) Then
                                arrMouse(iIndex).MiddleDown = TRUE
                            ElseIf ((rawm.mouse.usButtonFlags And 32) = 32) Then
                                arrMouse(iIndex).MiddleDown = FALSE
                            End If
                            'DebugLog "                    arrMouse(iIndex).MiddleDown = " + TrueFalse$(arrMouse(iIndex).MiddleDown)

                            ' =============================================================================
                            ' right button = 4 when down, 8 when released
                            If ((rawm.mouse.usButtonFlags And 4) = 4) Then
                                arrMouse(iIndex).RightDown = TRUE
                            ElseIf ((rawm.mouse.usButtonFlags And 8) = 8) Then
                                arrMouse(iIndex).RightDown = FALSE
                            End If
                            'DebugLog "                    arrMouse(iIndex).RightDown = " + TrueFalse$(arrMouse(iIndex).RightDown)

                            ' =============================================================================
                            ' scroll wheel = ???
                            'Hex$(rawm.mouse.usButtonFlags)
                            'arrMouse(iIndex).wheel = ???

                            '' DID VALUE CHANGE?
                            'If arrMouse(iIndex).UpdateCount = 32767 Then
                            '    arrMouse(iIndex).UpdateCount = 1
                            'Else
                            '    arrMouse(iIndex).UpdateCount = arrMouse(iIndex).UpdateCount + 1
                            'End If

                            ' COLLECT VALUES FOR THIS MOUSE TO SEND
                            ' IN THE FOLOWING TAB-DELIMITED FORMAT:
                            ' {mouse #}\t{dx}\t{dy}\t{wheel}\t{leftDown}\t{middleDown}\t{rightDown}\n
                            sOutput = "m:"
                            sOutput = sOutput + _Trim$(Str$(iIndex)) + Chr$(9)
                            'sOutput = sOutput + _Trim$(Str$(arrMouse(iIndex).UpdateCount)) + Chr$(9)

                            sOutput = sOutput + _Trim$(Str$(arrMouse(iIndex).dx)) + Chr$(9)
                            sOutput = sOutput + _Trim$(Str$(arrMouse(iIndex).dy)) + Chr$(9)

                            sOutput = sOutput + _Trim$(Str$(arrMouse(iIndex).px)) + Chr$(9)
                            sOutput = sOutput + _Trim$(Str$(arrMouse(iIndex).py)) + Chr$(9)

                            sOutput = sOutput + _Trim$(Str$(arrMouse(iIndex).wheel)) + Chr$(9)
                            sOutput = sOutput + _Trim$(Str$(arrMouse(iIndex).LeftDown)) + Chr$(9)
                            sOutput = sOutput + _Trim$(Str$(arrMouse(iIndex).MiddleDown)) + Chr$(9)
                            sOutput = sOutput + _Trim$(Str$(arrMouse(iIndex).RightDown)) + Chr$(13)


                            ' SEND VALUES FOR THIS MOUSE TO HOST
                            'DebugLog "                    Put #lngConn, , sOutput"
                            'DebugLog "                    Put #" + _Trim$(Str$(lngConn)) + ", , " + chr$(34) + sOutput + chr$(34)

                            Put #lngConn, , sOutput

                            'DebugLog "                    m_sError = " + chr$(34) + m_sError + chr$(34)

                            ' CLEAR MOVEMENT
                            arrMouse(iIndex).dx = 0
                            arrMouse(iIndex).dy = 0
                            'arrMouse(iIndex).wheelOld = arrMouse(iIndex).wheel
                            'arrMouse(iIndex).LeftDownOld = arrMouse(iIndex).LeftDown
                            'arrMouse(iIndex).MiddleDownOld = arrMouse(iIndex).MiddleDown
                            'arrMouse(iIndex).RightDownOld = arrMouse(iIndex).RightDown
                        End If

                    End If

                    '' INVOKE PAINT
                    'InvalidateRect hwnd, 0, -1
                    'SendMessage hwnd, WM_PAINT, 0, 0
                End If
            ElseIf iInputType = RIM_TYPEKEYBOARD Then
                ' *** FOR NOW RAW KEYBOARD INPUT NOT WORKING
                'DebugPrint "iInputType = RIM_TYPEKEYBOARD"
                'If rawk.header.dwType = RIM_TYPEKEYBOARD Then
                '    DebugPrint "* FOUND RAW INPUT KEYBOARD *"
                '
                '    ' HOW DO WE READ THE KEYBOARD USING RawInputAPI ???
                '    DebugPrint "rawk.header.dwType = RIM_TYPEKEYBOARD"
                '
                '    ' IDENTIFY WHICH KEYBOARD IT IS
                '    strNextID = _Trim$(Str$(rawk.header.hDevice))
                '    DebugPrint "    strNextID = " + Chr$(34) + strNextID + Chr$(34)
                '
                '    '' GET ARRAY INDEX FROM strnextID
                '    'iIndex = GetKeyboardIndex%(strNextID)
                '    'DebugPrint "    iIndex = " + _Trim$(Str$(iIndex))
                '
                'End If
            End If

            ' FINISHUP WM_INPUT
            MemFree lpb
            MainWndProc = 0
            Exit Function

        Case WM_MOUSEMOVE:
            'DebugPrint "nMsg = WM_MOUSEMOVE"
            Exit Function

        Case WM_PAINT:
            'DebugPrint "nMsg = WM_PAINT"

            'hdc = BeginPaint(hwnd, Offset(ps))
            'GetClientRect hwnd, Offset(rc)
            '
            '' -----------------------------------------------------------------------------
            '' DISPLAY MOUSE INFO ON SCREEN AT MOUSE POSITIONS
            'iCount = 0
            'For iIndex = LBound(arrMouse) To UBound(arrMouse)
            '    iCount = iCount + 1
            '
            '    If Len(arrMouse(iIndex).ID) > 0 Then
            '        ' CHECK CURSOR BOUNDARIES
            '        If arrMouse(iIndex).x < cMinX Then arrMouse(iIndex).x = cMinX
            '        If arrMouse(iIndex).x > cMaxX Then arrMouse(iIndex).x = cMaxX
            '        If arrMouse(iIndex).y < cMinY Then arrMouse(iIndex).y = cMinY
            '        If arrMouse(iIndex).y > cMaxY Then arrMouse(iIndex).y = cMaxY
            '
            '        ' CHECK HIRES CURSOR BOUNDARIES
            '        If arrMouse(iIndex).px < cMinPX Then arrMouse(iIndex).px = cMinPX
            '        If arrMouse(iIndex).px > cMaxPX Then arrMouse(iIndex).px = cMaxPX
            '        If arrMouse(iIndex).py < cMinPY Then arrMouse(iIndex).py = cMinPY
            '        If arrMouse(iIndex).py > cMaxPY Then arrMouse(iIndex).py = cMaxPY
            '
            '        ' DEFINE TARGET RECT FOR WHERE TO DRAW ON SCREEN
            '        TargetRect.left = rc.left + arrMouse(iIndex).px
            '        TargetRect.top = rc.top + arrMouse(iIndex).py
            '        TargetRect.right = rc.right + arrMouse(iIndex).px
            '        TargetRect.bottom = rc.bottom + arrMouse(iIndex).py
            '
            '        ' COLLECT VALUES FOR THIS MOUSE IN A STRING
            '        sText = ""
            '        sText = sText + _Trim$(Str$(iCount))
            '        sText = sText + " ("
            '        sText = sText + _Trim$(Str$(arrMouse(iIndex).px))
            '        sText = sText + ","
            '        sText = sText + _Trim$(Str$(arrMouse(iIndex).py))
            '        sText = sText + ") "
            '        sText = sText + IIFS$(arrMouse(iIndex).LeftDown, "1", " ")
            '        sText = sText + IIFS$(arrMouse(iIndex).MiddleDown, "2", " ")
            '        sText = sText + IIFS$(arrMouse(iIndex).RightDown, "3", " ")
            '
            '        'arrMouse(iIndex).wheel
            '        'arrMouse(iIndex).char
            '        'arrMouse(iIndex).y
            '        'arrMouse(iIndex).x
            '
            '        ' DRAW VALUES FOR THIS MOUSE TO SCREEN AT POINTER POSITION
            '        DrawText hdc, Offset(sText), Len(sText), Offset(TargetRect), DT_LEFT
            '        OffsetRect Offset(TargetRect), arrMouse(iIndex).px, arrMouse(iIndex).px
            '    End If
            'Next iIndex
            '
            '' -----------------------------------------------------------------------------
            '' DISPLAY INSTRUCTIONS ON SCREEN
            '' DEFINE TARGET RECT FOR WHERE TO DRAW ON SCREEN
            'TargetRect.left = rc.left + 100
            'TargetRect.top = rc.top + 500
            'TargetRect.right = rc.right + 100
            'TargetRect.bottom = rc.bottom + 500
            '
            '' COLLECT VALUES FOR THIS KEYBOARD IN A STRING
            'sText = ""
            'sText = sText + "Raw Input API multi-mouse demo:"
            'sText = sText + Chr$(13)
            'sText = sText + Chr$(13)
            'sText = sText + "1. Plug in 2 or more USB mice"
            'sText = sText + Chr$(13)
            'sText = sText + "2. Move them around and click the buttons."
            'sText = sText + Chr$(13)
            'sText = sText + "3. Try pressing some keys on the keyboard."
            'sText = sText + Chr$(13)
            'sText = sText + Chr$(13)
            'sText = sText + "Press ESC to exit."
            '
            '' DRAW VALUES FOR THIS KEYBOARD TO SCREEN AT NEXT POSITION
            'DrawText hdc, Offset(sText), Len(sText), Offset(TargetRect), DT_LEFT
            'OffsetRect Offset(TargetRect), 0, 0 ' y,x
            '
            '' -----------------------------------------------------------------------------
            '' DISPLAY KEYBOARD INFO ON SCREEN
            '' DEFINE TARGET RECT FOR WHERE TO DRAW ON SCREEN
            'TargetRect.left = rc.left + 400
            'TargetRect.top = rc.top + 100
            'TargetRect.right = rc.right + 400
            'TargetRect.bottom = rc.bottom + 100
            '
            '' COLLECT VALUES FOR THIS KEYBOARD IN A STRING
            'sText = ""
            'sText = sText + "Keyboard: "
            'sText = sText + IIFS$(iLastKeyDown > 0, VirtualKeyCodeToString$(iLastKeyDown) + " (" + _Trim$(Str$(iLastKeyDown)) + ")", "")
            ''sText = sText + Chr$(13)
            ''sText = sText + "  LAST DOWN="
            ''sText = sText + IIFS$(iLastKeyDown > 0, VirtualKeyCodeToString$(iLastKeyDown), "")
            ''sText = sText + Chr$(13)
            ''sText = sText + "  LAST UP  ="
            ''sText = sText + IIFS$(iLastKeyUp > 0, VirtualKeyCodeToString$(iLastKeyUp), "")
            '
            '' DRAW VALUES FOR THIS KEYBOARD TO SCREEN AT NEXT POSITION
            'DrawText hdc, Offset(sText), Len(sText), Offset(TargetRect), DT_LEFT
            'OffsetRect Offset(TargetRect), 0, 0 ' y,x
            '
            '' -----------------------------------------------------------------------------
            '' FINISH PAINT
            'EndPaint hwnd, Offset(ps)
            '
            MainWndProc = 0
            Exit Function

        Case WM_CHAR:
            'DebugPrint "nMsg = WM_CHAR"

            '' GET AN INTEGER FROM WPARAM
            'If wParam < 32768 Then
            '    int_wParam = Val(_Trim$(Str$(wParam)))
            'Else
            '    int_wParam = -1
            'End If
            '
            '' WM_CHAR message
            '' https://learn.microsoft.com/en-us/windows/win32/inputdev/wm-char
            '' Posted to the window with the keyboard focus when a WM_KEYDOWN message is translated by the TranslateMessage function. The WM_CHAR message contains the character code of the key that was pressed.
            'DebugPrint "nMsg = WM_CHAR"
            'DebugPrint "    Offset hwnd=" + _Trim$(Str$(hwnd)) + ", Unsigned Long nMsg=" + _Trim$(Str$(nMsg)) + ", Unsigned Offset wParam=" + _Trim$(Str$(wParam)) + ", Offset lParam=" + _Trim$(Str$(lParam))
            'DebugPrint "    Pressed key: " + VirtualKeyCodeToString$(int_wParam)
            '
            '' INVOKE PAINT
            'InvalidateRect hwnd, 0, -1
            'SendMessage hwnd, WM_PAINT, 0, 0
            'MainWndProc = 0

            Exit Function

        Case WM_KEYDOWN:
            'DebugPrint "nMsg = WM_KEYDOWN"

            ' GET AN INTEGER FROM WPARAM
            If wParam < 32768 Then
                int_wParam = Val(_Trim$(Str$(wParam)))
            Else
                int_wParam = -1
            End If

            ' REMEMBER KEY
            iLastKeyDown = int_wParam

            ' WM_KEYDOWN message
            ' Posted to the window with the keyboard focus when a nonsystem key is pressed. A nonsystem key is a key that is pressed when the ALT key is not pressed.
            ' https://learn.microsoft.com/en-us/windows/win32/inputdev/wm-keydown
            'DebugPrint "nMsg = WM_KEYDOWN"
            'DebugPrint "    strNextID  =" + Chr$(34) + strNextID + Chr$(34)
            'DebugPrint "    Offset hwnd=" + _Trim$(Str$(hwnd)) + ", Unsigned Long nMsg=" + _Trim$(Str$(nMsg)) + ", Unsigned Offset wParam=" + _Trim$(Str$(wParam)) + ", Offset lParam=" + _Trim$(Str$(lParam))
            'DebugPrint "    Pressed key: " + VirtualKeyCodeToString$(int_wParam)

            ' SEND KEYDOWN EVENT TO HOST
            sOutput = "d:" + _Trim$(Str$(int_wParam)) + Chr$(13)
            Put #lngConn, , sOutput

            '' INVOKE PAINT
            'InvalidateRect hwnd, 0, -1
            'SendMessage hwnd, WM_PAINT, 0, 0
            MainWndProc = 0

            Exit Function

        Case WM_KEYUP:
            'DebugPrint "nMsg = WM_KEYUP"

            ' GET AN INTEGER FROM WPARAM
            If wParam < 32768 Then
                int_wParam = Val(_Trim$(Str$(wParam)))
            Else
                int_wParam = -1
            End If

            ' REMEMBER KEY
            iLastKeyUp = int_wParam
            iLastKeyDown = 0

            ' WM_KEYUP message
            ' https://learn.microsoft.com/en-us/windows/win32/inputdev/wm-keyup
            ' Posted to the window with the keyboard focus when a nonsystem key is released. A nonsystem key is a key that is pressed when the ALT key is not pressed, or a keyboard key that is pressed when a window has the keyboard focus.
            'DebugPrint "nMsg = WM_KEYUP"
            'DebugPrint "    strNextID  =" + Chr$(34) + strNextID + Chr$(34)
            'DebugPrint "    Offset hwnd=" + _Trim$(Str$(hwnd)) + ", Unsigned Long nMsg=" + _Trim$(Str$(nMsg)) + ", Unsigned Offset wParam=" + _Trim$(Str$(wParam)) + ", Offset lParam=" + _Trim$(Str$(lParam))
            'DebugPrint "    Pressed key: " + VirtualKeyCodeToString$(int_wParam)

            ' SEND KEYUP EVENT TO HOST
            sOutput = "u:" + _Trim$(Str$(int_wParam)) + Chr$(13)
            Put #lngConn, , sOutput

            '' INVOKE PAINT
            'InvalidateRect hwnd, 0, -1
            'SendMessage hwnd, WM_PAINT, 0, 0
            MainWndProc = 0

            '' EXIT WHEN USER RELEASES ESCAPE KEY
            'If int_wParam = 27 Then System

            Exit Function

        Case WM_SYSCHAR:
            'DebugPrint "nMsg = WM_SYSCHAR"

            '' GET AN INTEGER FROM WPARAM
            'If wParam < 32768 Then
            '    int_wParam = Val(_Trim$(Str$(wParam)))
            'Else
            '    int_wParam = -1
            'End If
            '
            '' WM_SYSCHAR message
            '' https://learn.microsoft.com/en-us/windows/win32/menurc/wm-syschar
            '' Posted to the window with the keyboard focus when a WM_SYSKEYDOWN message is translated by the TranslateMessage function. It specifies the character code of a system character key that is, a character key that is pressed while the ALT key is down.
            'DebugPrint "nMsg = WM_SYSCHAR"
            'DebugPrint "    Offset hwnd=" + _Trim$(Str$(hwnd)) + ", Unsigned Long nMsg=" + _Trim$(Str$(nMsg)) + ", Unsigned Offset wParam=" + _Trim$(Str$(wParam)) + ", Offset lParam=" + _Trim$(Str$(lParam))
            'DebugPrint "    Pressed key: " + VirtualKeyCodeToString$(int_wParam)
            '
            '' INVOKE PAINT
            'InvalidateRect hwnd, 0, -1
            'SendMessage hwnd, WM_PAINT, 0, 0
            'MainWndProc = 0

            Exit Function

        Case WM_SYSKEYDOWN:
            'DebugPrint "nMsg = WM_SYSKEYDOWN"

            ' GET AN INTEGER FROM WPARAM
            If wParam < 32768 Then
                int_wParam = Val(_Trim$(Str$(wParam)))
            Else
                int_wParam = -1
            End If

            ' REMEMBER KEY
            iLastKeyDown = int_wParam

            ' WM_SYSKEYDOWN message
            ' https://learn.microsoft.com/en-us/windows/win32/inputdev/wm-syskeydown
            ' Posted to the window with the keyboard focus when the user presses the F10 key (which activates the menu bar) or holds down the ALT key and then presses another key. It also occurs when no window currently has the keyboard focus; in this case, the WM_SYSKEYDOWN message is sent to the active window. The window that receives the message can distinguish between these two contexts by checking the context code in the lParam parameter.
            'DebugPrint "nMsg = WM_SYSKEYDOWN"
            'DebugPrint "    strNextID  =" + Chr$(34) + strNextID + Chr$(34)
            'DebugPrint "    Offset hwnd=" + _Trim$(Str$(hwnd)) + ", Unsigned Long nMsg=" + _Trim$(Str$(nMsg)) + ", Unsigned Offset wParam=" + _Trim$(Str$(wParam)) + ", Offset lParam=" + _Trim$(Str$(lParam))
            'DebugPrint "    Pressed key: " + VirtualKeyCodeToString$(int_wParam)

            ' SEND KEYDOWN EVENT TO HOST
            sOutput = "d:" + _Trim$(Str$(int_wParam)) + Chr$(13)
            Put #lngConn, , sOutput

            '' INVOKE PAINT
            'InvalidateRect hwnd, 0, -1
            'SendMessage hwnd, WM_PAINT, 0, 0
            MainWndProc = 0

            Exit Function

        Case WM_SYSKEYUP:
            'DebugPrint "nMsg = WM_SYSKEYUP"

            ' GET AN INTEGER FROM WPARAM
            If wParam < 32768 Then
                int_wParam = Val(_Trim$(Str$(wParam)))
            Else
                int_wParam = -1
            End If

            ' REMEMBER KEY
            iLastKeyUp = int_wParam
            iLastKeyDown = 0

            ' WM_SYSKEYUP message
            ' https://learn.microsoft.com/en-us/windows/win32/inputdev/wm-syskeyup
            ' Posted to the window with the keyboard focus when the user releases a key that was pressed while the ALT key was held down. It also occurs when no window currently has the keyboard focus; in this case, the WM_SYSKEYUP message is sent to the active window. The window that receives the message can distinguish between these two contexts by checking the context code in the lParam parameter.
            ' A window receives this message through its WindowProc function.
            'DebugPrint "nMsg = WM_SYSKEYUP"
            'DebugPrint "    strNextID  =" + Chr$(34) + strNextID + Chr$(34)
            'DebugPrint "    Offset hwnd=" + _Trim$(Str$(hwnd)) + ", Unsigned Long nMsg=" + _Trim$(Str$(nMsg)) + ", Unsigned Offset wParam=" + _Trim$(Str$(wParam)) + ", Offset lParam=" + _Trim$(Str$(lParam))
            'DebugPrint "    Pressed key: " + VirtualKeyCodeToString$(int_wParam)

            ' SEND KEYUP EVENT TO HOST
            sOutput = "u:" + _Trim$(Str$(int_wParam)) + Chr$(13)
            Put #lngConn, , sOutput

            '' INVOKE PAINT
            'InvalidateRect hwnd, 0, -1
            'SendMessage hwnd, WM_PAINT, 0, 0
            MainWndProc = 0

            Exit Function

        Case Else:
            ' some other message
            MainWndProc = DefWindowProc(hwnd, nMsg, wParam, lParam)
    End Select
End Function ' MainWndProc

' /////////////////////////////////////////////////////////////////////////////
' Initializes raw input stuff

Sub InitRawInput ()
    Dim As RAWINPUTDEVICE Rid(0 To 49)
    Dim As Unsigned Long nDevices
    Dim As RAWINPUTDEVICELIST RawInputDeviceList
    Dim As MEM pRawInputDeviceList
    ReDim As RAWINPUTDEVICELIST rawdevs(-1)
    Dim As Unsigned Long x
    Dim iLoop2 As Integer
    Dim strNextID As String

    If GetRawInputDeviceList(0, Offset(nDevices), Len(RawInputDeviceList)) <> 0 Then
        Exit Sub
    End If

    pRawInputDeviceList = MemNew(Len(RawInputDeviceList) * nDevices)
    GetRawInputDeviceList pRawInputDeviceList.OFFSET, Offset(nDevices), Len(RawInputDeviceList)

    ' This small block of commented code proves that we've got the device list
    ReDim As RAWINPUTDEVICELIST rawdevs(0 To nDevices - 1)
    MemGet pRawInputDeviceList, pRawInputDeviceList.OFFSET, rawdevs()

    ' GET DEVICE INFO
    rawinputdevices = "Number of raw input devices:" + Str$(nDevices) + Chr$(13)
    iMouseCount = 0
    'iKeyBoardCount = 0
    For x = 0 To UBound(rawdevs)
        rawinputdevices = rawinputdevices + Str$(rawdevs(x).hDevice) + ":" + Str$(rawdevs(x).dwType) + Chr$(13)

        ' RAWINPUTHEADER (winuser.h) - Win32 apps | Microsoft Learn
        ' https://learn.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-rawinputheader
        ' dwType
        ' Type: DWORD
        ' The type of raw input. It can be one of the following values:
        ' Constant           Value   Meaning
        ' RIM_TYPEMOUSE      0       Raw input comes from the mouse.
        ' RIM_TYPEKEYBOARD   1       Raw input comes from the keyboard.
        ' RIM_TYPEHID        2       Raw input comes from some device that is not a keyboard or a mouse.

        ' WHAT TYPE OF DEVICE IS IT?
        If rawdevs(x).dwType = RIM_TYPEMOUSE Then
            iMouseCount = iMouseCount + 1 ' INCREMENT THE MOUSE COUNT
            strNextID = _Trim$(Str$(rawdevs(x).hDevice)) ' GET THE MOUSE DEVICE ID
            arrMouse(iMouseCount - 1).ID = strNextID ' SAVE THE MOUSE DEVICE ID
            'arrMouse(iMouseCount - 1).UpdateCount = 0
        ElseIf rawdevs(x).dwType = RIM_TYPEKEYBOARD Then
            'iKeyBoardCount = iKeyBoardCount + 1 ' INCREMENT THE KEYBAORD COUNT
            'strNextID = _Trim$(Str$(rawdevs(x).hDevice)) ' GET THE KEYBOARD DEVICE ID
            'arrKeyIndex(iKeyBoardCount - 1) = strNextID ' SAVE THE KEYBOARD DEVICE ID
            'arrLastKeyDown(iKeyBoardCount - 1) = 0
        End If
    Next x

    ' FOR NOW KEYBOARD INFO IS NOT RAW INPUT, UNTIL WE FIGURE IT OUT:
    iLastKeyDown = 0
    iLastKeyUp = 0

    rawinputdevices = rawinputdevices + Chr$(0)
    MemFree pRawInputDeviceList

    Rid(0).usUsagePage = &H01
    Rid(0).usUsage = &H02
    Rid(0).dwFlags = 0
    Rid(0).hwndTarget = 0

    If RegisterRawInputDevices(Offset(Rid()), 1, Len(Rid(0))) = 0 Then
        m_sError = "RawInput init failed" + Chr$(0)
    End If

End Sub ' InitRawInput

' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
' END RAW INPUT FUNCTIONS
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
' BEGIN WINDOW FUNCTIONS
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

' /////////////////////////////////////////////////////////////////////////////
' hWnd = handle to window to set opacity for
' Level = 0 TO 255, 0=totally invisible, 128=transparent, 255=100% solid

Sub SetWindowOpacity (hWnd As _Offset, Level As _Unsigned _Byte)
    Const cIndex = -20
    Const LWA_ALPHA = &H2
    Const WS_EX_LAYERED = &H80000

    Dim lngMsg As Long
    Dim lngValue As Long

    'Function GetWindowLong& Alias "GetWindowLongA" (ByVal hwnd As _Offset, Byval nIndex As Long)
    lngMsg = GetWindowLong(hWnd, cIndex)
    lngMsg = lngMsg Or WS_EX_LAYERED

    'Function SetWindowLong& Alias "SetWindowLongA" (ByVal hwnd As _Offset, Byval nIndex As Long, Byval dwNewLong As Long)
    lngValue = SetWindowLong(hWnd, cIndex, lngMsg)

    'Function SetLayeredWindowAttributes& (ByVal hwnd As _Offset, Byval crKey As Long, Byval bAlpha As _Unsigned _Byte, Byval dwFlags As Long)
    lngValue = SetLayeredWindowAttributes(hWnd, 0, Level, LWA_ALPHA)
End Sub ' SetWindowOpacity

' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
' END WINDOW FUNCTIONS
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
' BEGIN RAW INPUT VARIABLE FUNCTIONS #1
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

' /////////////////////////////////////////////////////////////////////////////
' Initialize variables that store mouse + keyboard input

Sub InitInputVars
    Dim iIndex As Integer
    Dim iLoop As Integer

    ' FOR NOW ONLY SUPPORT UPTO 8 MICE
    If (iMouseCount > 8) Then iMouseCount = 8

    ' INITIALIZE CURSORS, MOUSE STATE, ETC.
    iIndex = LBound(arrMouse) - 1
    For iLoop = 1 To iMouseCount
        iIndex = iIndex + 1
        'DON'T ERASE THE ID!: arrMouse(iIndex).ID = ""
        'arrMouse(iIndex).UpdateCount = 1
        arrMouse(iIndex).dx = 0
        arrMouse(iIndex).dy = 0
        arrMouse(iIndex).px = cMaxPX / 2 ' 0
        arrMouse(iIndex).py = cMaxPY / 2 ' 0
        arrMouse(iIndex).pdx = 0 ' 100
        arrMouse(iIndex).pdy = 0 ' 100
        arrMouse(iIndex).wheel = 0
        'arrMouse(iIndex).wheelOld = 0
        arrMouse(iIndex).LeftDown = FALSE
        'arrMouse(iIndex).LeftDownOld = FALSE
        arrMouse(iIndex).MiddleDown = FALSE
        'arrMouse(iIndex).MiddleDownOld = FALSE
        arrMouse(iIndex).RightDown = FALSE
        'arrMouse(iIndex).RightDownOld = FALSE
    Next iLoop

    ' INITIALIZE KEYBOARD STATE VARIABLES
    iLastKeyDown = 0
    iLastKeyUp = 0
End Sub ' InitInputVars

' /////////////////////////////////////////////////////////////////////////////
' Finds position in array arrMouse where .ID = MouseID

Function GetMouseIndex% (MouseID As String)
    Dim iLoop As Integer
    Dim iIndex%
    iIndex% = LBound(arrMouse) - 1
    For iLoop = LBound(arrMouse) To UBound(arrMouse)
        If arrMouse(iLoop).ID = MouseID Then
            iIndex% = iLoop
            Exit For
        End If
    Next iLoop
    GetMouseIndex% = iIndex%
End Function ' GetMouseIndex%

'' /////////////////////////////////////////////////////////////////////////////
'' Finds position in array arrKeyIndex containing KeyboardID
'
'Function GetKeyboardIndex% (KeyboardID As String)
'    Dim iLoop As Integer
'    Dim iIndex%
'    iIndex% = LBound(arrKeyIndex) - 1
'    For iLoop = LBound(arrKeyIndex) To UBound(arrKeyIndex)
'        If arrKeyIndex(iLoop) = KeyboardID Then
'            iIndex% = iLoop
'            Exit For
'        End If
'    Next iLoop
'    GetKeyboardIndex% = iIndex%
'End Function ' GetKeyboardIndex%

' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
' END RAW INPUT VARIABLE FUNCTIONS #1
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
' BEGIN FILE FUNCTIONS
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
'WORKS IN QB64PE BUT NOT QB64:
'' /////////////////////////////////////////////////////////////////////////////
'' QB64 Phoenix Edition › QB64 Rising › Code and Stuff › Help Me!
'' Using shell to delete a file
'' https://qb64phoenix.com/forum/showthread.php?tid=2618&pid=24683#pid24683
'' a740g
'' #5
'' 04-24-2024, 06:05 AM
''
'' There are no commands to directly make copies or backup of files.
'' But you could write one with a few lines of code like:
''
'' Copies src to dst
'' Set overwite to true if dst should be overwritten if present
'Sub CopyFile (src As String, dst As String, overwrite As _Byte)
'    If _FileExists(src) Then
'        If Not _FileExists(dst) Or (_FileExists(dst) And overwrite) Then
'            _WriteFile dst, _ReadFile$(src)
'        End If
'    End If
'End Sub ' CopyFile

' /////////////////////////////////////////////////////////////////////////////
' Convert a value to string and trim it (because normal Str$ adds spaces)

Function cstr$ (myValue)
    'cstr$ = LTRIM$(RTRIM$(STR$(myValue)))
    cstr$ = _Trim$(Str$(myValue))
End Function ' cstr$

' /////////////////////////////////////////////////////////////////////////////

Sub DebugLog1 (sText As String)
    Dim sResult As String
    If _FileExists(m_sDebugFile) Then
        sResult = PrintFile$(m_sDebugFile, sText, TRUE)
    Else
        sResult = PrintFile$(m_sDebugFile, sText, FALSE)
    End If
End Sub ' DebugLog

' /////////////////////////////////////////////////////////////////////////////
' QB64 Phoenix Edition › QB64 Rising › Code and Stuff › Help Me!
' Using shell to delete a file
' https://qb64phoenix.com/forum/showthread.php?tid=2618

Sub DeleteFile (sFile As String)
    If _FileExists(sFile) Then
        'Shell "DELETE " + sFile
        'Shell "del " + sFile
        Kill sFile
    End If
End Sub ' DeleteFile

' /////////////////////////////////////////////////////////////////////////////

Function FileExt$ (sFile As String)
    Dim iPos As Integer
    iPos = _InStrRev(sFile, ".")
    If iPos > 0 Then
        If Len(sFile) > 1 Then
            If iPos > 1 Then
                FileExt$ = Right$(sFile, Len(sFile) - iPos)
            Else
                ' dot is first character, return everything after it
                FileExt$ = Right$(sFile, Len(sFile) - 1)
            End If
        Else
            ' file only has one character, the dot, the file extension is blank
            FileExt$ = ""
        End If
    Else
        ' no dot found, the file extension is blank
        FileExt$ = ""
    End If
End Function ' FileExt$

' /////////////////////////////////////////////////////////////////////////////

Function NameOnly$ (sFile As String, sSlash As String)
    Dim iPos As Integer
    'sFile = Replace$(sFile, "/", "\")

    iPos = _InStrRev(sFile, sSlash)
    If iPos > 0 Then
        If Len(sFile) > 1 Then
            If iPos > 1 Then
                NameOnly$ = Right$(sFile, Len(sFile) - iPos)
            Else
                ' slash is first character, return everything after it
                NameOnly$ = Right$(sFile, Len(sFile) - 1)
            End If
        Else
            ' file only has one character, the slash, name is blank
            NameOnly$ = ""
        End If
    Else
        ' slash not found, return the entire thing
        NameOnly$ = sFile
    End If
End Function ' NameOnly$

' /////////////////////////////////////////////////////////////////////////////

Function NoExt$ (sFile As String)
    Dim iPos As Integer
    iPos = _InStrRev(sFile, ".")
    If iPos > 0 Then
        If Len(sFile) > 1 Then
            If iPos > 1 Then
                NoExt$ = Left$(sFile, iPos - 1)
            Else
                ' dot is first character, removing it returns blank!
                ' our version will just return the name unchanged
                ' but you can return blank if you prefer
                NoExt$ = sFile
            End If
        Else
            ' file only has one character, the dot, removing it returns blank!
            ' our version will just return the name unchanged
            ' but you can return blank if you prefer
            NoExt$ = sFile
        End If
    Else
        ' no dot found
        ' return the name unchanged
        NoExt$ = sFile
    End If
End Function ' NoExt$

' /////////////////////////////////////////////////////////////////////////////

Function PathOnly$ (sFile As String, sSlash As String)
    Dim iPos As Integer
    'sFile = Replace$(sFile, "/", "\")

    iPos = _InStrRev(sFile, sSlash)
    If iPos > 0 Then
        If Len(sFile) > 1 Then
            If iPos > 1 Then
                PathOnly$ = Left$(sFile, iPos)
            Else
                ' slash is first character, so not much of a path, return blank
                PathOnly$ = ""
            End If
        Else
            ' file only has one character, the slash, name is blank
            PathOnly$ = ""
        End If
    Else
        ' slash not found, so not a path, return blank
        PathOnly$ = ""
    End If
End Function ' PathOnly$

' /////////////////////////////////////////////////////////////////////////////
' Writes sText to file sFileName.
' If bAppend=TRUE appends to file, else overwrites it.

' Returns blank if successful else returns error message.

' Example:
' ProgramPath$ = Left$(Command$(0), _InStrRev(Command$(0), "\"))
' ProgramName$: m_ProgramName$ = Mid$(Command$(0), _InStrRev(Command$(0), "\") + 1)
' sFileName = ProgramPath$ + ProgramName$ + ".OUT.txt"
' sText = "This is a test." + chr$(13) + "Here is line 2." + chr$(13) + "End."
' sError = PrintFile$(sFileName, sText, FALSE)

Function PrintFile$ (sFileName As String, sText As String, bAppend As Integer)
    Dim sError As String: sError = ""

    If (bAppend = TRUE) Then
        If _FileExists(sFileName) Then
            Open sFileName For Append As #1 ' opens an existing file for appending
        Else
            sError = "Error in PrintFile$ : File not found. Cannot append."
        End If
    Else
        Open sFileName For Output As #1 ' opens and clears an existing file or creates new empty file
    End If

    If Len(sError) = 0 Then
        ' NOTE: WRITE places text in quotes in the file
        'WRITE #1, x, y, z$
        'WRITE #1, sText

        ' PRINT does not put text inside quotes
        Print #1, sText

        Close #1
    End If

    PrintFile$ = sError
End Function ' PrintFile$

' /////////////////////////////////////////////////////////////////////////////
' Fastest way is always to just read the whole life at once and then parse it.

Function ReadTextFile$ (sFileName As String, sDefault As String)
    Dim x$
    If _FileExists(sFileName) Then
        Open sFileName For Binary As #1
        x$ = Space$(LOF(1))
        Get #1, 1, x$
        Close #1
        ReadTextFile$ = x$
    Else
        ReadTextFile$ = sDefault
    End If
End Function ' ReadTextFile$

' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
' END FILE FUNCTIONS
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
' BEGIN CONSTANT TO STRING FUNCTIONS
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

' /////////////////////////////////////////////////////////////////////////////

Function VirtualKeyCodeToString$ (MyInteger As Integer)
    Dim Mystring As String

    Select Case MyInteger
        Case VK_LBUTTON:
            Mystring = "VK_LBUTTON"
        Case VK_RBUTTON:
            Mystring = "VK_RBUTTON"
        Case VK_CANCEL:
            Mystring = "VK_CANCEL"
        Case VK_MBUTTON:
            Mystring = "VK_MBUTTON"
        Case VK_XBUTTON1:
            Mystring = "VK_XBUTTON1"
        Case VK_XBUTTON2:
            Mystring = "VK_XBUTTON2"
        Case VK_BACK:
            Mystring = "VK_BACK"
        Case VK_TAB:
            Mystring = "VK_TAB"
        Case VK_CLEAR:
            Mystring = "VK_CLEAR"
        Case VK_RETURN:
            Mystring = "VK_RETURN"
        Case VK_SHIFT:
            Mystring = "VK_SHIFT"
        Case VK_CONTROL:
            Mystring = "VK_CONTROL"
        Case VK_MENU:
            Mystring = "VK_MENU"
        Case VK_PAUSE:
            Mystring = "VK_PAUSE"
        Case VK_CAPITAL:
            Mystring = "VK_CAPITAL"
        Case VK_KANA:
            Mystring = "VK_KANA"
        Case VK_HANGUL:
            Mystring = "VK_HANGUL"
        Case VK_IME_ON:
            Mystring = "VK_IME_ON"
        Case VK_JUNJA:
            Mystring = "VK_JUNJA"
        Case VK_FINAL:
            Mystring = "VK_FINAL"
        Case VK_HANJA:
            Mystring = "VK_HANJA"
        Case VK_KANJI:
            Mystring = "VK_KANJI"
        Case VK_IME_OFF:
            Mystring = "VK_IME_OFF"
        Case VK_ESCAPE:
            Mystring = "VK_ESCAPE"
        Case VK_CONVERT:
            Mystring = "VK_CONVERT"
        Case VK_NONCONVERT:
            Mystring = "VK_NONCONVERT"
        Case VK_ACCEPT:
            Mystring = "VK_ACCEPT"
        Case VK_MODECHANGE:
            Mystring = "VK_MODECHANGE"
        Case VK_SPACE:
            Mystring = "VK_SPACE"
        Case VK_PRIOR:
            Mystring = "VK_PRIOR"
        Case VK_NEXT:
            Mystring = "VK_NEXT"
        Case VK_END:
            Mystring = "VK_END"
        Case VK_HOME:
            Mystring = "VK_HOME"
        Case VK_LEFT:
            Mystring = "VK_LEFT"
        Case VK_UP:
            Mystring = "VK_UP"
        Case VK_RIGHT:
            Mystring = "VK_RIGHT"
        Case VK_DOWN:
            Mystring = "VK_DOWN"
        Case VK_SELECT:
            Mystring = "VK_SELECT"
        Case VK_PRINT:
            Mystring = "VK_PRINT"
        Case VK_EXECUTE:
            Mystring = "VK_EXECUTE"
        Case VK_SNAPSHOT:
            Mystring = "VK_SNAPSHOT"
        Case VK_INSERT:
            Mystring = "VK_INSERT"
        Case VK_DELETE:
            Mystring = "VK_DELETE"
        Case VK_HELP:
            Mystring = "VK_HELP"
        Case VK_0:
            Mystring = "VK_0"
        Case VK_1:
            Mystring = "VK_1"
        Case VK_2:
            Mystring = "VK_2"
        Case VK_3:
            Mystring = "VK_3"
        Case VK_4:
            Mystring = "VK_4"
        Case VK_5:
            Mystring = "VK_5"
        Case VK_6:
            Mystring = "VK_6"
        Case VK_7:
            Mystring = "VK_7"
        Case VK_8:
            Mystring = "VK_8"
        Case VK_9:
            Mystring = "VK_9"
        Case VK_A:
            Mystring = "VK_A"
        Case VK_B:
            Mystring = "VK_B"
        Case VK_C:
            Mystring = "VK_C"
        Case VK_D:
            Mystring = "VK_D"
        Case VK_E:
            Mystring = "VK_E"
        Case VK_F:
            Mystring = "VK_F"
        Case VK_G:
            Mystring = "VK_G"
        Case VK_H:
            Mystring = "VK_H"
        Case VK_I:
            Mystring = "VK_I"
        Case VK_J:
            Mystring = "VK_J"
        Case VK_K:
            Mystring = "VK_K"
        Case VK_L:
            Mystring = "VK_L"
        Case VK_M:
            Mystring = "VK_M"
        Case VK_N:
            Mystring = "VK_N"
        Case VK_O:
            Mystring = "VK_O"
        Case VK_P:
            Mystring = "VK_P"
        Case VK_Q:
            Mystring = "VK_Q"
        Case VK_R:
            Mystring = "VK_R"
        Case VK_S:
            Mystring = "VK_S"
        Case VK_T:
            Mystring = "VK_T"
        Case VK_U:
            Mystring = "VK_U"
        Case VK_V:
            Mystring = "VK_V"
        Case VK_W:
            Mystring = "VK_W"
        Case VK_X:
            Mystring = "VK_X"
        Case VK_Y:
            Mystring = "VK_Y"
        Case VK_Z:
            Mystring = "VK_Z"
        Case VK_LWIN:
            Mystring = "VK_LWIN"
        Case VK_RWIN:
            Mystring = "VK_RWIN"
        Case VK_APPS:
            Mystring = "VK_APPS"
        Case VK_SLEEP:
            Mystring = "VK_SLEEP"
        Case VK_NUMPAD0:
            Mystring = "VK_NUMPAD0"
        Case VK_NUMPAD1:
            Mystring = "VK_NUMPAD1"
        Case VK_NUMPAD2:
            Mystring = "VK_NUMPAD2"
        Case VK_NUMPAD3:
            Mystring = "VK_NUMPAD3"
        Case VK_NUMPAD4:
            Mystring = "VK_NUMPAD4"
        Case VK_NUMPAD5:
            Mystring = "VK_NUMPAD5"
        Case VK_NUMPAD6:
            Mystring = "VK_NUMPAD6"
        Case VK_NUMPAD7:
            Mystring = "VK_NUMPAD7"
        Case VK_NUMPAD8:
            Mystring = "VK_NUMPAD8"
        Case VK_NUMPAD9:
            Mystring = "VK_NUMPAD9"
        Case VK_MULTIPLY:
            Mystring = "VK_MULTIPLY"
        Case VK_ADD:
            Mystring = "VK_ADD"
        Case VK_SEPARATOR:
            Mystring = "VK_SEPARATOR"
        Case VK_SUBTRACT:
            Mystring = "VK_SUBTRACT"
        Case VK_DECIMAL:
            Mystring = "VK_DECIMAL"
        Case VK_DIVIDE:
            Mystring = "VK_DIVIDE"
        Case VK_F1:
            Mystring = "VK_F1"
        Case VK_F2:
            Mystring = "VK_F2"
        Case VK_F3:
            Mystring = "VK_F3"
        Case VK_F4:
            Mystring = "VK_F4"
        Case VK_F5:
            Mystring = "VK_F5"
        Case VK_F6:
            Mystring = "VK_F6"
        Case VK_F7:
            Mystring = "VK_F7"
        Case VK_F8:
            Mystring = "VK_F8"
        Case VK_F9:
            Mystring = "VK_F9"
        Case VK_F10:
            Mystring = "VK_F10"
        Case VK_F11:
            Mystring = "VK_F11"
        Case VK_F12:
            Mystring = "VK_F12"
        Case VK_F13:
            Mystring = "VK_F13"
        Case VK_F14:
            Mystring = "VK_F14"
        Case VK_F15:
            Mystring = "VK_F15"
        Case VK_F16:
            Mystring = "VK_F16"
        Case VK_F17:
            Mystring = "VK_F17"
        Case VK_F18:
            Mystring = "VK_F18"
        Case VK_F19:
            Mystring = "VK_F19"
        Case VK_F20:
            Mystring = "VK_F20"
        Case VK_F21:
            Mystring = "VK_F21"
        Case VK_F22:
            Mystring = "VK_F22"
        Case VK_F23:
            Mystring = "VK_F23"
        Case VK_F24:
            Mystring = "VK_F24"
        Case VK_NUMLOCK:
            Mystring = "VK_NUMLOCK"
        Case VK_SCROLL:
            Mystring = "VK_SCROLL"
        Case VK_LSHIFT:
            Mystring = "VK_LSHIFT"
        Case VK_RSHIFT:
            Mystring = "VK_RSHIFT"
        Case VK_LCONTROL:
            Mystring = "VK_LCONTROL"
        Case VK_RCONTROL:
            Mystring = "VK_RCONTROL"
        Case VK_LMENU:
            Mystring = "VK_LMENU"
        Case VK_RMENU:
            Mystring = "VK_RMENU"
        Case VK_BROWSER_BACK:
            Mystring = "VK_BROWSER_BACK"
        Case VK_BROWSER_FORWARD:
            Mystring = "VK_BROWSER_FORWARD"
        Case VK_BROWSER_REFRESH:
            Mystring = "VK_BROWSER_REFRESH"
        Case VK_BROWSER_STOP:
            Mystring = "VK_BROWSER_STOP"
        Case VK_BROWSER_SEARCH:
            Mystring = "VK_BROWSER_SEARCH"
        Case VK_BROWSER_FAVORITES:
            Mystring = "VK_BROWSER_FAVORITES"
        Case VK_BROWSER_HOME:
            Mystring = "VK_BROWSER_HOME"
        Case VK_VOLUME_MUTE:
            Mystring = "VK_VOLUME_MUTE"
        Case VK_VOLUME_DOWN:
            Mystring = "VK_VOLUME_DOWN"
        Case VK_VOLUME_UP:
            Mystring = "VK_VOLUME_UP"
        Case VK_MEDIA_NEXT_TRACK:
            Mystring = "VK_MEDIA_NEXT_TRACK"
        Case VK_MEDIA_PREV_TRACK:
            Mystring = "VK_MEDIA_PREV_TRACK"
        Case VK_MEDIA_STOP:
            Mystring = "VK_MEDIA_STOP"
        Case VK_MEDIA_PLAY_PAUSE:
            Mystring = "VK_MEDIA_PLAY_PAUSE"
        Case VK_LAUNCH_MAIL:
            Mystring = "VK_LAUNCH_MAIL"
        Case VK_LAUNCH_MEDIA_SELECT:
            Mystring = "VK_LAUNCH_MEDIA_SELECT"
        Case VK_LAUNCH_APP1:
            Mystring = "VK_LAUNCH_APP1"
        Case VK_LAUNCH_APP2:
            Mystring = "VK_LAUNCH_APP2"
        Case VK_OEM_1:
            Mystring = "VK_OEM_1"
        Case VK_OEM_PLUS:
            Mystring = "VK_OEM_PLUS"
        Case VK_OEM_COMMA:
            Mystring = "VK_OEM_COMMA"
        Case VK_OEM_MINUS:
            Mystring = "VK_OEM_MINUS"
        Case VK_OEM_PERIOD:
            Mystring = "VK_OEM_PERIOD"
        Case VK_OEM_2:
            Mystring = "VK_OEM_2"
        Case VK_OEM_3:
            Mystring = "VK_OEM_3"
        Case VK_OEM_4:
            Mystring = "VK_OEM_4"
        Case VK_OEM_5:
            Mystring = "VK_OEM_5"
        Case VK_OEM_6:
            Mystring = "VK_OEM_6"
        Case VK_OEM_7:
            Mystring = "VK_OEM_7"
        Case VK_OEM_8:
            Mystring = "VK_OEM_8"
        Case VK_OEM_102:
            Mystring = "VK_OEM_102"
        Case VK_PROCESSKEY:
            Mystring = "VK_PROCESSKEY"
        Case VK_PACKET:
            Mystring = "VK_PACKET"
        Case VK_ATTN:
            Mystring = "VK_ATTN"
        Case VK_CRSEL:
            Mystring = "VK_CRSEL"
        Case VK_EXSEL:
            Mystring = "VK_EXSEL"
        Case VK_EREOF:
            Mystring = "VK_EREOF"
        Case VK_PLAY:
            Mystring = "VK_PLAY"
        Case VK_ZOOM:
            Mystring = "VK_ZOOM"
        Case VK_NONAME:
            Mystring = "VK_NONAME"
        Case VK_PA1:
            Mystring = "VK_PA1"
        Case VK_OEM_CLEAR:
            Mystring = "VK_OEM_CLEAR"
        Case Else:
            Mystring = _Trim$(Str$(MyInteger))
    End Select
    VirtualKeyCodeToString$ = Mystring
End Function ' VirtualKeyCodeToString$

' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
' END CONSTANT TO STRING FUNCTIONS
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
' BEGIN GENERAL PURPOSE FUNCTIONS
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

' /////////////////////////////////////////////////////////////////////////////
' SMcNeill
' More efficient version of ExtendedTimer.
' This stores our day values and only updates them when necessary.
' We really don't need to figure out how many seconds are in today over and over endlessly
' -- just count them once, and when the clock swaps back to 0:0:0, add 24*60*60 seconds to the count.
' Re: how to time something (ie do loop for n seconds)
' https://forum.qb64.org/index.php?topic=4682.0

Function ExtendedTimer##
    'modified extendedtimer to store the old day's count, and not have to recalculate it every time the routine is called.

    Static olds As _Float, old_day As _Float
    Dim m As Integer, d As Integer, y As Integer
    Dim s As _Float, day As String
    Dim oldt As Single
    If olds = 0 Then 'calculate the day the first time the extended timer runs
        day = Date$
        m = Val(Left$(day, 2))
        d = Val(Mid$(day, 4, 2))
        y = Val(Right$(day, 4)) - 1970
        Select Case m 'Add the number of days for each previous month passed
            Case 2: d = d + 31
            Case 3: d = d + 59
            Case 4: d = d + 90
            Case 5: d = d + 120
            Case 6: d = d + 151
            Case 7: d = d + 181
            Case 8: d = d + 212
            Case 9: d = d + 243
            Case 10: d = d + 273
            Case 11: d = d + 304
            Case 12: d = d + 334
        End Select
        If (y Mod 4) = 2 And m > 2 Then d = d + 1 'add a day if this is leap year and we're past february
        d = (d - 1) + 365 * y 'current month days passed + 365 days per each standard year
        d = d + (y + 2) \ 4 'add in days for leap years passed
        s = d * 24 * 60 * 60 'Seconds are days * 24 hours * 60 minutes * 60 seconds
        old_day = s
    End If
    If Timer < oldt Then 'we went from 23:59:59 (a second before midnight) to 0:0:0 (midnight)
        old_day = s + 83400 'add another worth of seconds to our counter
    End If
    oldt = Timer
    olds = old_day + oldt
    ExtendedTimer## = olds
End Function ' ExtendedTimer##

' /////////////////////////////////////////////////////////////////////////////
' Simple timestamp function
' Format: {YYYY}-{MM}-{DD} {hh}:[mm}:{ss}

' Uses:
'     TIME$
'         The TIME$ Function returns a STRING representation
'         of the current computer time in a 24 hour format.
'         https://qb64phoenix.com/qb64wiki/index.php/TIME$
'     DATE$
'         The DATE$ function returns the current computer date
'         as a string in the format "mm-dd-yyyy".
'         https://qb64phoenix.com/qb64wiki/index.php/DATE$
'
' TODO: support template where
'       {yyyy} = 4 digit year
'       {mm}   = 2 digit month
'       {dd}   = 2 digit day
'       {hh}   = 2 digit hour (12-hour)
'       {rr}   = 2 digit hour (24-hour)
'       {nn}   = 2 digit minute
'       {ss}   = 2 digit second
'       {ampm} = AM/PM

' We got the nn for minute from Microsoft > Office VBA Reference > DateDiff function
' https://docs.microsoft.com/en-us/office/vba/language/reference/user-interface-help/datediff-function

' PRINT "Current date time (simple format) = " + Chr$(34) + GetCurrentDateTime$("{yyyy}-{mm}-{dd} {rr}:{nn}:{ss}") + Chr$(34)
' PRINT "Current date time (US format)     = " + Chr$(34) + GetCurrentDateTime$("{mm}/{dd}/{yyyy} {hh}:{nn}:{ss} {ampm}") + Chr$(34)
' PRINT "Filename timestamp                = " + Chr$(34) + GetCurrentDateTime$("{yyyy}{mm}{dd}_{rr}{nn}{ss}") + Chr$(34)

Function GetCurrentDateTime$ (sTemplate$)
    Dim sDate$: sDate$ = Date$
    Dim sTime$: sTime$ = Time$
    Dim sYYYY$: sYYYY$ = Mid$(sDate$, 7, 4)
    Dim sMM$: sMM$ = Mid$(sDate$, 1, 2)
    Dim sDD$: sDD$ = Mid$(sDate$, 4, 2)
    Dim sHH24$: sHH24$ = Mid$(sTime$, 1, 2)
    Dim sHH$: sHH$ = ""
    Dim sMI$: sMI$ = Mid$(sTime$, 4, 2)
    Dim sSS$: sSS$ = Mid$(sTime$, 7, 2)
    Dim iHour%: iHour% = Val(sHH24$)
    Dim sAMPM$: sAMPM$ = ""
    Dim result$: result$ = ""

    ' FIGURE OUT AM/PM
    If InStr(sTemplate$, "{ampm}") > 0 Then
        If iHour% = 0 Then
            sAMPM$ = "AM"
            iHour% = 12
        ElseIf iHour% > 0 And iHour% < 12 Then
            sAMPM$ = "AM"
        ElseIf iHour% = 12 Then
            sAMPM$ = "PM"
        Else
            sAMPM$ = "PM"
            iHour% = iHour% - 12
        End If
        sHH$ = Right$("00" + _Trim$(Str$(iHour%)), 2)
    End If

    ' POPULATE TEMPLATE
    result$ = sTemplate$
    result$ = Replace$(result$, "{yyyy}", sYYYY$)
    result$ = Replace$(result$, "{mm}", sMM$)
    result$ = Replace$(result$, "{dd}", sDD$)
    result$ = Replace$(result$, "{hh}", sHH$)
    result$ = Replace$(result$, "{rr}", sHH24$)
    result$ = Replace$(result$, "{nn}", sMI$)
    result$ = Replace$(result$, "{ss}", sSS$)
    result$ = Replace$(result$, "{ampm}", sAMPM$)

    ' RETURN RESULT
    GetCurrentDateTime$ = result$
End Function ' GetCurrentDateTime$

' /////////////////////////////////////////////////////////////////////////////
' FOR BITWISE OPERATIONS

Function HasBit% (iByte As Integer, iBit As Integer)
    ''TODO: precalculate
    'dim shared m_arrBitValue(1 To 8) As Integer
    'dim iLoop as Integer
    'For iLoop = 0 To 7
    '   m_arrBitValue(iLoop + 1) = 2 ^ iLoop
    'Next iLoop
    'HasBit% = ((iByte And m_arrBitValue(iBit)) = m_arrBitValue(iBit))
    Dim iBitValue As Integer
    iBitValue = 2 ^ (iBit - 1)
    HasBit% = ((iByte And iBitValue) = iBitValue)
End Function ' HasBit%

' /////////////////////////////////////////////////////////////////////////////
' IIF function for QB for integers

Function IIF (Condition, IfTrue, IfFalse)
    If Condition Then IIF = IfTrue Else IIF = IfFalse
End Function

' /////////////////////////////////////////////////////////////////////////////
' IIF function for QB for strings

Function IIFS$ (Condition, IfTrue$, IfFalse$)
    If Condition Then IIFS$ = IfTrue$ Else IIFS$ = IfFalse$
End Function

' /////////////////////////////////////////////////////////////////////////////
' Returns TRUE if value OriginalString$ is numeric.

' Re: Does a Is Number function exist in QB64?
' https://www.qb64.org/forum/index.php?topic=896.15

' Version 2 by madscijr
' Returns TRUE (-1) if string is an integer, FALSE (0) if not

' Version 1 by MWheatley
' Reply #18 on: January 01, 2019, 11:24:30 AM
' returns 1 if string is an integer, 0 if not

Function IsNumber% (OriginalString$)
    Dim bResult%: bResult% = FALSE
    Dim iLoop%
    Dim TestString$
    'Dim bNegative%
    Dim iDecimalCount%
    Dim sNextChar$

    'THEY SHOULD TRIM OUTSIDE THE FUNCTION!
    'TestString$ = _TRIM$(OriginalString$)

    If Len(OriginalString$) > 0 Then
        TestString$ = ""
        If Left$(OriginalString$, 1) = "+" Then
            TestString$ = Right$(OriginalString$, Len(OriginalString$) - 1)
            'bNegative% = FALSE
        ElseIf Left$(OriginalString$, 1) = "-" Then
            TestString$ = Right$(OriginalString$, Len(OriginalString$) - 1)
            'bNegative% = TRUE
        Else
            TestString$ = OriginalString$
            'bNegative% = FALSE
        End If
        If Len(TestString$) > 0 Then
            bResult% = TRUE
            iDecimalCount% = 0
            For iLoop% = 1 To Len(TestString$)
                sNextChar$ = Mid$(TestString$, iLoop%, 1)
                If sNextChar$ = "." Then
                    iDecimalCount% = iDecimalCount% + 1
                    If iDecimalCount% > 1 Then
                        ' TOO MANY DECIMAL POINTS, INVALID!
                        bResult% = FALSE
                        Exit For
                    End If
                ElseIf Asc(sNextChar$) < 48 Or Asc(sNextChar$) > 57 Then
                    ' NOT A NUMERAL OR A DECIMAL, INVALID!
                    bResult% = FALSE
                    Exit For
                End If
            Next iLoop%
        End If
    End If
    IsNumber% = bResult%
End Function ' IsNumber%

' /////////////////////////////////////////////////////////////////////////////
' FROM: String Manipulation
' found at abandoned, outdated and now likely malicious qb64 dot net website
' http://www.qb64.[net]/forum/index_topic_5964-0/
'
'SUMMARY:
'   Purpose:  A library of custom functions that transform strings.
'   Author:   Dustinian Camburides (dustinian@gmail.com)
'   Platform: QB64 (www.qb64.org)
'   Revision: 1.6
'   Updated:  5/28/2012

'SUMMARY:
'[Replace$] replaces all instances of the [Find] sub-string with the [Add] sub-string within the [Text] string.
'INPUT:
'Text: The input string; the text that's being manipulated.
'Find: The specified sub-string; the string sought within the [Text] string.
'Add: The sub-string that's being added to the [Text] string.

Function Replace$ (Text1 As String, Find1 As String, Add1 As String)
    ' VARIABLES:
    Dim Text2 As String
    Dim Find2 As String
    Dim Add2 As String
    Dim lngLocation As Long ' The address of the [Find] substring within the [Text] string.
    Dim strBefore As String ' The characters before the string to be replaced.
    Dim strAfter As String ' The characters after the string to be replaced.

    ' INITIALIZE:
    ' MAKE COPIESSO THE ORIGINAL IS NOT MODIFIED (LIKE ByVal IN VBA)
    Text2 = Text1
    Find2 = Find1
    Add2 = Add1

    lngLocation = InStr(1, Text2, Find2)

    ' PROCESSING:
    ' While [Find2] appears in [Text2]...
    While lngLocation
        ' Extract all Text2 before the [Find2] substring:
        strBefore = Left$(Text2, lngLocation - 1)

        ' Extract all text after the [Find2] substring:
        strAfter = Right$(Text2, ((Len(Text2) - (lngLocation + Len(Find2) - 1))))

        ' Return the substring:
        Text2 = strBefore + Add2 + strAfter

        ' Locate the next instance of [Find2]:
        lngLocation = InStr(1, Text2, Find2)

        ' Next instance of [Find2]...
    Wend

    ' OUTPUT:
    Replace$ = Text2
End Function ' Replace$

' /////////////////////////////////////////////////////////////////////////////
' Split and join strings
' https://www.qb64.org/forum/index.php?topic=1073.0

'Combine all elements of in$() into a single string with delimiter$ separating the elements.

Function join$ (in$(), delimiter$)
    Dim result$
    Dim iLoop As Integer
    result$ = in$(LBound(in$))
    For iLoop = LBound(in$) + 1 To UBound(in$)
        result$ = result$ + delimiter$ + in$(iLoop)
    Next iLoop
    join$ = result$
End Function ' join$

' /////////////////////////////////////////////////////////////////////////////
' Split and join strings
' https://www.qb64.org/forum/index.php?topic=1073.0
'
' FROM luke, QB64 Developer
' Date: February 15, 2019, 04:11:07 AM
'
' Given a string of words separated by spaces (or any other character),
' splits it into an array of the words. I've no doubt many people have
' written a version of this over the years and no doubt there's a million
' ways to do it, but I thought I'd put mine here so we have at least one
' version. There's also a join function that does the opposite
' array -> single string.
'
' Code is hopefully reasonably self explanatory with comments and a little demo.
' Note, this is akin to Python/JavaScript split/join, PHP explode/implode.

'Split in$ into pieces, chopping at every occurrence of delimiter$. Multiple consecutive occurrences
'of delimiter$ are treated as a single instance. The chopped pieces are stored in result$().
'
'delimiter$ must be one character long.
'result$() must have been REDIMmed previously.

' Modified to handle multi-character delimiters

Sub split (in$, delimiter$, result$())
    Dim start As Integer
    Dim finish As Integer
    Dim iDelimLen As Integer
    ReDim result$(-1)

    iDelimLen = Len(delimiter$)

    start = 1
    Do
        'While Mid$(in$, start, 1) = delimiter$
        While Mid$(in$, start, iDelimLen) = delimiter$
            'start = start + 1
            start = start + iDelimLen
            If start > Len(in$) Then
                Exit Sub
            End If
        Wend
        finish = InStr(start, in$, delimiter$)
        If finish = 0 Then
            finish = Len(in$) + 1
        End If

        ReDim _Preserve result$(0 To UBound(result$) + 1)

        result$(UBound(result$)) = Mid$(in$, start, finish - start)
        start = finish + 1
    Loop While start <= Len(in$)
End Sub ' split

'' /////////////////////////////////////////////////////////////////////////////
'
'Sub SplitTest
'    Dim in$
'    Dim delim$
'    ReDim arrText$(0)
'    Dim iLoop%
'
'    delim$ = Chr$(10)
'    in$ = "this" + delim$ + "is" + delim$ + "a" + delim$ + "test"
'    Print "in$ = " + Chr$(34) + in$ + Chr$(34)
'    Print "delim$ = " + Chr$(34) + delim$ + Chr$(34)
'    split in$, delim$, arrText$()
'
'    For iLoop% = LBound(arrText$) To UBound(arrText$)
'        Print "arrText$(" + _Trim$(Str$(iLoop%)) + ") = " + Chr$(34) + arrText$(iLoop%) + Chr$(34)
'    Next iLoop%
'    Print
'    Print "Split test finished."
'End Sub ' SplitTest

'' /////////////////////////////////////////////////////////////////////////////
'
'Sub SplitAndReplaceTest
'    Dim in$
'    Dim out$
'    Dim iLoop%
'    ReDim arrText$(0)
'
'    Print "-------------------------------------------------------------------------------"
'    Print "SplitAndReplaceTest"
'    Print
'
'    Print "Original value"
'    in$ = "This line 1 " + Chr$(13) + Chr$(10) + "and line 2" + Chr$(10) + "and line 3 " + Chr$(13) + "finally THE END."
'    out$ = in$
'    out$ = Replace$(out$, Chr$(13), "\r")
'    out$ = Replace$(out$, Chr$(10), "\n")
'    out$ = Replace$(out$, Chr$(9), "\t")
'    Print "in$ = " + Chr$(34) + out$ + Chr$(34)
'    Print
'
'    Print "Fixing linebreaks..."
'    in$ = Replace$(in$, Chr$(13) + Chr$(10), Chr$(13))
'    in$ = Replace$(in$, Chr$(10), Chr$(13))
'    out$ = in$
'    out$ = Replace$(out$, Chr$(13), "\r")
'    out$ = Replace$(out$, Chr$(10), "\n")
'    out$ = Replace$(out$, Chr$(9), "\t")
'    Print "in$ = " + Chr$(34) + out$ + Chr$(34)
'    Print
'
'    Print "Splitting up..."
'    split in$, Chr$(13), arrText$()
'
'    For iLoop% = LBound(arrText$) To UBound(arrText$)
'        out$ = arrText$(iLoop%)
'        out$ = Replace$(out$, Chr$(13), "\r")
'        out$ = Replace$(out$, Chr$(10), "\n")
'        out$ = Replace$(out$, Chr$(9), "\t")
'        Print "arrText$(" + cstr$(iLoop%) + ") = " + Chr$(34) + out$ + Chr$(34)
'    Next iLoop%
'    Print
'
'    Print "SplitAndReplaceTest finished."
'End Sub ' SplitAndReplaceTest

' /////////////////////////////////////////////////////////////////////////////
' Use to pretty print TRUE and FALSE values.

Function TrueFalse$ (myValue)
    If myValue = TRUE Then
        TrueFalse$ = "TRUE"
    Else
        TrueFalse$ = "FALSE"
    End If
End Function ' TrueFalse$

' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
' END GENERAL PURPOSE FUNCTIONS
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
' BEGIN handle MEM for any type
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
' QB64 GPT Just Rewrote My Code
' https://qb64phoenix.com/forum/showthread.php?tid=2728

' And the revisions QB64 GPT made (after minor changes and me asking it to redo some syntax errors):
' It separated out a lot of processing out to separate subs.
' It is quite impressive how little input I had to give it to fix its mistakes.
' The code actually worked just as well as it did before the changes, which blows my mind.
' It actually even listened to me when I told it that it would need to cast an OFFSET type by using VAL(STR$(var)).
' To be fair, I had to tell it "ByRef" was invalid and a couple of other things.
' I also had to declare "y" each time it was used. But the last iteration only required me to declare "y".
' I think that is a decent enough result. Too bad I can't get it to be this good every time.
' 1) This is the paid version of GPT4. I am on the plus plan, so whatever that one has.
' 2) I think I deleted the session. Sorry. I only used it for as long as I needed it.
' 3) I don't know what the hard limit is. It's in "tokens", which I have no idea how those are calculated.
' I got a pretty large source code from one output and it can take a lot of input. I would just say it can handle quite a bit.
' The GPT I used was one I trained using the Wiki, sample code, etc. At the time, it used GPT4.
' Custom GPTs now use 4o. I will probably need to republish it to take advantage of 4o for it.
' I guess training is the wrong word. A custom GPT has a "knowledge base".
' You can have a maximum of 20 files.
' It can use those files to create an answer. Even a zip folder can be used.
' It will basically only use the knowledge base when specifically asked. Otherwise, it is using whatever it already had in its model.
' As for testing code and such, you can create "actions" for your GPT that allow it to do things outside of ChatGPT, including REST API.
' So if dbox ever made a REST API for QBJS, you could definitely have it write QBJS code and then ask it to run it.

Sub anyArg (args() As _MEM)
    Dim As _Unsigned Integer x, y
    Dim As _Unsigned _Offset z
    Dim As _Unsigned Long size, elementsize

    For x = LBound(args) To UBound(args)
        If _MemExists(args(x)) Then
            z = 0
            size = Val(Str$(args(x).SIZE))
            elementsize = Val(Str$(args(x).ELEMENTSIZE))

            If _ReadBit(args(x).TYPE, 7) And _ReadBit(args(x).TYPE, 13) = 0 Then
                HandleNumericType args(x), size, elementsize, z
            ElseIf _ReadBit(args(x).TYPE, 8) Then
                HandleFloatingType args(x), size, elementsize, z
            ElseIf _ReadBit(args(x).TYPE, 9) Then
                HandleStringType args(x), size, elementsize
            ElseIf _ReadBit(args(x).TYPE, 13) And _ReadBit(args(x).TYPE, 7) Then
                HandleOffsetType args(x), size, elementsize, z
            ElseIf args(x).TYPE = 0 And args(x).SIZE > 0 Then
                HandleSoundType args(x)
            ElseIf _ReadBit(args(x).TYPE, 14) Then
                Print args(x).SIZE, "MEM"
                ' TODO: Handle other types if necessary
            End If

            If _ReadBit(args(x).TYPE, 11) Then
                Screen args(x).IMAGE
            End If
        End If
    Next
End Sub ' anyArg

' Subroutines for handling specific types
Sub HandleNumericType (arg As _MEM, size As _Unsigned Long, elementsize As _Unsigned Long, z As _Unsigned _Offset)
    If _ReadBit(arg.TYPE, 10) Then
        If _ReadBit(arg.TYPE, 16) Then
            Select Case elementsize
                Case 1
                    Dim As _Unsigned _Byte unsignedbytearray(1 To (size / elementsize))
                    ProcessArray_UByte unsignedbytearray(), arg, size, elementsize, z, "UBYTE ARRAY"
                Case 2
                    Dim As _Unsigned Integer unsignedintarray(1 To (size / elementsize))
                    ProcessArray_UInteger unsignedintarray(), arg, size, elementsize, z, "USHORT ARRAY"
                Case 4
                    Dim As _Unsigned Long unsignedlongarray(1 To (size / elementsize))
                    ProcessArray_ULong unsignedlongarray(), arg, size, elementsize, z, "ULONG ARRAY"
                Case 8
                    Dim As _Unsigned _Integer64 unsignedint64array(1 To (size / elementsize))
                    ProcessArray_UInt64 unsignedint64array(), arg, size, elementsize, z, "UINT64 ARRAY"
            End Select
        Else
            PrintSingleValue arg, size, elementsize
        End If
    Else
        If _ReadBit(arg.TYPE, 16) Then
            Select Case elementsize
                Case 1
                    Dim As _Byte bytearray(1 To (size / elementsize))
                    ProcessArray_Byte bytearray(), arg, size, elementsize, z, "BYTE ARRAY"
                Case 2
                    Dim As Integer intarray(1 To (size / elementsize))
                    ProcessArray_Integer intarray(), arg, size, elementsize, z, "SHORT ARRAY"
                Case 4
                    Dim As Long longarray(1 To (size / elementsize))
                    ProcessArray_Long longarray(), arg, size, elementsize, z, "LONG ARRAY"
                Case 8
                    Dim As _Integer64 int64array(1 To (size / elementsize))
                    ProcessArray_Int64 int64array(), arg, size, elementsize, z, "INT64 ARRAY"
            End Select
        Else
            PrintSingleValue arg, size, elementsize
        End If
    End If
End Sub ' HandleNumericType

Sub HandleFloatingType (arg As _MEM, size As _Unsigned Long, elementsize As _Unsigned Long, z As _Unsigned _Offset)
    If _ReadBit(arg.TYPE, 16) Then
        Select Case elementsize
            Case 4
                Dim As Single singlearray(1 To (size / elementsize))
                ProcessArray_Single singlearray(), arg, size, elementsize, z, "SINGLE ARRAY"
            Case 8
                Dim As Double doublearray(1 To (size / elementsize))
                ProcessArray_Double doublearray(), arg, size, elementsize, z, "DOUBLE ARRAY"
            Case 32
                Dim As _Float floatarray(1 To (size / elementsize))
                ProcessArray_Float floatarray(), arg, size, elementsize, z, "FLOAT ARRAY"
        End Select
    Else
        Select Case size
            Case 4
                Print _MemGet(arg, arg.OFFSET, Single), "SINGLE"
            Case 8
                Print _MemGet(arg, arg.OFFSET, Double), "DOUBLE"
            Case 32
                Print _MemGet(arg, arg.OFFSET, _Float), "FLOAT"
        End Select
    End If
End Sub ' HandleFloatingType

Sub HandleStringType (arg As _MEM, size As _Unsigned Long, elementsize As _Unsigned Long)
    If _ReadBit(arg.TYPE, 16) Then
        Dim As String stringarray(1 To (size / elementsize))
        Dim As _Unsigned Long y
        For y = LBound(stringarray) To UBound(stringarray)
            stringarray(y) = Space$(elementsize)
            _MemGet arg, (arg.OFFSET) + (y * elementsize - elementsize), stringarray(y)
            Print stringarray(y), "STRING ARRAY"
        Next
    Else
        Dim As String stringtest: stringtest = Space$(elementsize)
        _MemGet arg, arg.OFFSET, stringtest
        Print stringtest
    End If
End Sub ' HandleStringType

Sub HandleOffsetType (arg As _MEM, size As _Unsigned Long, elementsize As _Unsigned Long, z As _Unsigned _Offset)
    If _ReadBit(arg.TYPE, 10) Then
        If _ReadBit(arg.TYPE, 16) Then
            Dim As _Unsigned _Offset unsignedoffsetarray(1 To (size / elementsize))
            ProcessArray_UOffset unsignedoffsetarray(), arg, size, elementsize, z, "ULONG_PTR ARRAY"
        Else
            Print _MemGet(arg, arg.OFFSET, _Unsigned _Offset), "ULONG_PTR"
        End If
    Else
        If _ReadBit(arg.TYPE, 16) Then
            Dim As _Offset offsetarray(1 To (size / elementsize))
            ProcessArray_Offset offsetarray(), arg, size, elementsize, z, "LONG_PTR ARRAY"
        Else
            Print _MemGet(arg, arg.OFFSET, _Offset), "LONG_PTR"
        End If
    End If
End Sub ' HandleOffsetType

Sub HandleSoundType (arg As _MEM)
    If Not _SndPlaying(arg.SOUND) Then
        _SndPlay (arg.SOUND)
    End If
    Print "SOUND", arg.SIZE, arg.ELEMENTSIZE
End Sub ' HandleSoundType

' Subroutines for processing arrays
Sub ProcessArray_UByte (unsignedbytearray() As _Unsigned _Byte, arg As _MEM, size As _Unsigned Long, elementsize As _Unsigned Long, z As _Unsigned _Offset, typeName As String)
    Dim As _Unsigned Long y
    For y = LBound(unsignedbytearray) To UBound(unsignedbytearray)
        _MemGet arg, arg.OFFSET + z, unsignedbytearray(y)
        z = z + elementsize
        Print unsignedbytearray(y), typeName
    Next
End Sub ' ProcessArray_UByte

Sub ProcessArray_UInteger (unsignedintarray() As _Unsigned Integer, arg As _MEM, size As _Unsigned Long, elementsize As _Unsigned Long, z As _Unsigned _Offset, typeName As String)
    Dim As _Unsigned Long y
    For y = LBound(unsignedintarray) To UBound(unsignedintarray)
        _MemGet arg, arg.OFFSET + z, unsignedintarray(y)
        z = z + elementsize
        Print unsignedintarray(y), typeName
    Next
End Sub ' ProcessArray_UInteger

Sub ProcessArray_ULong (unsignedlongarray() As _Unsigned Long, arg As _MEM, size As _Unsigned Long, elementsize As _Unsigned Long, z As _Unsigned _Offset, typeName As String)
    Dim As _Unsigned Long y
    For y = LBound(unsignedlongarray) To UBound(unsignedlongarray)
        _MemGet arg, arg.OFFSET + z, unsignedlongarray(y)
        z = z + elementsize
        Print unsignedlongarray(y), typeName
    Next
End Sub ' ProcessArray_ULong

Sub ProcessArray_UInt64 (unsignedint64array() As _Unsigned _Integer64, arg As _MEM, size As _Unsigned Long, elementsize As _Unsigned Long, z As _Unsigned _Offset, typeName As String)
    Dim As _Unsigned Long y
    For y = LBound(unsignedint64array) To UBound(unsignedint64array)
        _MemGet arg, arg.OFFSET + z, unsignedint64array(y)
        z = z + elementsize
        Print unsignedint64array(y), typeName
    Next
End Sub ' ProcessArray_UInt64

Sub ProcessArray_Byte (bytearray() As _Byte, arg As _MEM, size As _Unsigned Long, elementsize As _Unsigned Long, z As _Unsigned _Offset, typeName As String)
    Dim As _Unsigned Long y
    For y = LBound(bytearray) To UBound(bytearray)
        _MemGet arg, arg.OFFSET + z, bytearray(y)
        z = z + elementsize
        Print bytearray(y), typeName
    Next
End Sub ' ProcessArray_Byte

Sub ProcessArray_Integer (intarray() As Integer, arg As _MEM, size As _Unsigned Long, elementsize As _Unsigned Long, z As _Unsigned _Offset, typeName As String)
    Dim As _Unsigned Long y
    For y = LBound(intarray) To UBound(intarray)
        _MemGet arg, arg.OFFSET + z, intarray(y)
        z = z + elementsize
        Print intarray(y), typeName
    Next
End Sub ' ProcessArray_Integer

Sub ProcessArray_Long (longarray() As Long, arg As _MEM, size As _Unsigned Long, elementsize As _Unsigned Long, z As _Unsigned _Offset, typeName As String)
    Dim As _Unsigned Long y
    For y = LBound(longarray) To UBound(longarray)
        _MemGet arg, arg.OFFSET + z, longarray(y)
        z = z + elementsize
        Print longarray(y), typeName
    Next
End Sub ' ProcessArray_Long

Sub ProcessArray_Int64 (int64array() As _Integer64, arg As _MEM, size As _Unsigned Long, elementsize As _Unsigned Long, z As _Unsigned _Offset, typeName As String)
    Dim As _Unsigned Long y
    For y = LBound(int64array) To UBound(int64array)
        _MemGet arg, arg.OFFSET + z, int64array(y)
        z = z + elementsize
        Print int64array(y), typeName
    Next
End Sub ' ProcessArray_Int64

Sub ProcessArray_Single (singlearray() As Single, arg As _MEM, size As _Unsigned Long, elementsize As _Unsigned Long, z As _Unsigned _Offset, typeName As String)
    Dim As _Unsigned Long y
    For y = LBound(singlearray) To UBound(singlearray)
        _MemGet arg, arg.OFFSET + z, singlearray(y)
        z = z + elementsize
        Print singlearray(y), typeName
    Next
End Sub ' ProcessArray_Single

Sub ProcessArray_Double (doublearray() As Double, arg As _MEM, size As _Unsigned Long, elementsize As _Unsigned Long, z As _Unsigned _Offset, typeName As String)
    Dim As _Unsigned Long y
    For y = LBound(doublearray) To UBound(doublearray)
        _MemGet arg, arg.OFFSET + z, doublearray(y)
        z = z + elementsize
        Print doublearray(y), typeName
    Next
End Sub ' ProcessArray_Double

Sub ProcessArray_Float (floatarray() As _Float, arg As _MEM, size As _Unsigned Long, elementsize As _Unsigned Long, z As _Unsigned _Offset, typeName As String)
    Dim As _Unsigned Long y
    For y = LBound(floatarray) To UBound(floatarray)
        _MemGet arg, arg.OFFSET + z, floatarray(y)
        z = z + elementsize / 2
        Print floatarray(y), typeName
    Next
End Sub ' ProcessArray_Float

Sub ProcessArray_UOffset (unsignedoffsetarray() As _Unsigned _Offset, arg As _MEM, size As _Unsigned Long, elementsize As _Unsigned Long, z As _Unsigned _Offset, typeName As String)
    Dim As _Unsigned Long y
    For y = LBound(unsignedoffsetarray) To UBound(unsignedoffsetarray)
        _MemGet arg, arg.OFFSET + z, unsignedoffsetarray(y)
        z = z + elementsize
        Print unsignedoffsetarray(y), typeName
    Next
End Sub ' ProcessArray_UOffset

Sub ProcessArray_Offset (offsetarray() As _Offset, arg As _MEM, size As _Unsigned Long, elementsize As _Unsigned Long, z As _Unsigned _Offset, typeName As String)
    Dim As _Unsigned Long y
    For y = LBound(offsetarray) To UBound(offsetarray)
        _MemGet arg, arg.OFFSET + z, offsetarray(y)
        z = z + elementsize
        Print offsetarray(y), typeName
    Next
End Sub ' ProcessArray_Offset

Sub PrintSingleValue (arg As _MEM, size As _Unsigned Long, elementsize As _Unsigned Long)
    Select Case size
        Case 1
            Print _MemGet(arg, arg.OFFSET, _Byte), "BYTE"
        Case 2
            Print _MemGet(arg, arg.OFFSET, Integer), "SHORT"
        Case 4
            Print _MemGet(arg, arg.OFFSET, Long), "LONG"
        Case 8
            Print _MemGet(arg, arg.OFFSET, _Integer64), "INT64"
    End Select
End Sub ' PrintSingleValue
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
' END handle MEM for any type
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

' ################################################################################################################################################################
' BEGIN DEBUGGING ROUTINES #DEBUG
' ################################################################################################################################################################

' /////////////////////////////////////////////////////////////////////////////

Sub DebugLog (sText As String)
    If cDebugEnabled = TRUE Then
        Dim sTime As String
        Dim sResult As String
        ReDim arrLines(0) As String
        Dim iLoop As Integer
        Dim sNextLine As String

        If _FileExists(m_sDebugFile) = FALSE Then
            sResult = PrintFile$(m_sDebugFile, "", FALSE)
        End If

        If Len(sResult) = 0 Then
            sTime = GetCurrentDateTime$("{mm}/{dd}/{yyyy} {hh}:{nn}:{ss} {ampm}")
            split sText, Chr$(13), arrLines()
            For iLoop = LBound(arrLines) To UBound(arrLines)
                sNextLine = sTime + " " + arrLines(iLoop)
                sResult = PrintFile$(m_sDebugFile, sNextLine, TRUE)
            Next iLoop
        End If
    End If
End Sub ' DebugLog

' /////////////////////////////////////////////////////////////////////////////
' Prints MyString to console with linebreaks.

' Thanks to:
' SpriggsySpriggs for how to use the QB64 debug console:
' https://www.qb64.org/forum/index.php?topic=3949.0

Sub DebugPrint (MyString As String)
    'If cDebugEnabled = TRUE Then
    '    ReDim arrLines(-1) As String
    '    Dim iLoop As Integer
    '    split MyString, Chr$(13), arrLines()
    '    For iLoop = LBound(arrLines) To UBound(arrLines)
    '        _Echo arrLines(iLoop)
    '    Next iLoop
    'End If
End Sub ' DebugPrint

' /////////////////////////////////////////////////////////////////////////////
' Simply prints s$ to console (no linebreaks).

Sub DebugPrint1 (s$)
    'If cDebugEnabled = TRUE Then
    '    _Echo s$
    'End If
End Sub ' DebugPrint1

' ################################################################################################################################################################
' END DEBUGGING ROUTINES @DEBUG
' ################################################################################################################################################################

' ################################################################################################################################################################
' BEGIN REFERENCE #REFERENCE
' ################################################################################################################################################################
' SOME USEFUL STUFF FOR REFERENCE:

' Type Name               Type suffix symbol   Minimum value                  Maximum value                Size in Bytes
' ---------------------   ------------------   ----------------------------   --------------------------   -------------
' _BIT                    `                    -1                             0                            1/8
' _BIT * n                `n                   -128                           127                          n/8
' _UNSIGNED _BIT          ~`                   0                              1                            1/8
' _BYTE                   %%                   -128                           127                          1
' _UNSIGNED _BYTE         ~%%                  0                              255                          1
' INTEGER                 %                    -32,768                        32,767                       2
' _UNSIGNED INTEGER       ~%                   0                              65,535                       2
' LONG                    &                    -2,147,483,648                 2,147,483,647                4
' _UNSIGNED LONG          ~&                   0                              4,294,967,295                4
' _INTEGER64              &&                   -9,223,372,036,854,775,808     9,223,372,036,854,775,807    8
' _UNSIGNED _INTEGER64    ~&&                  0                              18,446,744,073,709,551,615   8
' SINGLE                  ! or none            -2.802597E-45                  +3.402823E+38                4
' DOUBLE                  #                    -4.490656458412465E-324        +1.797693134862310E+308      8
' _FLOAT                  ##                   -1.18E-4932                    +1.18E+4932                  32(10 used)
' _OFFSET                 %&                   -9,223,372,036,854,775,808     9,223,372,036,854,775,807    Use LEN
' _UNSIGNED _OFFSET       ~%&                  0                              18,446,744,073,709,551,615   Use LEN
' _MEM                    none                 combined memory variable type  N/A                          Use LEN

' div: int1% = num1% \ den1%
' mod: rem1% = num1% MOD den1%

' ################################################################################################################################################################
' END REFERENCE @REFERENCE
' ################################################################################################################################################################
' @END

"makeint.h":
Code: (Select All)
LPSTR MAKEINTRSC(ptrszint i){
    return MAKEINTRESOURCE(i);
}

"winproc.h":
Code: (Select All)
ptrszint FUNC_MAINWNDPROC(ptrszint*_FUNC_MAINWNDPROC_OFFSET_HWND,uint32*_FUNC_MAINWNDPROC_ULONG_NMSG,uptrszint*_FUNC_MAINWNDPROC_UOFFSET_WPARAM,ptrszint*_FUNC_MAINWNDPROC_OFFSET_LPARAM);

LRESULT CALLBACK MainWndProc(HWND hwnd, UINT nMsg, WPARAM wParam, LPARAM lParam){
    return FUNC_MAINWNDPROC((ptrszint *) (&hwnd), &nMsg, &wParam, (ptrszint *)(&lParam));
}

void * WindowProc(){
    return (void *) MainWndProc;
}

Print this item

Big Grin Make your keyboard flash with music
Posted by: Petr - 06-28-2024, 06:33 PM - Forum: Petr - Replies (1)

THE FOLLOWING PROGRAM IS THE REASON WHY I HAD TO BORROW A KEYBOARD WITH ALL THE LED DIODES THAT CAN BE CONTROLLED BY PHOENIX DIRECTLY Smile NOBODY EXPECTED THIS USAGE...

Code: (Select All)

_Title "Make your keyboard flash with music"
Dim As Long s, d, Sam
Dim As _MEM m
Dim As _Float Volume, Position

s = _SndOpen("10.mp3") 'liquido - narcotic
m = _MemSound(s, 0)
If m.ELEMENTSIZE <> 8 Then Print "try another mp3 sound file": _SndClose s: End
_SndPlay s
T = Timer
DetectTime = .005
Samples = _SndRate * DetectTime

'detect maximal volume level in record (left channel)
Do Until d = m.SIZE - 8
    CurrentVolLevel = Abs(_MemGet(m, m.OFFSET + d, Single))
    If VolLevel < CurrentVolLevel Then VolLevel = CurrentVolLevel
    d = d + 8
Loop

Do While _SndPlaying(s)
    Position = 8 * (_SndGetPos(s) * _SndRate)
    If Position Mod 8 = 0 Then
        Sam = Sam + 1
        Volume = Volume + Abs(_MemGet(m, m.OFFSET + Position, Single))
    End If

    If T + DetectTime < Timer Then
        Volume = Volume / Sam
        Locate 1
        Print "Listen to music while watching numlock, capslock and scrolllock"
        Print
        Print "Current volume level: "; Int((Volume / VolLevel) * 100); "%"; "  "
        Select Case Volume / VolLevel
            Case Is < .05 * VolLevel: _Scrolllock Off: _Numlock Off: _CapsLock Off
            Case .051 * VolLevel To .3 * VolLevel: _Numlock On: _Scrolllock Off: _CapsLock Off
            Case .3 * VolLevel To .6 * VolLevel: _Numlock On: _CapsLock On: _Scrolllock Off
            Case Is > .6 * VolLevel: _Scrolllock On: _Numlock On: _CapsLock On
        End Select
        T = Timer
        Volume = 0
        Sam = 0
   End If
Loop
_MemFree m
_SndClose s
System

Print this item

  Are we actually living in a matrix?
Posted by: Pete - 06-28-2024, 03:44 PM - Forum: General Discussion - Replies (6)

Our universe may be a computer, albeit made out of cheap chips from China, but nonetheless one that is able to render our perceptions as we observe our holographic surroundings. While this concept of collective consciousness may seem a bit absurd, since we demonstrate individual consciousness over collective thought, perhaps it could be somewhat similar to how we make use of subroutines to create a program. That actually sends chills up my virtual spine when I think of "Judgement Day" in the terms of it being the final debugging session, but what's even scarier is imagining things like why whomever coded our universe included such problematic constructs as CALL CLIPPY. Maybe Steve can email a copy of the QB64 ERASE statement, to the creator, to deal with that one.

Pete

- I know a FreeBASIC user who's Non-Binary. That makes two reason he can't code.

Print this item

  Confusing Wiki explanation
Posted by: PhilOfPerth - 06-28-2024, 02:30 AM - Forum: Help Me! - Replies (8)

When checking the Screen options, Screen 0 (for example) shows 3 different options for rows: 25,43 and 50, and 2 for columns: 80 and 40.
But I can find no explanation of how to select one of these. There may be one somewhere; if so, maybe a link would help?
I may be the only one who doesn't get this, but I doubt it.
Also, I can type Screen 0: Width 120 and get a screen that allows 120 chars per line, which contradicts the Wiki claim.
Can these be clarified for Newbies and others like me?  Confused

Print this item

  UChr$
Posted by: SMcNeill - 06-27-2024, 08:39 PM - Forum: SMcNeill - No Replies

Code: (Select All)
SCREEN _NEWIMAGE(640, 480, 32)
f = _LOADFONT("arial.ttf", 16)
_FONT f

_MAPUNICODE 937 TO 3

omega$ = UChr$(937, 0): PRINT omega$
omega2$ = UChr$(937, 8): _UPRINTSTRING (0, 30), omega2$, , 8
omega3$ = UChr$(937, 16): _UPRINTSTRING (0, 60), omega3$, , 16
omega4$ = UChr$(937, 32): _UPRINTSTRING (0, 90), omega4$, , 32

FUNCTION UChr$ (codepoint AS LONG, encoding AS LONG)
    SELECT CASE encoding
        CASE 0: UChr = CPtoASCII(codepoint)
        CASE 8: UChr = CPto8(codepoint)
        CASE 16: UChr = CPto16(codepoint)
        CASE 32: UChr = CPto32(codepoint)
    END SELECT
END FUNCTION

FUNCTION CPto16$ (codepoint AS LONG)
    SELECT CASE codepoint
        CASE IS <= &HFFFF&& 'use a single codepoint
            temp$ = MKI$(codepoint)
        CASE ELSE 'uses 2 code points
            DIM highSurrogate AS LONG, lowSurrogate AS LONG
            highSurrogate = &HD800 + ((codepoint - &H10000) \ &H400)
            lowSurrogate = &HDC00 + ((codepoint - &H10000) MOD &H400)
            temp$ = MKI$(highSurrogate) + MKI$(lowSurrogate)
    END SELECT
    CPto16 = temp$
END FUNCTION



FUNCTION CPto8$ (codepoint AS LONG)
    SELECT CASE codepoint
        CASE IS <= &H7F&&
            temp$ = CHR$(codepoint)
        CASE IS <= &H7FF&&
            temp$ = CHR$(&HC0 OR _SHR(codepoint, 6))
            temp$ = temp$ + CHR$(&H80 + (codepoint AND &H3F))
        CASE IS <= &HFFFF&&
            temp$ = CHR$(&HE0 OR _SHR(codepoint, 12))
            temp$ = temp$ + CHR$(&H80 OR (_SHR(codepoint, 6) AND &H3F))
            temp$ = temp$ + CHR$(&H80 + (codepoint AND &H3F))
        CASE IS <= &H10FFFF&&
            temp$ = CHR$(&HF0 OR _SHR(codepoint, 18))
            temp$ = temp$ + CHR$(&H80 OR _SHR(codepoint, 12) AND &H3F)
            temp$ = temp$ + CHR$(&H80 OR (_SHR(codepoint, 6) AND &H3F))
            temp$ = temp$ + CHR$(&H80 + (codepoint AND &H3F))
    END SELECT
    CPto8 = temp$
END FUNCTION

FUNCTION CPto32$ (codepoint AS LONG)
    CPto32$ = MKL$(codepoint)
END FUNCTION

FUNCTION CPtoASCII$ (codepoint AS LONG)
    FOR i = 0 TO 255
        IF _MAPUNICODE(i) = codepoint THEN CPtoASCII$ = CHR$(i): EXIT FUNCTION
    NEXT
END FUNCTION

The above is a simple routine to allow one to use unicode values in their programs.  As long as you know the code value (there's unicode charts, just as there's ASCII charts which give this information), you can insert that symbol into your own strings and print it.

Note:  This will only return the ASCII character to you, if that unicode symbol is currently part of your ASCII character set.  Otherwise you'll just get back a blank string as a response ("").

Note2:  You have to specify what type of formatting you're using, so it can convert that numeric value to the proper encoded format for you.

Print this item