• 0 Posts
  • 3 Comments
Joined 3 years ago
cake
Cake day: September 26th, 2023

help-circle

  • BewitchedBargain@reddthat.comtoProgrammer Humor@programming.devWat
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    2 years ago

    This might be from an old version of ruby, but:

    irb(main):001:0> a
    NameError: undefined local variable or method `a' for main:Object
            from (irb):1
            from C:/Ruby23-x64/bin/irb.cmd:19:in `<main>'
    irb(main):002:0> b
    NameError: undefined local variable or method `b' for main:Object
            from (irb):2
            from C:/Ruby23-x64/bin/irb.cmd:19:in `<main>'
    irb(main):003:0> a=b
    NameError: undefined local variable or method `b' for main:Object
            from (irb):3
            from C:/Ruby23-x64/bin/irb.cmd:19:in `<main>'
    irb(main):004:0> a
    => nil
    

    This NameError doesn’t stop the assignment, going through despite the error.


  • I noticed this in video games rather than on-screen text scrolling. Some of them had a weapon selection, but instead had mouse-wheel-down “decrease” the weapon slot, and mouse-wheel-up “increase” it. However, the game also used the mouse wheel for other things, thus changing it to my preference had some unexpected side effect.

    In any case, mouse-wheel to scroll view works because of the mouse-pointer paradigm. Move both mouse-wheel and mouse in the same direction, and the pointer is further along the content. Move them in opposite directions, and the pointer tends to hold position relative to content.