In the fourteenth-century alliterative poem Sir Gawain and the Green Knight, the different characters, particularly the protagonist Sir Gawain, find themselves involved in a series of bargains, or games. Aside from the larger bargain with the Green Knight, Sir Gawain finds himself engaging in a game of wits with the Bertilak, as well as his wife.
The terms of this game are quite simple. Bertilak will leave each of three mornings to hunt. He proposes that Gawain, who he asks to stay behind at the castle to enjoy the company of his wife, exchange his winnings with Bertilak when he returns from the hunt at the end of the day. Clearly, this is a ruse on Bertilak's part, but this situation brings about Sir Gawain's rather challenging interactions with Bertilak's wife, the lady of the castle.
During the course of each day, Gawain must use his wits, and particularly his knowledge of courtesy, to fend off the lady's advances. The lady of the castle, however, knows the rules of this game far better than Gawain, as she forces him into situations that will ultimately contribute to his compromising his adherence to courtesy. On the first day, she convinces him to allow her to give him a harmless kiss. On the second day, she gives him two kisses - which he then gives to Bertilak. On the third and final day of the hunt, the lady, seeing that she has met a formidable foe, raises the stakes. She pushes matters to the point where Sir Gawain is compelled to accept a girdle/sash which will protect him from being harmed by the Green Knight. In doing so, he is forced into a catch-22. Either he breaks his adherence to courtesy by not exchanging his full winnings with Bertilak, or he does not take the lady's gift and break another cardinal rule of courtesy - always cater to a lady.
Ultimately, Sir Gawain's performance turns out negatively. However, one could argue that it was the only result he could reasonably expect. The lady of the castle knows the rules of courtesy, and she plays the game knowing Sir Gawain will not deviate from his adherence to that system. Gawain is forced to make a decision that will prove discourteous. Though the game is rigged, Sir Gawain remains faithful to his code. If anything, the code, not Sir Gawain, is found wanting. Sir Gawain is shown to be human, favoring self-preservation over his loyalty to courtesy. His guilt about failing the code serves as further evidence of his virtue.