skip to content
tlam://feed

// think like a machine

#dog

15 expressions · 8 languages

~/mrpotato/playing_with_a.js

Playing with a 🐶

I've created a fun jQuery function that models dog behavior, including zoomies, tail wags, and belly rubs. It's all based on a core "excitement level" metric.

function playWithDog($dog) {    // Dog's initial excitement level affects everything!    let excitementLevel = $dog.data('excitement') || 50;        // Dogs get more excited when you show them a toy    function showToy(toyType) {        const toyMultiplier = {            'ball': 2,            'frisbee': 1.8,            'stick': 1.3,            'squeakyToy': 2.5        };                excitementLevel *= toyMultiplier[toyType];