commit e15c6299c2333865acbba34fe58fda7abbf04c49 Author: Herwin Bozet Date: Sun May 17 12:10:11 2026 +0200 Initial commit Update .gitignore, LICENSE, and 6 more files... diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b574fcd --- /dev/null +++ b/.gitignore @@ -0,0 +1,10 @@ +# IDEs +.vs/ +.idea/ + +# Build artifacts +bin/ +obj/ + +# Trash +*.user diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..0e259d4 --- /dev/null +++ b/LICENSE @@ -0,0 +1,121 @@ +Creative Commons Legal Code + +CC0 1.0 Universal + + CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE + LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN + ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS + INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES + REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS + PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM + THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED + HEREUNDER. + +Statement of Purpose + +The laws of most jurisdictions throughout the world automatically confer +exclusive Copyright and Related Rights (defined below) upon the creator +and subsequent owner(s) (each and all, an "owner") of an original work of +authorship and/or a database (each, a "Work"). + +Certain owners wish to permanently relinquish those rights to a Work for +the purpose of contributing to a commons of creative, cultural and +scientific works ("Commons") that the public can reliably and without fear +of later claims of infringement build upon, modify, incorporate in other +works, reuse and redistribute as freely as possible in any form whatsoever +and for any purposes, including without limitation commercial purposes. +These owners may contribute to the Commons to promote the ideal of a free +culture and the further production of creative, cultural and scientific +works, or to gain reputation or greater distribution for their Work in +part through the use and efforts of others. + +For these and/or other purposes and motivations, and without any +expectation of additional consideration or compensation, the person +associating CC0 with a Work (the "Affirmer"), to the extent that he or she +is an owner of Copyright and Related Rights in the Work, voluntarily +elects to apply CC0 to the Work and publicly distribute the Work under its +terms, with knowledge of his or her Copyright and Related Rights in the +Work and the meaning and intended legal effect of CC0 on those rights. + +1. Copyright and Related Rights. A Work made available under CC0 may be +protected by copyright and related or neighboring rights ("Copyright and +Related Rights"). Copyright and Related Rights include, but are not +limited to, the following: + + i. the right to reproduce, adapt, distribute, perform, display, + communicate, and translate a Work; + ii. moral rights retained by the original author(s) and/or performer(s); +iii. publicity and privacy rights pertaining to a person's image or + likeness depicted in a Work; + iv. rights protecting against unfair competition in regards to a Work, + subject to the limitations in paragraph 4(a), below; + v. rights protecting the extraction, dissemination, use and reuse of data + in a Work; + vi. database rights (such as those arising under Directive 96/9/EC of the + European Parliament and of the Council of 11 March 1996 on the legal + protection of databases, and under any national implementation + thereof, including any amended or successor version of such + directive); and +vii. other similar, equivalent or corresponding rights throughout the + world based on applicable law or treaty, and any national + implementations thereof. + +2. Waiver. To the greatest extent permitted by, but not in contravention +of, applicable law, Affirmer hereby overtly, fully, permanently, +irrevocably and unconditionally waives, abandons, and surrenders all of +Affirmer's Copyright and Related Rights and associated claims and causes +of action, whether now known or unknown (including existing as well as +future claims and causes of action), in the Work (i) in all territories +worldwide, (ii) for the maximum duration provided by applicable law or +treaty (including future time extensions), (iii) in any current or future +medium and for any number of copies, and (iv) for any purpose whatsoever, +including without limitation commercial, advertising or promotional +purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each +member of the public at large and to the detriment of Affirmer's heirs and +successors, fully intending that such Waiver shall not be subject to +revocation, rescission, cancellation, termination, or any other legal or +equitable action to disrupt the quiet enjoyment of the Work by the public +as contemplated by Affirmer's express Statement of Purpose. + +3. Public License Fallback. Should any part of the Waiver for any reason +be judged legally invalid or ineffective under applicable law, then the +Waiver shall be preserved to the maximum extent permitted taking into +account Affirmer's express Statement of Purpose. In addition, to the +extent the Waiver is so judged Affirmer hereby grants to each affected +person a royalty-free, non transferable, non sublicensable, non exclusive, +irrevocable and unconditional license to exercise Affirmer's Copyright and +Related Rights in the Work (i) in all territories worldwide, (ii) for the +maximum duration provided by applicable law or treaty (including future +time extensions), (iii) in any current or future medium and for any number +of copies, and (iv) for any purpose whatsoever, including without +limitation commercial, advertising or promotional purposes (the +"License"). The License shall be deemed effective as of the date CC0 was +applied by Affirmer to the Work. Should any part of the License for any +reason be judged legally invalid or ineffective under applicable law, such +partial invalidity or ineffectiveness shall not invalidate the remainder +of the License, and in such case Affirmer hereby affirms that he or she +will not (i) exercise any of his or her remaining Copyright and Related +Rights in the Work or (ii) assert any associated claims and causes of +action with respect to the Work, in either case contrary to Affirmer's +express Statement of Purpose. + +4. Limitations and Disclaimers. + + a. No trademark or patent rights held by Affirmer are waived, abandoned, + surrendered, licensed or otherwise affected by this document. + b. Affirmer offers the Work as-is and makes no representations or + warranties of any kind concerning the Work, express, implied, + statutory or otherwise, including without limitation warranties of + title, merchantability, fitness for a particular purpose, non + infringement, or the absence of latent or other defects, accuracy, or + the present or absence of errors, whether or not discoverable, all to + the greatest extent permissible under applicable law. + c. Affirmer disclaims responsibility for clearing rights of other persons + that may apply to the Work or any use thereof, including without + limitation any person's Copyright and Related Rights in the Work. + Further, Affirmer disclaims responsibility for obtaining any necessary + consents, permissions or other rights required for any use of the + Work. + d. Affirmer understands and acknowledges that Creative Commons is not a + party to this document and has no duty or obligation with respect to + this CC0 or use of the Work. diff --git a/NibblePoker.GoatseReceipt.sln b/NibblePoker.GoatseReceipt.sln new file mode 100644 index 0000000..a31fe0c --- /dev/null +++ b/NibblePoker.GoatseReceipt.sln @@ -0,0 +1,16 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NibblePoker.GoatseReceipt", "NibblePoker.GoatseReceipt\NibblePoker.GoatseReceipt.csproj", "{F867A849-8892-41F1-8831-0567A8EA4FB4}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {F867A849-8892-41F1-8831-0567A8EA4FB4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F867A849-8892-41F1-8831-0567A8EA4FB4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F867A849-8892-41F1-8831-0567A8EA4FB4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F867A849-8892-41F1-8831-0567A8EA4FB4}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/NibblePoker.GoatseReceipt/NibblePoker.GoatseReceipt.csproj b/NibblePoker.GoatseReceipt/NibblePoker.GoatseReceipt.csproj new file mode 100644 index 0000000..f2dd53c --- /dev/null +++ b/NibblePoker.GoatseReceipt/NibblePoker.GoatseReceipt.csproj @@ -0,0 +1,20 @@ + + + + Exe + net9.0 + enable + enable + + + + + + + + + Always + + + + diff --git a/NibblePoker.GoatseReceipt/Program.cs b/NibblePoker.GoatseReceipt/Program.cs new file mode 100644 index 0000000..aa32be1 --- /dev/null +++ b/NibblePoker.GoatseReceipt/Program.cs @@ -0,0 +1,258 @@ +using System.Globalization; +using ESCPOS_NET; +using ESCPOS_NET.Emitters; +using ESCPOS_NET.Utilities; + +namespace NibblePoker.GoatseReceipt; + +internal static class Program { + private const string PrinterPort = "COM10"; + private const int PrinterBaudRate = 38400; + + private static readonly string[] AdresseRues = [ + "Route de Luxembourg" // Route connue depuis 30+ ans dans la région + ]; + + private static readonly string[] AdresseNumeros = [ + "Dans les fougeres", + "Hute du fermier", + "La grange", + "Ma boite a malice", + "Votre voiture" + ]; + + private static readonly string[] FauxSites = [ + // 1 entrée censurée + "gourgandine.be", + "gourgandineries.be", + "prostipute.be" + ]; + + private static readonly string[] NomDeFilleDeJoie = [ + "Crystalle", + "Mariette", + "Crystalle" + ]; + + private static readonly string[] Monnaies = [ + "vbucks", + "robux", + "euros" + ]; + + private static readonly string[][] ActesPrincipaux = [ + ["Un p'tit wrap", "7.60"], + ["Limace baveuse", "50.00"], + ["Turlutte", "25.00"], + ["Helicoptere Bulgare", "75.00"], + ["Kama-trouee", "30.00"], + ["Pelure d'oignon", "30.00"], + ["Ouverture boite a malice", "60.00"], + ["P'tit classique", "20.00"], + ["Lechouille de velour", "35.00"] + ]; + + private static readonly string[][] ActesSecondaires = [ + ["Pastille pour l'haleine", "2.99"], + ["Service de nuit", "25.00"], + ["Supplement mouille", "5.00"], + ["Pause cloppe", "10.00"], + ["Mouchoir pour larmes", "5.00"], + ["Tour de magie", "7.50"], + ["Pre-lavage de la fosse", "25.00"], + ["Mots doux", "5.00"], + ["Odeur de camioneuse", "5.00"], + ["Canette de Carapils", "1.50"], + ["Brossage de criniere", "7.50"], + ["Supplement dents", "-2.50"], + ["Parfum poissoniere", "2.50"], + ["Parfum note brune", "7.50"], + ["Supplement griffe", "7.50"] + ]; + + private static void Main(string[] _) { + Console.WriteLine("Preparing stuff..."); + + var printer = new SerialPrinter(portName: PrinterPort, baudRate: PrinterBaudRate); + var e = new EPSON(); + + Random rand = new Random(); + + + Console.WriteLine("Printing..."); + + // En-tête mis à part car l'image cause beaucoup de soucis dans la librairie... + printer.Write( + ByteSplicer.Combine( + e.SetStyles(PrintStyle.None), + e.CenterAlign(), + e.PrintImage(File.ReadAllBytes("./logo01.png"), true, maxWidth: 480), + e.PrintLine(""), + e.CodePage(CodePage.ISO8859_2_LATIN2), + + e.PrintLine("Vas-y S.P.R.L"), + e.PrintLine(AdresseRues[rand.Next(AdresseRues.Length)] + ", " + AdresseNumeros[rand.Next(AdresseNumeros.Length)]), + e.PrintLine("6700 Arlon, Belgique"), + + // Numéro original censuré + e.PrintLine("+32 00 00 00 00 / +32 00 00 00 00"), + + e.PrintLine("Remboursement uniquement en liquide"), + e.PrintLine("Conditions sur " + FauxSites[rand.Next(FauxSites.Length)]), + e.PrintLine(""), + + e.LeftAlign(), + e.PrintLine(" Caissier/ere N° Date Heure"), + e.PrintLine(" " + NomDeFilleDeJoie[rand.Next(NomDeFilleDeJoie.Length)].PadRight(21) + + $"{rand.Next(8999) + 1000} {rand.Next(20) + 10}/{rand.Next(2) + 7}/25 {rand.Next(5) + 18}:{rand.Next(49) + 10}"), + e.PrintLine(""), + e.PrintLine(" -----------------------------------------") + ) + ); + + printer.Write( + ByteSplicer.Combine( + e.Clear() + ) + ); + + + // En-tête des colonnes avec le détail des "articles" + printer.Write( + ByteSplicer.Combine( + e.SetStyles(PrintStyle.None), + e.PrintLine(""), + e.SetStyles(PrintStyle.Condensed | PrintStyle.None), + e.CenterAlign(), + e.PrintLine("Ticket de caisse"), + e.SetStyles(PrintStyle.None), + //e.PrintLine(""), + e.LeftAlign(), + e.PrintLine(" Description Qte Montant"), + e.PrintLine(" EUR"), + e.CenterAlign(), + e.PrintLine(" -----------------------------------------") + ) + ); + + printer.Write( + ByteSplicer.Combine( + e.Clear() + ) + ); + + + // Impression des articles, et calcul du prix total + void PrintArticle(string nom, string prix) { + printer.Write( + ByteSplicer.Combine( + e.LeftAlign(), + e.PrintLine( + " " + nom.PadRight(27) + + " 1" + prix.PadLeft(11) + ) + ) + ); + + printer.Write( + ByteSplicer.Combine( + e.Clear() + ) + ); + } + + double total = 0.00; + + int iArticle = rand.Next(ActesPrincipaux.Length); + total += Double.Parse(ActesPrincipaux[iArticle][1].Replace(".", ",")); + PrintArticle(ActesPrincipaux[iArticle][0], ActesPrincipaux[iArticle][1]); + + int nbSupplements = rand.Next(3 - 1) + 2; + var lSupplements = ActesSecondaires.Select(inner => inner).ToList(); + + for(int i = 0; i < nbSupplements; i++) { + int iSupplement = rand.Next(lSupplements.Count); + string[] sipplementItem = lSupplements[iSupplement]; + total += Double.Parse(sipplementItem[1].Replace(".", ",")); + PrintArticle(sipplementItem[0], sipplementItem[1]); + lSupplements.RemoveAt(iSupplement); + } + + + // Impression du total HTVA, TVA et TTC + printer.Write( + ByteSplicer.Combine( + e.LeftAlign(), + e.PrintLine(" -----------------------------------------"), + e.PrintLine(" TOTAL HTVA".PadRight(31) + $"{total.ToString("F2", CultureInfo.InvariantCulture)}".PadLeft(11)), + e.PrintLine(" TVA (21%)".PadRight(31) + $"{(total * 0.12).ToString("F2", CultureInfo.InvariantCulture)}".PadLeft(11)), + e.PrintLine(""), + e.SetStyles(PrintStyle.Bold), + e.PrintLine(" TOTAL TTC".PadRight(31) + $"{(total * 1.12).ToString("F2", CultureInfo.InvariantCulture)}".PadLeft(11)), + e.SetStyles(PrintStyle.None), + e.PrintLine(" -----------------------------------------") + ) + ); + + printer.Write( + ByteSplicer.Combine( + e.Clear() + ) + ); + + + // Petit texte sur les points de fidélité + int ptsInitial = rand.Next(250); + int ptsNouveau = rand.Next(25); + + printer.Write( + ByteSplicer.Combine( + e.PrintLine(""), + e.SetStyles(PrintStyle.Condensed | PrintStyle.None), + e.CenterAlign(), + e.PrintLine("Programme fidelite"), + e.SetStyles(PrintStyle.None), + e.LeftAlign(), + e.PrintLine(" Solde initial".PadRight(31) + $"{ptsInitial}".PadLeft(11)), + e.PrintLine(" Points epargnees".PadRight(31) + $"{ptsNouveau}".PadLeft(11)), + e.PrintLine(" Solde final".PadRight(31) + $"{ptsInitial + ptsNouveau}".PadLeft(11)), + e.PrintLine(""), + e.CenterAlign(), + e.SetStyles(PrintStyle.Italic), + e.PrintLine("Une MST offerte par tranche de 150 points"), + e.PrintLine($"Et une taxe de 75 {Monnaies[rand.Next(Monnaies.Length)]} tous les 350"), + e.PrintLine("points pour un avortement"), + e.LeftAlign(), + e.PrintLine(" -----------------------------------------") + ) + ); + + printer.Write( + ByteSplicer.Combine( + e.Clear() + ) + ); + + printer.Write( + ByteSplicer.Combine( + e.CenterAlign(), + e.PrintLine(""), + e.FullCutAfterFeed(1) + ) + ); + + printer.Write( + ByteSplicer.Combine( + e.Clear() + ) + ); + + Console.WriteLine("Done :)"); + + + // Printing tends to fail if we directly exit, go figure... + while(true) { + //Thread.Sleep(10); + } + } +} diff --git a/NibblePoker.GoatseReceipt/logo01.png b/NibblePoker.GoatseReceipt/logo01.png new file mode 100644 index 0000000..3887035 Binary files /dev/null and b/NibblePoker.GoatseReceipt/logo01.png differ diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..e0d5d78 --- /dev/null +++ b/readme.md @@ -0,0 +1,40 @@ +# Fun - Tickets Vas-Y +Petit programme marrant qui imprime de faux tickets pour des visites chez des +gourgandines. + +> **🔞 Ce dépôt contient de l'humour graveleux réservé aux adolescents/adultes** + + +## Histoire +Ces tickets ont été crées pour une blague dans un bar local où nous en avions caché +10-15 durant tout un mois. \ +Le résultat a été parfait, les serveurs étaient sur le cul, et il a sa place sur le +mur des trophées de bar. + +Au final, l'idée derrière le ticket était juste de faire une référence graveleuse à +*goatse*, tout en restant "subtile" au cas où quelqu'un de plus jeune le trouverai. + + +## Exemple +![Exemple de ticket](screenshot_censored.png "Exemple de ticket") + + +## Remarques techniques +La librairie [ESC-POS-.NET](https://github.com/lukevp/ESC-POS-.NET) galère +avec les images et beaucoup de pauses ont du être ajoutées pour palier à +ce problème. + +Il n'est donc pas impossible que votre imprimante plante et doive être redémarrée +pour refaire une impression propre. + +Lors de mes tests entre 20% et 30% des impressions avaient des soucis juste +après le logo. + + +## Licences +La bibliothèque [ESC-POS-.NET](https://github.com/lukevp/ESC-POS-.NET) a été utilisée et est +sous licence [MIT](https://github.com/lukevp/ESC-POS-.NET/blob/master/LICENSE) + +Le reste du code et des ressources de ce dépôt sont sous licence +[CC0 1.0 Universal (CC0 1.0) (domaine public)](LICENSE). + diff --git a/screenshot_censored.png b/screenshot_censored.png new file mode 100644 index 0000000..262f72f Binary files /dev/null and b/screenshot_censored.png differ