
572 P.2d 412 (1977)
Don WILLIAMS, Appellant (Plaintiff below),
v.
WEBER MESA DITCH EXTENSION COMPANY, INC., a Wyoming Corporation, Appellee (Defendant below).
No. 4836.
Supreme Court of Wyoming.
December 15, 1977.
*413 James R. McCarty, Whitaker & McCarty, Casper, signed the brief and waived oral argument on behalf of appellant.
Harold M. Johnson, Rawlins, signed the brief and waived oral argument on behalf of appellee.
Before GUTHRIE, C.J., and McCLINTOCK, RAPER, THOMAS and ROSE, JJ.
RAPER, Justice.
The trial judge left the parties where he found them on what he held to be a gambling contract. The only issue is whether there was an enforceable contract between plaintiff-appellant and defendant-appellee. We will hold there was not and affirm.
The facts are stipulated. Defendant-appellee, a nonprofit corporation, conducted a raffle, the prize being a 40-acre tract of land in Carbon County, Wyoming. Printed tickets were sold at $5.00 each or three for $10.00. Each ticket had printed on its face that the drawing would be held May 1, 1976.
The plaintiff purchased a ticket prior to the scheduled drawing. On May 1, 1976, his name was drawn and he was notified of his lucky win. On May 6, 1976, the defendant received several more ticket stubs which had been delayed in the mails. Plaintiff's ticket stub, along with all others, was returned to the hopper and a new raffle held on the latter date. As a result, a new winner, not plaintiff, was announced and notified that a conveyance of the land would be forthcoming.
Plaintiff sued defendant for specific performance. The district court denied relief and gave judgment generally in favor of the defendant.
Gambling contracts are statutorily declared void and of no effect by § 16-2, W.S. 1957, as follows:
"All contracts, promises, agreements, conveyances, securities, and notes, made, given, granted, executed, drawn, or entered into, where the whole or any part of the consideration thereof shall be for any money, property, or other valuable thing won by any gaming, or by playing cards or any gambling device or game of chance, or by betting on the side or hands of any person gaming, or for the reimbursing or paying any money or property knowingly lent or advanced at the time and place of such play, to any person or persons so gaming or betting, shall be utterly void and of no effect. No assignment of any bill, bond, note, or other evidence of indebtedness where the whole or any part of the consideration for such assignment shall arise out of any gaming transaction, shall in any manner off-set the defense of the person or persons making, entering into, executing, or giving such instrument so assigned, or the remedies of any person interested therein."
However, on the criminal side, raffles by charitable and non-profit corporations are not declared criminal conduct, as an exception contained in § 6-213, W.S. 1957, 1975 Cum.Supp., in language as follows:
"If any person shall in this state open, set on foot, carry on, or promote, make or draw publicly or privately, any lottery, or scheme of chance, of any kind or description, by whatever name, style, or title the same may be known; or if any person shall by such ways and means, expose or set for sale any house, or houses, mine or mining property, lands or real estate, or any goods or chattels, cash or written or printed evidence of debt, or certificates of claims, or any thing or things of value whatever, every person so offending shall be deemed guilty of a misdemeanor, and upon conviction, fined in any sum not exceeding one thousand dollars, and be imprisoned in the county jail for a period not exceeding three months. But nothing in this section shall be construed as applying to games of chance known as raffles or bingo conducted by charitable or non-profit organizations and the tickets of such raffles or bingo shall be sold only in this state."
*414 Webster defines "raffle" as "a lottery in which each participant buys a ticket for an article put up as a prize with the winner being determined by a random drawing." Webster declares "chance" to be a synonym for "random." "Raffle" and "lottery" are synonymous. State v. West Virginia v. Hudson, 1946, 128 W. Va. 655, 37 S.E.2d 553, 559, 163 A.L.R. 1265. The simplest form of a lottery is the raffle, a game of chance. United States v. Baker, 3 Cir.1966, 364 F.2d 107, 111, cert. den. 385 U.S. 986, 87 S.Ct. 596, 17 L.Ed.2d 448. The three elements of a lottery are consideration, chance and prize. Morrow v. State, Alaska, 1973, 511 P.2d 127; State v. Nelson, 1972, 210 Kan. 439, 502 P.2d 841, 846; Cudd v. Aschenbrenner, 1962, 233 Or. 272, 377 P.2d 150, 153. A raffle as a lottery is a game of chance. Section 6-213. The authority for all these propositions is so enormous, for further citations, see West's Words and Phrases "Raffle" and "Lottery." See also 6A Corbin on Contracts, § 1487, pp. 653-654. There is no question but what defendant conducted a game of chance and plaintiff participated.
The rule is well settled that even though gambling may be allowed and carried on without any criminal violation of the law or criminal responsibility, a gambling debt is unenforceable, even in absence of a statute. Corbin v. O'Keefe, 1971, 87 Nev. 189, 484 P.2d 565; Weisbrod v. Fremont Hotel, Inc., 1958, 74 Nev. 227, 326 P.2d 1104; 6A Corbin on Contracts, § 1483, pp. 644-645; Annotation, 87 A.L.R.2d 649, "Private rights and remedies growing out of prize-winning contests," § 3, p. 653; Restatement of the Law, Contracts, § 520, Illustration 4, p. 1010. Courts refuse to lend their aid in enforcing a gaming contract pursuant to the policy announced by the legislature of the State of Wyoming. Section 16-2.[1] The basis for such statutes, as declared in the authorities cited, is that wagers are against human welfare, considered to be of a higher interest, and are not to be encouraged. We hold the gaming contract to be void.
The plaintiff, within the issue in this appeal, asserts that defendant never raised the defense of illegality of the contract in its answer, as an affirmative defense. Rule 8(c), W.R.C.P., provides that, "In pleading to a preceding pleading, a party shall set forth affirmatively * * * illegality, * * * and any other matter constituting an avoidance or affirmative defense. * *" While the defendant in its answer did not use the word "illegality," it did set forth all the facts which on their face clearly show that a lottery or raffle was conducted by defendant and participated in by plaintiff. Indeed, they were the same as those set out by plaintiff in his complaint. The stipulated facts also show a lottery. We cannot see by the brief of defendant filed with the district court and part of the record here, that the illegality of the contract was argued at all. It appears that the trial judge raised the question at his own suggestion. The trial judge decided the case, by memorandum opinion, upon the basis that there was an illegal contract; his form of judgment only found generally for the defendant and against the plaintiff.
2A Moore's Federal Practice, ¶ 8.27[3], p. 1854, declares that even though not specially pleaded, if illegality appears on the face of a contract, from the opening statement of counsel, from the plaintiff's proof, the defendant may at that time take advantage of it and, if necessary, the court will raise the objection itself. No court will allow itself to be used in aid of any of the parties to an illegal agreement. This rule applies to any agreement which is illegal, immoral, against public law or is forbidden by statute. In Oscanyan v. Arms Company, 1880, 103 U.S. 261, 267-268, 13 Otto 261, 26 L.Ed. 539, it was declared that the illegality could not be waived by any system of pleading, not even by stipulation of the parties.
Early in the history of this court, when pleading was ritualistically strict, and many years before the federal rules, it was stated *415 that it was the duty of the trial court to determine the character of a contract, even though its illegality or its validity, as being in violation of law, was not raised by the pleading in the absence of a statute requiring such a defense to be pleaded. Kennedy v. Lonabaugh, 1911, 19 Wyo. 352, 117 P. 1079, Ann.Cas. 1913E 133. With the federal rules came the federal precedent heretofore cited.
For an excellent discussion of that principle, see Schneider v. O'Neal, U.S.D.C., E.D.Ark.W.D. 1956, 145 F. Supp. 120, aff'd in part, rev'd in part on other grounds, 8 Cir.1957, 243 F.2d 914.[2] This court has endorsed in other cases the general proposition that courts will not aid a party to enforce an agreement made in furtherance of acts expressly made illegal by statute. Owens v. Capri, 1948, 65 Wyo. 325, 202 P.2d 174; Claus v. Farmers & Stockgrowers State Bank, 1936, 51 Wyo. 45, 68, 63 P.2d 781, 789.
Affirmed.
NOTES
[1]  This statute was considered by this court in a different and inapplicable context in Kinney v. Hynds, 1897, 7 Wyo. 22, 49 P. 403, reh. den. 52 P. 1081.
[2]  For many cases from many other jurisdictions, holding that once the evidence shows illegality, whether pleaded or not, it is the duty of the court to sua sponte refuse to entertain the action, Contracts, West's Digest System.
