
792 P.2d 1081 (1990)
MPH COMPANY and Tropic Industries, Plaintiffs and Respondents,
v.
IMAGINEERING, INC., and Bill R. Williams, Defendants and Appellants.
No. 89-279.
Supreme Court of Montana.
Submitted December 12, 1989.
Decided May 16, 1990.
*1082 W. Corbin Howard, Billings, for defendants and appellants.
Pierre L. Bacheller, Billings, for plaintiffs and respondents.
HUNT, Justice.
The District Court of the Thirteenth Judicial District, Yellowstone County, found defendant, Imagineering, Inc., liable for breach of contract and breach of implied warranty. The court entered judgment in favor of plaintiff, MPH Company, in the amount of $193,663 plus interest. Imagineering appeals. We reverse.
The sole issue raised on appeal is whether the contract entered into by the parties was illegal under the laws of Montana and therefore unenforceable.
Defendant and appellant, Imagineering, Inc., is a Nevada corporation engaged in the design and manufacture of electronic video machines. Plaintiff and respondent, MPH Company, is a joint venture comprised of Sam McDonald, Jr., Paul Pendergrass and Ronald Harding, all of Billings, and Joe Goott of Salt Lake City. Goott is also the president of Tropic Industries, a Utah corporation.
In January, 1984, MPH and Tropic entered into a contract with Imagineering wherein Imagineering agreed to design and manufacture an electronic Poker All Keno machine. This machine was to be the electronic version of the table game developed and patented by Joe Goott. A detailed description of the table game can be found in our decision Goott v. State, 630 P.2d 232, 38 St.Rep. 1037 (Mont. 1981). In Goott, we found that, although the game possessed some of the characteristics of poker, it was essentially a variation of keno. We held that the game was illegal under the Montana Card Games Act (then codified at §§ 23-5-301 through -332, MCA). On remand, the District Court declared that the game was legal under the Bingo and Raffles Law (then codified at §§ 23-5-401 through -431, MCA).
The contract specified that the electronic version of Poker All Keno was to be a single-player, stand-up video game designed with a reset key to allow the player to cash in his accumulated credits. The image projected on the screen was to be the same as that found on the Poker All Keno table layout. The game would be played by positioning a chip on the layout by means of four separate directional buttons. Once the player made his selection, he would place a bet by either inserting coins or pushing the "bet" button. After *1083 placing his bet, the player would start the game by pushing the "start" button. The start button would activate a card selection device, which was a bowl-shaped container with a spinning wheel in the bottom and 52 pockets around the periphery, each pocket representing a different card from a standard deck of cards. From the "pocket" selections of the last game, six balls would be dumped into the bowl. The spinning wheel would continue to randomly bounce the balls around until each found a pocket. As each ball entered a pocket, it would close a switch, sending information to the computer. The computer would then display the selected betting squares on the screen. After the sixth ball found its pocket, the computer would compute the results of the best possible poker hand by using 5 out of the 6 selected cards. It would then display the results on the screen by calculating the total winnings and advancing the credit meter accordingly.
The parties encountered a variety of problems with the machines and were forced to modify the contract on several occasions. In December, 1984, a prototype was delivered to MPH in Billings. MPH found the machine acceptable and ordered 20 units in kit form for assembly in Billings. MPH subsequently increased the order to 24 machines, also in kit form.
That December, Imagineering contacted the Nevada gaming authorities, who told the company that the machine would be illegal in Montana because it incorporated certain components that enabled the game to be played for cash. These illegal components included devices to display the last credits cleared, coin out meters and cancel credit switches, also known as reset keys. After consulting with the Nevada authorities, Imagineering discussed the problem with MPH. Imagineering agreed to send the machines to MPH in Montana without the illegal parts but with wiring and circuitry designed to accommodate the components should MPH wish to install them itself.
After shipping the games, Imagineering sent employees to Montana to explain the assembly of the machines to technicians hired by MPH. While in Montana, the Imagineering employees showed the MPH technicians how to install the electrical components that Imagineering had refused to install in Nevada. In fact, Imagineering furnished extra parts for this purpose, although it appears that the parts were available on the general market and could have been found in any Radio Shack store.
The kits were delivered in March, 1985. They were assembled in April of that year and subsequently installed in bars in Billings, Great Falls and other locations in Montana. The machines placed in the Montana bars were equipped with components permitting them to be played for cash.
Although the machines worked in the lab, they did not operate properly in the electronically "dirty" environment of the local drinking establishments. Among other problems, the machines frequently registered unearned credits. Fearing that they would have to pay out more in cash winnings than the machines were bringing in, the bar owners asked MPH to remove the games from their establishments.
Imagineering sent several technicians to Montana in an attempt to cure the problem. The technicians were unsuccessful in their endeavors, and in May and June, 1985, MPH pulled the games out of the taverns.
MPH and Tropic instituted suit against Imagineering and its president, Bill R. Williams, alleging breach of contract, breach of warranty, fraud and bad faith. Imagineering and Williams defended on the basis that the contract was illegal and therefore unenforceable.
Tropic's claims were dismissed with prejudice. Later, the remaining parties stipulated to dismissal of all claims against Williams as well as MPH's claims of fraud and bad faith against Imagineering.
In lieu of trial, MPH and Imagineering submitted the case to the District Court based on the record and a set of stipulated facts. The parties stipulated that the video machines contained design defects rendering them commercially unacceptable and constituting a breach of contract.
*1084 The District Court found that the machines were in compliance with Montana law at the time the contract was to be performed and that the contract, as amended, was legal and enforceable. The court entered judgment in favor of MPH in the amount of $193,663 plus pre-judgment interest of $79,354. The principal represented funds expended by MPH in satisfaction of the contract.
Imagineering argues that the electronic Poker All Keno machines contemplated by the parties were illegal slot machines because they were intended to be and actually were played for cash. We agree that Montana statutes and interpretive case law prohibited the type of gambling devices for which the parties contracted and that the machines were, at best, unlawful slot machines.
The Montana Constitution prohibits gambling unless specifically authorized.
All forms of gambling, lotteries, and gift enterprises are prohibited unless authorized by acts of the legislature or by the people through initiative or referendum.
Art. III, § 9, Mont. Const. (1972).
At the time the parties entered into and performed the contract in question, Montana law prohibited the possession or operation of slot machines. Section 23-5-104, MCA (1983) (amended 1989 and renumbered § 23-5-153). A slot machine was defined in § 23-5-101(1), MCA (1983) (amended 1989 and renumbered § 23-5-112(29)), as follows:
[A] machine operated by inserting a coin, token, chip, trade check, or paper currency therein by the player and from the play of which he obtains or may obtain money, checks, chips, tokens, or paper currency redeemable in money.
In 1974, the legislature enacted the Montana Card Games Act, ch. 293, § 1, 1974 Mont. Laws 727, and the Bingo and Raffles Law, ch. 294, § 1, 1974 Mont. Laws 731. The Montana Card Games Act authorized certain enumerated card games, including poker. Section 23-5-311, MCA, (1983) (amended 1989). The authorized card games could be played for cash. Sections 23-5-302, MCA, (1983) (repealed 1989) and 23-5-312, MCA, (1983) (amended 1989). At the time the parties entered into the contract, the Bingo and Raffles Law authorized playing bingo for prizes of tangible personal property only. The law expressly forbade bingo prizes of cash or other intangible personal property. Section 23-5-412, MCA, (1983) (amended 1985 and 1989).
In 1976, this Court considered the legality of electronic keno games under the Bingo and Raffles Law. In Treasure State Games, Inc. v. State, 170 Mont. 189, 551 P.2d 1008 (1976), we upheld the legality of electronic keno under these laws, concluding that electronic keno machines were merely the mechanical simulation of the lawful game of bingo. We did not consider whether such machines could be legally played for cash prizes.
In 1981, Joe Goott, one of the members of MPH, brought a declaratory judgment action in the Silver Bow County District Court, seeking to have the table version of Poker All Keno declared lawful. The District Court held that the game was lawful under the Card Games Act. On appeal, we reversed, reasoning that Poker All Keno was a "casino-type of banking game" that pitted players against the house rather than against each other, an activity that the legislature did not intend to authorize when it enacted the Card Games Act. Goott, 630 P.2d at 234, 38 St.Rep. at 1039. On remand, the District Court held that Poker All Keno was legal under the Bingo and Raffles Law, which left the game subject to the prohibition against cash prizes.
The following year, we were presented with the opportunity to determine the legality of live keno games. In Gallatin County v. D & R Music and Vending, Inc., 201 Mont. 409, 412, 654 P.2d 998, 1000 (1982) (Gallatin I), we held that live keno came within the statutory definition of the game of bingo and was therefore legal under the Bingo and Raffles Law. MPH claims that Gallatin I also authorized the playing of keno for cash because the stipulated description of keno presented by the parties described the amount of cash paid for winning the game. It appears, however, that the question of whether the game was legally *1085 played for cash prizes was not presented to this Court. Rather, the issue in Gallatin I was whether the game of keno conformed with the legal description of bingo under § 23-5-402(1)(a), MCA (1981) (repealed 1989). Because we did not, in Gallatin I, discuss the legality of playing keno for cash, it cannot be said that the case authorized such activity. In fact, Gallatin I could not possibly have legalized playing keno or any other form of bingo for cash when § 23-5-412, MCA, as it stood in 1982 expressly proscribed such activity.
Any question that Gallatin I permitted playing electronic keno for cash prizes was clarified by the legislature's amendment to § 23-5-412, MCA, in April, 1985, the same time that the Poker All Keno machines that form the basis of this action were being assembled and placed in bars in Montana. The statute was amended to read as follows:
Bingo prizes may be paid in either tangible personal property or cash, except that a prize must be paid in tangible personal property if the game is played on a player-operated electronic video game machine. (Emphasis added.)
Section 23-5-412, MCA (enacted April 12, 1985). Thus, while the amended statute authorized cash prizes for live bingo games, it continued to prohibit prizes of intangible personal property for electronic versions of the game.
In February, 1984, shortly after the parties entered into the contract for the manufacture of Poker All Keno machines, this Court decided Gallatin County v. D & R Music and Vending, Inc., 208 Mont. 138, 676 P.2d 779 (1984) (Gallatin II). Using much the same reasoning as that employed in Goott, we held that electronic poker machines were not authorized under the Montana Card Games Act. We held that electronic poker machines were slot machines, which § 23-5-101, MCA (1983), expressly barred.
In 1985, the legislature passed the Video Draw Poker Machine Control Law, Ch. 720, § 1, 1985 Mont. Laws 1649. While this act legalized video draw poker machines and authorized playing those machines for cash prizes, it did not authorize playing Poker All Keno for cash. Instead, the law was expressly limited to machines offering the game of draw poker. Section 23-5-606(4), MCA (1985) (amended 1987 and repealed 1989). Poker All Keno, which possessed elements of both the game of poker and the game of keno, was not draw poker as that game was defined in § 23-5-606(4), MCA (1985). Thus, the passage of the Video Draw Poker Machine Control Law did not legalize the electronic version of Poker All Keno.
It is clear from the statutes and the case law that, at the time the parties entered into and performed the contract, Montana law forbade playing Poker All Keno for cash prizes. Goott prohibited the table version of the game under the Montana Card Games Act. Gallatin II, which banned electronic draw poker games, emphasized the holding in Goott, i.e., that forms of gambling that pitted a player against the house, whether the games were live or mechanical, were not permitted under the Card Games Act. Although the Video Draw Poker Machine Control Act overruled the holding in Gallatin II by legalizing electronic draw poker machines, the act did not authorize Poker All Keno machines.
Assuming that electronic Poker All Keno machines were legal under the Bingo and Raffles Law, the game could still not be played legitimately for cash. Gallatin I, while holding that electronic keno was a lawful game, did not authorize playing the game for cash prizes, nor could it have done so in the face of the express statutory prohibition against such activity. Furthermore, the 1985 amendment of § 23-5-412, MCA, specifically provided that electronic versions of bingo could be played only for prizes of tangible personal property.
In light of the above discussion, we must conclude that, at the time the parties entered into and performed the contract, Poker All Keno machines played for cash prizes were not authorized under either the Montana Card Games Act, the Video Draw Poker Machine Control Law or the Bingo *1086 and Raffles Law. Consequently, the machines were slot machines as defined in § 23-5-101(1), MCA (1983).
Section 28-2-701(1), MCA, provides that a thing or an act is not lawful if it is "contrary to an express provision of law." Slot machines were expressly prohibited by § 23-5-104, MCA (1983), at the time the parties entered into and performed the contract. Therefore, Poker All Keno machines, because they were slot machines, were unlawful under Montana law.
"Where a contract has but a single object and such object is unlawful, whether in whole or in part, ... the entire contract is void." Section 28-2-603, MCA. "The object of a contract is the thing which it is agreed on the part of the party receiving the consideration to do or not to do." Section 28-2-601, MCA. In the present case, the object of the contract was the design and manufacture of Poker All Keno machines. Because the machines were unlawful, the entire contract was void.
A party to an illegal contract may not use the courts of this state to enforce the agreement.
No principle of law is better settled than that a party to an illegal contract cannot come into a court of law and ask to have his illegal objects carried out, nor can he set up a case in which he must necessarily disclose an illegal purpose as the groundwork of his claim... . The law, in short, will not aid either party to an illegal agreement. It leaves the parties where it finds them. Therefore neither a court of law nor a court of equity will aid the one in enforcing it, or give damages for a breach of it, or set it aside at the suit of the other, or, when the agreement has been executed in whole or in part by the payment of money or the transfer of other property, lend its aid to recover it back. (Emphasis added.)
Glass v. Basin & Bay State Mining Co., 31 Mont. 31, 33, 77 P. 302, 305 (1904) (quoting 9 D. Lawson, Cyclopedia of Law and Procedure 546). Accord McPartlin v. Fransen, 199 Mont. 143, 146-47, 648 P.2d 729, 730-31 (1982); McManus v. Fulton, 85 Mont. 170, 182-83, 278 P. 126, 131 (1929).
At oral argument, MPH advanced the theory that the parties' modification of the contract changed the agreement from an illegal to a legal contract. MPH argued that because the Poker All Keno machines shipped to Montana by Imagineering did not include the components enabling them to be played for cash, the machines were legal under Montana law.
We reject this argument for two reasons. First, "[t]he object of the contract must be lawful when the contract is made... ." Section 28-2-602, MCA. The original object of the contract was the design and manufacture of a Poker All Keno machine that could be played for cash prizes. Therefore, the object was not lawful when the contract was made.
Second, although Imagineering may have shipped lawful machines, it appears that the contract was not fully performed at that point. Imagineering sent employees to Montana to oversee the assembly of the machines and to show MPH's technicians how to install the parts that would enable the machine to be played for cash. These actions constitute a common scheme or plan to use the machines for illegal purposes within this state. When the general scheme of the contracting parties is to bring about unlawful results, the contract is unenforceable. See 15 Williston on Contracts §§ 1752 and 1755 (3d ed. 1972).
The parties originally planned to manufacture and design illegal gambling machines for use within the state of Montana. The parties did not deviate from the original object of the contract even though the manufacturer shipped lawful machines into this state. The end product  a Poker All Keno machine that could be played for cash prizes  was also the original object of the contract. As the object of the parties was to manufacture and market an unlawful slot machine, the contract was illegal. Neither party may come into our courts seeking damages for breach of that agreement.
The judgment of the District Court is reversed.
*1087 TURNAGE, C.J., and HARRISON, BARZ, McDONOUGH and WEBER, JJ., concur.
SHEEHY, Justice, dissenting:
I dissent on three grounds: 1) That at all times herein there was confusion, even among county attorneys, as to the application of law to video-electronic keno machines; 2) The contract here for the manufacture of the machines is severable from any illegality; and 3) Principles of restitution allow recovery here.

Confusion in the Law
In Treasure State Games, Inc. v. State (1976), 170 Mont. 189, 551 P.2d 1008, this Court held that electronic bingo and keno machines were lawful in Montana under the Bingo and Raffle Law of 1974. At that time, § 23-5-412, MCA, provided:
Bingo prizes [including keno] must be in tangible personal property only and not in money, cash, stocks, bonds, evidences of indebtedness, or other intangible personal property and must not exceed the value of $100 for each individual award... .
Under this statute, no cash prizes could be granted winners of any bingo or keno games, whether live, player-operated or electronic.
The question of the legality of keno came before this Court again in Gallatin County v. D & R Music and Vending, Inc. (1982), 201 Mont. 409, 654 P.2d 998 (Gallatin I). There this Court upheld the validity of keno as it is operated in most of the Montana establishments at the present time. The numbers are selected at random from numbered ping pong balls blown into a tube. This Court said that such a device was in accord with the Bingo and Raffle Law of 1974 and issued mandamus requiring the appropriate officers to issue licenses for the keno machines. Noteworthy in that case, however, is the opinion of Justice Daniel J. Shea, who, specially concurring, noted that it was common knowledge in the state that such keno is played with the expectation that a player would receive money if he won. Justice Shea pointed out that even though § 23-5-412, as above quoted, was in effect, the county attorneys did not prosecute any establishment for paying cash to the winners as a matter of general policy.
This was the state of the law when in early 1985, the plaintiff MPH Company contracted with Bill R. Williams and Imagineering, Inc. for the manufacture of video keno machines. The only theoretical difference between the machines contracted for and the usual version of keno is that the proposed machines would be operated by a single player and the numbers would be flashed on a video screen. The contract was entered into and was to be performed in the early months of 1985.
From the date of Justice Shea's special concurrence, in December of 1982, until 1985, nothing was done to amend the Bingo and Raffle Law so as to provide that cash would be paid on keno games in this state. Under any objective test, the 1985 and 1987 sessions of the Montana legislature were among the worst in our state history. It is a strange but true fact that the worse a legislature is the more Acts it will pass relating to the same subject.
In 1985, the legislature passed Ch. 465, Laws of Montana (1985), which became § 23-5-412, MCA, and which has now been repealed. That statute, as passed in 1985, read as follows:
Bingo prizes may be paid either in tangible personal property or cash, except that a prize must be paid in tangible personal property if the game is played on a player-operated video game machine. (Italics supplied.)
It is important to note the change that the 1985 amendment to § 23-5-412, MCA, made with respect to its former version. Whereas formerly no cash prizes could be legally awarded for the playing of bingo (and therefore keno), after the amendment, prizes could be paid in cash except only for player-operated video game machines. Thus, in the same establishment, a keno game which was operated by ping pong balls could merit cash prizes, but a player-operated video keno machine in the same *1088 premises, could not legally award cash prizes.
Yet, the same 1985 legislature passed a law making valid video draw poker machines (which is a "video game machine"), and allowing the players of such machines to draw their winnings in cash. Chapter 720, Laws of Montana (1985). Except that the draw poker and keno games are different in design, there is no real gambling distinction between a video poker game and a video keno game, or for that matter a video bingo game. They are all "video game machines."
Was there considerable confusion about the legality of video keno machines at the time of this contract? There certainly was. We need look no further than the finding of District Judge G. Todd Baugh in this case:
... The court finds that the machines were legal and in compliance with Montana law at the time the contract was to be performed and that the contract, as amended, is therefore enforceable.
The only feature of the machines manufactured in this case upon which the majority may hinge their decision is that the machines had been modified after manufacture to provide for the payment to winners in cash. The modification involved a printout which would show the number of game credits to which the winner was entitled. The credits could be paid off by the owner of the machines for the value of goods instead of cash, which would be legal without doubt. It was the eventual establishments that paid these credits in cash.

Severability of the Contract
There is no law of which we have been made aware here that prohibited Imagineering, Inc. from manufacturing the machines in Utah and transporting them to Montana for acceptance by the buyer. The fact is that the machines could not be used for any purpose. They were defective. They did not work. They were inoperable legally or illegally. Imagineering, Inc. admits the deficiencies, and acknowledges in this case that insofar as its performance was concerned, it breached the contract.
Where an agreement or obligation is incidentally, indirectly, or remotely connected with an illegal transaction, it will generally be enforced if it is supported by an independent consideration so that the plaintiff does not require the aid of the illegal transaction to make out his case. Even though the parties to an action have been engaged in a transaction either malum in se or prohibited by law, if the cause of action between them is disconnected from the illegal act and is founded upon a distinct and collateral consideration, and the plaintiff is not obliged to resort to the illegal agreement or transaction in order to maintain the suit, the illegality of the formal transaction will not impair or bar the right to maintain the suit.
17 Am.Jur.2d 590, 591, Contracts, § 219.
The legality or illegality of the eventual use of the machines, if they had been properly manufactured, should not be an issue in this case. If a hardware store sold on credit to a customer a gun which the customer later used to shoot somebody, the hardware store can still collect on its bill though the gun was used for an illegal purpose. The situation is no different here. The contract, to the extent that it existed between these parties, was legal.

Restitution
The 1987 session of the legislature also busied itself concerning electronic video gambling games. It amended § 23-5-402, MCA, to include a definition of a video keno machine as one where the winner could receive cash. Ch. 652, Laws of Montana (1987). The 1987 legislature again defined a "keno machine" by amending § 23-5-602, MCA, to include electronic video keno machines where the player could receive cash winnings.
In the circumstances, principles of restitution apply here. Restatement (Second) of Contracts § 198 provides:
A party has a claim in restitution for performance that he has rendered under or in return for a promise that is unenforceable on grounds of public policy if: *1089 (a) He was excusably ignorant of the facts or of legislation of a minor character, in the absence of which the provision would be enforceable, or
(b) He was not equally in the wrong with the promisor. (Emphasis added.)
The parties in this case testified that they thought their machines were legal. The district judge thought they were legal. The minor character of the illegality, that is that the prizes should be paid in values of personal property rather than by cash when video keno machines were used, is obvious when one considers the number of other legal gambling devices or machines which paid off in cash, particularly including live and video keno. In sheer numbers of situations, the public policy was to award cash prizes.
The minor character of the illegality is further demonstrated that in 1989 the legislature adopted the Video Gaming Machine and Control Law, §§ 23-5-602, et seq. Under the new law, video draw poker and keno machines are described, provision is made for their licensing, cash winnings are allowed, and instead of the top $100 per game cash winnings formerly permitted, the top limit now is $800 cash per game for a video keno machine, § 23-5-608, MCA, and the payment must be in cash!
Section 198 of the Restatement (Second) of Contracts is particularly applicable here. The purported issue of illegality is whether the winner in using the machines, if they worked, could get cash, or receive the value in goods. Legislative enactments before and after the contract in this case demonstrate the minor character of the difference that relates to illegality. The investors in this case should not take the hit. We ought to promote a better business climate in this state by protecting in-state entrepreneurs from phony defenses.
I would affirm the District Court.
