Threads for jackdoe

    1. 2

      Some minor notes I think would be worth making: Changing the time / speeding up the clock has some interesting effects in some games, and can also trigger anti-cheat / bans in other games! Similarly, Blizzard might not like World of Warcraft being interacted with via anything other than in-game scripting functions.

      might want to slip in a if exists: continue to the fill_desktop_with_files.py, in addition, maybe add a PANIC_ prefix so they will be easier to clean up.

      I’d recommend maybe anything else but minecraft, I can’t imagine the screams a household would be filled with if a kid corrupted his brother’s world!


      The drawing, printing, background changing, brightness changing, clicking, voice output, typing, et al. are really really nice, as much as they are pranks, they are also useful tools. could imagine a kid setting up the computer to say something when someone joined their MC server or similar (with the addition of an minecraft package)

      A hot-key-ish example (e.g. binding ctrl-z to ctrl-y, and visa versa) would pair well if a future revision is made (leading into keyboard controls for brightness, backgrounds, etc).

      Very cleanly done as well, great aesthetic. Makes me want to print them out regardless of not having a need (and not having a windows PC anyways)

      1. 2

        Those are good points!

        I just pushed a fix to address them, of course minecraft was not a good idea because kids play hardcore, and there is one card where it waits for minecraft to be in foreground for few minutes and the presses ‘W’ which might actually destroy someone’s hardcore world by pushing them off a cliff. After that I made a WoW version, but of course hardcore World of Warcraft is just as popular now.

        Then I decided to use Fall Guys as safer option, but when I tried the program and it killed fallguys on my computer it also killed the epic store and corrupted its state and now it cant start back haha, so now I have to reinstall the epic store.

        So I ended up using Roblox :)

        Also I pushed the if not exists thing and prefixing with PANIC_ for easier cleanup.

        I will add ‘POSSIBLE ANTICHEAT TRIGGER’ comment on some cards and add a card to explain why it might trigger it, but honestly the modern anticheat systems can be triggered by very random things, I am not sure I can capture them all


        If you are going to print them I suggest you use a service that prints poker cards, they would look similarly to my other decks like https://punkjazz.org/programming-time, the style I used there is quite similar

        You might have to scale them a bit, depending on which printing company you use.

        PS: as I was doing the changes it occurred to me I can make a card that randomly alt+tabs if you have Chrome in foreground, and so I did, I will use it on my wife’s laptop :)

    2. 1

      Hey @jackdoe! So nice to come across a former colleague (-: I admire your prolific and creative mind. I used your set of 4917 programmes to teach my partner basics of computers and programming. Just wanted to say hi and big thank you!

      1. 2

        <3 thanks for the kind words

        I made the 4917 cards almost a year ago, and it took a while to get my daughter interested in them, but at some point she was able to read/write programs just in machine code without looking at the mnemonics

        after that it was much easier to get into riscv assembler, and sometimes I still use 4917 analogies to explain something

    3. 7

      This is a link to the pdf you can print: https://punkx.org/panic/panic-cards.pdf And this is link to the code: https://github.com/jackdoe/programming-for-kids/tree/master/projects/panic/cards

      I am using those small programs to teach my kid how to programatically control the computer (volume, screen rotation, microphone etc), to explain how easy it is to lose your privacy, or how it takes few lines of code to turn an autoclicker into a keylogger, and how important it is to think what programs are you actually running on your computer.

      I wish we still used cdroms so I can randomly eject it :) it is the spookiest thing ever, when you are just reading something and the cdrom suddenly opens on its own.

      1. 1

        It’s awesome how small these programs are!

        1. 1

          yea, the pywin32 and windll stuff is surprisingly easy to use

          in general I don’t know anything about windows, but because she is required to use windows for her school laptop I thought it will be better to make the pranks work on windows

          drawing pixels through gdi with few lines of python felt very nice.

          in the same it takes only 5 lines or so use whisper and log transcribed voice, which is very scary.

    4. 25

      I often get treated as trolling when I observe that the boundaries between interpreted/compiled are very fuzzy, but it’s true. Thinking like a compiler is not esoteric knowledge either, you may be surprised how often those techniques are useful outside of language design.

      1. 8

        That’s weird, ‘cause they are super fuzzy and I feel like that should be obvious? I mean, we have mechanical methods for turning an interpreter into a compiler, we have JIT compilers that run inside interpreters, it’s startlingly easy to write an interpreter for compiled machine code and then interpret the compiler in it, etc.

        1. 12

          People who don’t have much knowledge of the field often have very firm ideas about how computers work that don’t really have any connection to reality. They’ll try to draw hard boundaries around “compiled” vs “interpreted” because they haven’t learned any of the theory underlying their preferred tools.

          Imagine a 14th century biologist who understands that warm-blooded animals are divided into birds (which lay eggs) and mammals (which have fur) being presented with a platypus.

          1. 5

            This feels more like “all models are wrong, but some models are useful”. I agree that it’s technically wrong to say there is a stark boundary between interpreted and compiled, but it’s a useful approximation.

            I recently answered a student’s question “what’s the reason for returning void* in C?” by writing a function whose return type changes in response to user input. Thus proving that C is a “dynamically typed interpreted language”, which as any sensible person will tell you, it isn’t.

            1. 3

              It’s better to use accurate terminology, especially when teaching. Otherwise the student will learn things that aren’t true, which will confuse them in the future.

              For example, when explaining the difference between the compilation models of C and Python, you can write the same function in each language and disassemble them:

              $ cat add.c
              int add(int x, int y) {
              	return x + y;
              }
              $ gcc -S -masm=intel add.c -o /dev/stdout | grep -v '\.'
              add:
              	endbr64
              	push	rbp
              	mov	rbp, rsp
              	mov	DWORD PTR -4[rbp], edi
              	mov	DWORD PTR -8[rbp], esi
              	mov	edx, DWORD PTR -4[rbp]
              	mov	eax, DWORD PTR -8[rbp]
              	add	eax, edx
              	pop	rbp
              	ret
              [...]
              $ python -q
              >>> import dis
              >>> def add(x, y): return x + y
              ... 
              >>> dis.dis(add)
                1           0 LOAD_FAST                0 (x)
                            2 LOAD_FAST                1 (y)
                            4 BINARY_ADD
                            6 RETURN_VALUE
              

              A beginner won’t understand everything on the screen, but with guidance they can understand that in both cases the human-readable source code is converted to a sequence of lower-level machine-readable instructions.

              In the example of void*, that’s a great time to introduce the idea of relative strength/weakness in type systems:

              • Python is strongly- and dynamically-typed – you don’t know what a variable will be until runtime, but you do know that every value has a known concrete type.
              • C is weakly- and statically-typed – you know that the variable is declared as a void*, which means it contains an integer[0] of a certain size, but the memory value it points to (or whether it’s a valid pointer at all!) is uncertain.
              • Haskell is strongly- and statically-typed, Bash is weakly- and dynamically-typed, etc. You get the idea.

              [0] I’d recommend leaving the details of “pointers are integers with a soul” to a later time.

              1. 2

                When I teach I like to point out when I’m describing a “useful approximation” which is nevertheless not the whole truth. It’s important to find a balance that doesn’t overwhelm the beginner with details that aren’t (yet) relevant. Interestingly, “strong/weak typing” is another great example of what I would call a useful approximation that falls apart on closer inspection.

                Like this example showing how GHCi catches a type error, but if you put the same code into a file and compile it, GHC implicitly promotes Integer to Num, silencing the error. Thus proving Haskell is “weakly typed” by one definition.

                [edit] I would conjecture that for any classification people can make about programming languages, there exists a confounding “platypus”.

          2. 2

            I think when people say compiled they just mean machine code, and not some reduction to bytecode, but in the same time they say java is compiled, but of course hotspot has bytecodeInterpreter.cpp so unjitted java is just as compiled as bytecode python.

            what about jitted java that is not escape analyzed yet? it could be way worse than unjitted and escape analyzed java.

            but of course its in the eye of the beholder, the machine code that is compiled is also not the code thats executed, considering register reordering and speculation and etc, so even the machine code people should consider their code is partially not “compiled” :)

            1. 2

              Java bytecode is an ISA too! See also: Java Card.

        2. 3

          There is more than a whiff of elitism when people denote “scripting” languages vs compiled.

        3. 2

          Your own words show a careful nuance. Indeed there’s no barrier between interpreted and compiled languages; but there is a Futamura-shaped barrier between interpreters and compilers.

    5. 2

      I am working on a new board game to teach kids about zero click exploits, I got inspired after making one about stack buffer overflows (https://punkx.org/overflow/), but now I am working on one where there are cards with data packets that you can use to exploit the app (kind of like sending the ping of death to windows95), I want kids to understand what it means to not have control over which program runs and what it does on your phone or computer.

    6. 1

      The author also has a host of other programming themed card games: https://shop.punkx.org/

      (Full disclosure: I worked with them and think they’re one of the more brilliant people I know.)

      1. 2

        <3 GUNN!

        btw all the cards you can print yourself, and also i have a deck of pranks you could print yourself https://github.com/jackdoe/programming-for-kids/blob/master/projects/panic/cards-small.pdf that you can use to teach your kids how to have some fun with computers (there are some pure evil cards there, like randomly rotating the screen every minute, or randomly inserting space or backspace every 30 seconds, or stopping half the internet 128.0.0.0/1 or 0.0.0.0/1)

    7. 13

      I made this game to teach my daughter how buffer overflows work. Looking at programs as something you can play with, and poke and twist and make it do something else is my favourite part of modern computing. And also I think its the right way to look at programs. When your microwave oven gets an update and starts crashing, you can hack it. Or when your keyboard controller’s firmware is bad, you can hack it (looking at you vortex pok3r) . She is 12 yo now but her assembler skills are getting better and better, hopefully one day she will be able to hack her own keyboard :)

      The game is about creating a small shellcode in memory by copying existing instructions and then exploiting a buffer overflow to jump into it, so that you can overwrite your opponent’s return address to force them to go to the game_over() function.

      There are other mechanics as well and more layers of strategy (like setting the exception handler or monkeypatching).

      The you can print the game yourself on a3/a4 or play it in the browser (but on paper is nicer I think).

      The code is compiled with gcc with -O0 so it is a bit redundant, but I think its more straightforward and easier to execute by hand. I disassemble it with objdump and then generate svg.

      1. 2

        This is so cool! Thank you for making this. I look forward to playing this with my daughters.

        1. 3

          BTW, the whole thing started with Snakes And Ladders kind of game, you have 5 instructions per turn, but on certain places you have to roll a dice and follow the branch: https://punkx.org/overflow/build/snakes-and-ladders.pdf

          I think the snakes and ladders game is nice way to onboard into executing instructions, it has very few instructions and only one variable and also kids are very familiar with zero choice games and there is no pressure in ‘doing something wrong’ because the dice dictates the fate of the player.

          1. 1

            Thanks, this is great. I’ve just been browsing the card decks on your site: you have some cool stuff there.

            I recently took my children to Bletchley Park so we’ve been doing a lot of manual coding and ciphering: it turns out that 5-bit paper tape and Vernam ciphers are way more fun for children than I was expecting :)

            1. 2

              Thanks!

              I agree, kids are surprisingly receptive to ciphers and puzzles. Its really nice what you are doing! You know what Bruce Lee said: Instead of buying your children all the things you never had, you should teach them all the things you were never taught.

              In the same time, to teach now I think is much more difficult than before, there are soo many abstractions between you and your machine code.

              I dont think I can get 5 bit paper easily, but maybe I can do some good scavenger hunt with some old punch cards. Kids seem to be very receptive of adventures as well :)