JoelSjogren icon

Untitled

JoelSjogren | PRO | 08/09/22 05:27:12 PM UTC | 0 ⭐ | 460 👁️ | Never ⏰ | []
text |

550 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("""
CREATE FUNCTION flip_side
(
    side INT
)
RETURNS int
BEGIN
    IF (side = 1) THEN
        return 2;
    ELSE
        return 1;
    END IF;
END
""")
 cur.execute("""
CREATE FUNCTION flip_column
(
    column_ INT
)
RETURNS int
BEGIN
    return @number_of_columns - column_ + 1;
END
""")
 cur.execute('SELECT flip_column(4)')
cur.fetchall()

Comments

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

    0 B

    |

    👍

    /

    👎