Help Coding Certain Number Range Output 'true'

Discussion in 'BBNodes' started by call_me_wei, Jan 6, 2022.

  1. call_me_wei

    call_me_wei Boxer

    Joined:
    Dec 15, 2021
    Messages:
    7
    Likes Received:
    2
    Need a little help here on coding , i try to do a node that can signal out true on certain range of number .

    So the node function was , i set the range or length in 1 to 5 , so if the value numbers input was between 1 - 5 , signal out 'true' . And if the value number input was outside the range ,something like below 0 or above 6 , it signal out 'false' . Maybe false no need to output it ...

    This is a 2D Math Shopping Game
     
  2. Vlad-NY

    Vlad-NY Serious Boxer

    Joined:
    Jul 21, 2018
    Messages:
    539
    Likes Received:
    337
    try this using a single input as a total

    Code:
    function signal(name, value){
        if(value >= 1 && value <= 5)
            this.emitSignal("Out", true);
        else
            this.emitSignal("Out", false);
    }
     
    call_me_wei likes this.
  3. call_me_wei

    call_me_wei Boxer

    Joined:
    Dec 15, 2021
    Messages:
    7
    Likes Received:
    2
    Yes . Thank you for the code , that the thing i want.
     
    Vlad-NY likes this.

Share This Page