#include "game_math.h"
#include "sys/sys.h"

// prog runs from 0 to 255

// except for game_wobb1, all of these are 
// generated with list(enumerate([round(sin(i/256 * pi * 2)*k) for i in range(256)]))
// for k = various values

sys_i32 game_wobb1(uint8_t prog) {
    // return 0 or 1 in a roughly sinusoidal pattern
    if (prog<128) return 0;
    return 1;
}

sys_i32 game_wobb2(uint8_t prog) {
    // return -1, 0, 1 in a roughly sinusoidal pattern
    if (prog<22) return 0;
    if (prog<107) return 1;
    if (prog<150) return 0;
    if (prog<235) return -1;
    return 0;
}

sys_i32 game_wobb3(uint8_t prog) {
    // return -2, -1, 0, 1, 2 in a roughly sinusoidal pattern
    if (prog<11) return 0;
    if (prog<35) return 1;
    if (prog<94) return 2;
    if (prog<118) return 1;
    if (prog<139) return 0;
    if (prog<163) return -1;
    if (prog<222) return -2;
    if (prog<246) return -1;
    return 0;
}