JoelSjogren icon

Untitled

JoelSjogren | PRO | 08/09/22 08:02:46 PM UTC | 0 ⭐ | 428 👁️ | Never ⏰ | []
text |

610 B

|

None

|

0 👍

/

0 👎

clear_functions()
 cur.execute("""
SET @base_value = 3,
    @extracting_column = 30,
    @number_of_columns = 40,
    @number_of_layers = 5,
    @active_side = 1;
""")
 cur.execute(f"""
CREATE FUNCTION numbering_formula
(
    layer INT,
    side INT,
    column_ INT
)
RETURNS int
BEGIN
    IF NOT (1 <= layer AND layer <= number_of_layers AND (side = 1 OR side = 2) AND 1 <= column_ AND column_ <= number_of_columns AND column_ != extracting_column) THEN
        return -1
    END IF;
     IF @active_side <> 1 THEN
        SET side = flip_side(side);
    END IF;
     return 0;
END
""")

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎