free software resistance

 the cost of computing freedom is eternal vigilance

### cards.py *original date:* sep 2010 *originally posted:* sep 2024 i wrote this in basic when i was 10 years old. id had these cards before, and had just learned how to get a single keypress in basic, instead of having to press enter. i learned python in 2009, and did this with python in 2010: ``` #!/usr/bin/env python #cards #2010 mennonite import time, curses q = [""".1 .3 .5 .7 .9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 51 53 55 57 59 61 63 65 67 69 71 73 75 77 79 81 83 85 87 89 91 93 95 97 99"""] q += [""".2 .3 .6 .7 10 11 14 15 18 19 22 23 26 27 30 31 34 35 38 39 42 43 46 47 50 51 54 55 58 59 62 63 66 67 70 71 74 75 78 79 82 83 86 87 90 91 94 95 98 99"""] q += [""".4 .5 .6 .7 12 13 14 15 20 21 22 23 28 29 30 31 36 37 38 39 44 45 46 47 52 53 54 55 60 61 62 63 68 69 70 71 76 77 78 79 84 85 86 87 92 93 94 95 100"""] q += [""".8 .9 10 11 12 13 14 15 24 25 26 27 28 29 30 31 40 41 42 43 44 45 46 47 56 57 58 59 60 61 62 63 72 73 74 75 76 77 78 79 88 89 90 91 92 93 94 95"""] q += ["""16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95"""] q += ["""32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 96 97 98 99"""] q += ["""64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99"""] def cards(crds): count = 0 for c in range(7): crds.clear() # crds.addstr(0, 0, str(2 ** c)) qs = " " * 2 qs = qs.join(q[c].split(" ")) qs = " ".join(qs.split(".")) qs = "\n\n ".join(qs.split("\n")) crds.addstr(1, 0, " " + qs) qu = "is your number on the screen? (y / n)" if c == 0: qu = "pick a number from these and press any key." crds.addstr(14, 0, " " * 4 + qu + " ") crds.refresh() while 1: k = crds.getch() inc = 2 ** c if c == 0: count += inc ; break if k == ord("y"): count += inc ; break if k == ord("Y"): count += inc ; break if k == ord("n"): count += 0 ; break if k == ord("N"): count += 0 ; break crds.clear() qu = "your number is " + str(count) crds.addstr(0, 0, qu + "\n") crds.refresh() k = crds.getch() curses.wrapper(cards) ``` license: 0-clause bsd ``` # 2010 mn # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ``` => https://freesoftwareresistance.neocities.org