GNU social JP
  • FAQ
  • Login
GNU social JPは日本のGNU socialサーバーです。
Usage/ToS/admin/test/Pleroma FE
  • Public

    • Public
    • Network
    • Groups
    • Featured
    • Popular
    • People

Conversation

Notices

  1. Embed this notice
    φ (fiore@brain.worm.pink)'s status on Thursday, 05-Mar-2026 22:27:54 JST φ φ

    professor gave us a stupid dumb shell exercise that i wasnt doing because its stupid . then after one hour of time , he shares the solution on the projector because many students (4th year astrophysics students) couldn’t do it . shocked , without looking at his solution i type my own in around 70 seconds

    #!/bin/sh echo 'input your guess: 0 for head, 1 for tails.' read guess random_number="$(cat -v /dev/urandom | sed 'q' | wc -w)" if [ $((${random_number} % 2)) = $guess ]; then echo 'good guess!' else echo 'wrong :/' fi

    i guess at least my classmates arent gpt-brained ? at least for coding ? yay ????

    In conversation about 5 days ago from brain.worm.pink permalink
    • Embed this notice
      :suya: (newt@stereophonic.space)'s status on Thursday, 05-Mar-2026 22:27:51 JST :suya: :suya:
      in reply to
      @fiore i mean..

      if your system has /dev/urandom, it likely has bash too.
      In conversation about 5 days ago permalink
      翠星石 likes this.
    • Embed this notice
      φ (fiore@brain.worm.pink)'s status on Thursday, 05-Mar-2026 22:27:52 JST φ φ
      in reply to
      • :suya:

      @newt nonono . thats smth i wrote . because $RANDOM is a bash thing (maybe zsh too idk) but like i want my scripts to be #!/bin/sh . he used $RANDOM

      In conversation about 5 days ago permalink
    • Embed this notice
      :suya: (newt@stereophonic.space)'s status on Thursday, 05-Mar-2026 22:27:53 JST :suya: :suya:
      in reply to
      @fiore
      >cat -v /dev/urandom | sed 'q' | wc -w

      holy fuck.. you could've just used `$(($RANDOM % 2))` instead of that garbage.
      In conversation about 5 days ago permalink
    • Embed this notice
      翠星石 (suiseiseki@freesoftwareextremist.com)'s status on Thursday, 05-Mar-2026 22:30:57 JST 翠星石 翠星石
      in reply to
      @fiore #!/bin/bash

      echo 'Input your guess: 0 for head, 1 for tails.'
      read guess

      if [ $(($RANDOM % 2)) = $guess ]; then
      echo 'Correct!'
      else
      echo 'Wrong :/'
      fi
      In conversation about 5 days ago permalink
    • Embed this notice
      rose (rose@snac.pinkro.se)'s status on Thursday, 05-Mar-2026 22:39:45 JST rose rose
      in reply to
      #!/bin/sh
      echo 'input your guess: 0 for head, 1 for tails.'
      read guess
      echo 'wrong lol'
      :ipv5:
      In conversation about 5 days ago permalink
      snacks likes this.
    • Embed this notice
      φ (fiore@brain.worm.pink)'s status on Thursday, 05-Mar-2026 22:45:59 JST φ φ
      in reply to

      and like dont get me wrong . i suck at writing shell scripts , the ones i write are usually clunky and break in weird ways . but like bro what are you doing wasting a whole hour of an high performance computing class on how to write a heads or tails bash script 😭

      In conversation about 5 days ago permalink
      snacks likes this.
    • Embed this notice
      menherahair (menherahair@eientei.org)'s status on Thursday, 05-Mar-2026 22:54:17 JST menherahair menherahair
      in reply to
      • 翠星石
      @Suiseiseki @fiore #!/bin/bash
      read -p 'Input your guess: 0 for head, 1 for tails.' guess
      h[guess]='Correct!'
      echo ${h[$((RANDOM % 2))]:-Wrong :/}
      In conversation about 5 days ago permalink

      Attachments


      1. https://eientei.org/media/3c/e5/f5/3ce5f5df93268d0452731a0395ce84048e2cda7998feac14896c44b74f8b5d5c.jpg?name=3ce5f5df93268d0452731a0395ce84048e2cda7998feac14896c44b74f8b5d5c.jpg
      翠星石 likes this.

Feeds

  • Activity Streams
  • RSS 2.0
  • Atom
  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

GNU social JP is a social network, courtesy of GNU social JP管理人. It runs on GNU social, version 2.0.2-dev, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All GNU social JP content and data are available under the Creative Commons Attribution 3.0 license.