
:- use_module(library(test_cover)).

:- begin_tests(breeding).
:- [breeding].

% species_base_evolution(Species, BaseSpecies).
test(species_base_evolution, [nondet]) :-
    species_base_evolution(pikachu, pichu),
    species_base_evolution(raichu, pichu),
    species_base_evolution(pichu, pichu).

% can_breed(MaleSpecies, FemaleSpecies).
test(can_breed, [nondet]) :-
    can_breed(ditto, crobat),
    can_breed(crobat, ditto),
    can_breed(claydol, ditto),
    can_breed(ditto, claydol),
    \+can_breed(arceus, _), % i.e., cannot breed arceus with anything
    \+can_breed(_, arceus),
    \+can_breed(ditto, ditto), % i.e., ditto cannot breed with ditto
    can_breed(arbok, charizard),
    can_breed(charizard, arbok),
    can_breed(bayleef, amoonguss),
    can_breed(fraxure, heliolisk),
    \+can_breed(claydol, charizard),
    \+can_breed(charizard, claydol),
    \+can_breed(ditto, oshawott), % i.e., cannot breed with a baby
    \+can_breed(goomy, goodra). % i.e., cannot breed with a baby

% can_breed_list(Species, BreedableSpeciesList).
test(can_breed_list, [nondet]) :-
    % test 1: crobat
    can_breed_list(crobat, List),
    % sorted list should equal the list specified
    sort(List, [altaria, archeops, braviary, crobat, ditto, dodrio, fearow,
    fletchinder, golbat, honchkrow, mandibuzz, noctowl, noivern, pelipper,
    pidgeot, pidgeotto, staraptor, staravia, swanna, swellow, swoobat,
    talonflame, togekiss, togetic, tranquill, unfezant, xatu]),
    % test 2: fraxure
    can_breed_list(fraxure, List2),
    sort(List2, [abomasnow, aggron, altaria, ampharos, arbok, aurorus, avalugg,
    bastiodon, bayleef, blastoise, charizard, charmeleon, croconaw, ditto,
    dragalge, dragonair, dragonite, exploud, feraligatr, flaaffy, fraxure,
    gabite, garchomp, goodra, grotle, grovyle, gyarados, haxorus, heliolisk,
    hydreigon, ivysaur, kingdra, lairon, lickilicky, loudred, marowak,
    marshtomp, meganium, milotic, nidoking, nidorino, pupitar, rampardos,
    rhydon, rhyperior, salamence, sceptile, scrafty, seadra, shelgon, sliggoo,
    slowbro, slowking, snorlax, swampert, torterra, tyranitar, tyrantrum,
    venusaur, wartortle, zweilous]),
    % test 3: ditto
    can_breed_list(ditto, List3),
    sort(List3, [abomasnow, accelgor, aegislash, aggron, alakazam, altaria,
    ambipom, amoonguss, ampharos, arbok, arcanine, archeops, ariados, armaldo,
    aromatisse, aurorus, avalugg, azumarill, banette, barbaracle, bastiodon,
    bayleef, beartic, beautifly, beedrill, beheeyem, bellossom, bibarel,
    bisharp, blastoise, blaziken, blissey, boldore, braixen, braviary, breloom,
    bronzong, butterfree, cacturne, camerupt, carracosta, cascoon, chandelure,
    chansey, charizard, charmeleon, cherrim, chesnaught, chimecho, cinccino,
    clawitzer, claydol, clefable, clefairy, cloyster, cofagrigus, combusken,
    conkeldurr, cradily, crawdaunt, crobat, croconaw, crustle, darmanitan,
    delcatty, delphox, dewgong, dewott, diggersby, dodrio, donphan, doublade,
    dragalge, dragonair, dragonite, drapion, drifblim, dugtrio, duosion,
    dusclops, dusknoir, dustox, eelektrik, eelektross, electabuzz, electivire,
    electrode, emboar, empoleon, escavalier, espeon, excadrill, exeggutor,
    exploud, fearow, feraligatr, ferrothorn, flaaffy, flareon, fletchinder,
    floatzel, floette, florges, flygon, forretress, fraxure, frogadier,
    froslass, furret, gabite, gallade, galvantula, garbodor, garchomp,
    gardevoir, gastrodon, gengar, gigalith, glaceon, glalie, gliscor, gloom,
    gogoat, golbat, golduck, golem, golurk, goodra, gorebyss, gothitelle,
    gothorita, gourgeist, granbull, graveler, greninja, grotle, grovyle,
    grumpig, gurdurr, gyarados, hariyama, haunter, haxorus, heliolisk, herdier,
    hippowdon, hitmonchan, hitmonlee, hitmontop, honchkrow, houndoom, huntail,
    hydreigon, hypno, infernape, ivysaur, jellicent, jigglypuff, jolteon,
    jumpluff, jynx, kabutops, kadabra, kakuna, kingdra, kingler, kirlia, klang,
    klinklang, kricketune, krokorok, krookodile, lairon, lampent, lanturn,
    leafeon, leavanny, ledian, lickilicky, liepard, lilligant, linoone, lombre,
    lopunny, loudred, lucario, ludicolo, lumineon, luxio, luxray, machamp,
    machoke, magcargo, magmar, magmortar, magneton, magnezone, malamar,
    mamoswine, mandibuzz, manectric, mantine, marill, marowak, marshtomp,
    masquerain, medicham, meganium, meowstic, metagross, metang, metapod,
    mienshao, mightyena, milotic, mismagius, monferno, mothim, mr_mime, muk,
    musharna, nidoking, nidoqueen, nidorina, nidorino, ninetales, ninjask,
    noctowl, noivern, nuzleaf, octillery, omastar, palpitoad, pangoro,
    parasect, pelipper, persian, pidgeot, pidgeotto, pignite, pikachu,
    piloswine, politoed, poliwhirl, poliwrath, porygon2, porygon_z, primeape,
    prinplup, probopass, pupitar, purugly, pyroar, quagsire, quilava,
    quilladin, raichu, rampardos, rapidash, raticate, reuniclus, rhydon,
    rhyperior, roselia, roserade, salamence, samurott, sandslash, sawsbuck,
    sceptile, scizor, scolipede, scrafty, seadra, seaking, sealeo, seismitoad,
    serperior, servine, sharpedo, shedinja, shelgon, shiftry, silcoon,
    simipour, simisage, simisear, skiploom, skuntank, slaking, sliggoo,
    slowbro, slowking, slurpuff, snorlax, spewpa, staraptor, staravia, starmie,
    steelix, stoutland, sudowoodo, sunflora, swadloon, swalot, swampert,
    swanna, swellow, swoobat, sylveon, talonflame, tangrowth, tentacruel,
    togekiss, togetic, torterra, toxicroak, tranquill, trevenant, typhlosion,
    tyranitar, tyrantrum, umbreon, unfezant, ursaring, vanillish, vanilluxe,
    vaporeon, venomoth, venusaur, vespiquen, vibrava, victreebel, vigoroth,
    vileplume, vivillon, volcarona, wailord, walrein, wartortle, watchog,
    weavile, weepinbell, weezing, whimsicott, whirlipede, whiscash, wigglytuff,
    wobbuffet, wormadam, xatu, yanmega, zebstrika, zoroark, zweilous]).


% child_pok(Male, Female, ChildPok).
test(child_pok, [nondet]) :-
    child_pok(ditto, pikachu, pichu),
    child_pok(pikachu, ditto, pichu),
    child_pok(dewgong, dewgong, seel),
    child_pok(mantine, swanna, ducklett),
    \+child_pok(goomy, goodra, _). % i.e., no child, since cannot breed with a baby

% child_pok_options(ChildPok, MaleFemalePairs).
test(child_pok_options, [nondet]) :-
    % what are the ways to get a pichu?
    child_pok_options(pichu, List),
    sort(List, [[ambipom, pikachu], [ambipom, raichu], [ampharos, pikachu],
    [ampharos, raichu], [arbok, pikachu], [arbok, raichu], [arcanine, pikachu],
    [arcanine, raichu], [aromatisse, pikachu], [aromatisse, raichu],
    [azumarill, pikachu], [azumarill, raichu], [beartic, pikachu], [beartic,
    raichu], [bibarel, pikachu], [bibarel, raichu], [blaziken, pikachu],
    [blaziken, raichu], [blissey, pikachu], [blissey, raichu], [braixen,
    pikachu], [braixen, raichu], [breloom, pikachu], [breloom, raichu],
    [camerupt, pikachu], [camerupt, raichu], [chansey, pikachu], [chansey,
    raichu], [cherrim, pikachu], [cherrim, raichu], [chesnaught, pikachu],
    [chesnaught, raichu], [cinccino, pikachu], [cinccino, raichu], [clefable,
    pikachu], [clefable, raichu], [clefairy, pikachu], [clefairy, raichu],
    [combusken, pikachu], [combusken, raichu], [darmanitan, pikachu],
    [darmanitan, raichu], [delcatty, pikachu], [delcatty, raichu], [delphox,
    pikachu], [delphox, raichu], [dewgong, pikachu], [dewgong, raichu],
    [dewott, pikachu], [dewott, raichu], [diggersby, pikachu], [diggersby,
    raichu], [ditto, pikachu], [ditto, raichu], [donphan, pikachu], [donphan,
    raichu], [dugtrio, pikachu], [dugtrio, raichu], [emboar, pikachu], [emboar,
    raichu], [empoleon, pikachu], [empoleon, raichu], [espeon, pikachu],
    [espeon, raichu], [excadrill, pikachu], [excadrill, raichu], [exploud,
    pikachu], [exploud, raichu], [flaaffy, pikachu], [flaaffy, raichu],
    [flareon, pikachu], [flareon, raichu], [floatzel, pikachu], [floatzel,
    raichu], [floette, pikachu], [floette, raichu], [florges, pikachu],
    [florges, raichu], [froslass, pikachu], [froslass, raichu], [furret,
    pikachu], [furret, raichu], [glaceon, pikachu], [glaceon, raichu], [glalie,
    pikachu], [glalie, raichu], [gogoat, pikachu], [gogoat, raichu], [golduck,
    pikachu], [golduck, raichu], [granbull, pikachu], [granbull, raichu],
    [grumpig, pikachu], [grumpig, raichu], [herdier, pikachu], [herdier,
    raichu], [hippowdon, pikachu], [hippowdon, raichu], [houndoom, pikachu],
    [houndoom, raichu], [infernape, pikachu], [infernape, raichu], [jigglypuff,
    pikachu], [jigglypuff, raichu], [jolteon, pikachu], [jolteon, raichu],
    [jumpluff, pikachu], [jumpluff, raichu], [krokorok, pikachu], [krokorok,
    raichu], [krookodile, pikachu], [krookodile, raichu], [leafeon, pikachu],
    [leafeon, raichu], [liepard, pikachu], [liepard, raichu], [linoone,
    pikachu], [linoone, raichu], [lopunny, pikachu], [lopunny, raichu],
    [loudred, pikachu], [loudred, raichu], [lucario, pikachu], [lucario,
    raichu], [luxio, pikachu], [luxio, raichu], [luxray, pikachu], [luxray,
    raichu], [mamoswine, pikachu], [mamoswine, raichu], [manectric, pikachu],
    [manectric, raichu], [marill, pikachu], [marill, raichu], [meowstic,
    pikachu], [meowstic, raichu], [mienshao, pikachu], [mienshao, raichu],
    [mightyena, pikachu], [mightyena, raichu], [monferno, pikachu], [monferno,
    raichu], [musharna, pikachu], [musharna, raichu], [nidoking, pikachu],
    [nidoking, raichu], [nidorino, pikachu], [nidorino, raichu], [ninetales,
    pikachu], [ninetales, raichu], [nuzleaf, pikachu], [nuzleaf, raichu],
    [pangoro, pikachu], [pangoro, raichu], [persian, pikachu], [persian,
    raichu], [pignite, pikachu], [pignite, raichu], [pikachu, ditto], [pikachu,
    pikachu], [pikachu, raichu], [piloswine, pikachu], [piloswine, raichu],
    [primeape, pikachu], [primeape, raichu], [prinplup, pikachu], [prinplup,
    raichu], [purugly, pikachu], [purugly, raichu], [pyroar, pikachu], [pyroar,
    raichu], [quagsire, pikachu], [quagsire, raichu], [quilava, pikachu],
    [quilava, raichu], [quilladin, pikachu], [quilladin, raichu], [raichu,
    ditto], [raichu, pikachu], [raichu, raichu], [rapidash, pikachu],
    [rapidash, raichu], [raticate, pikachu], [raticate, raichu], [rhydon,
    pikachu], [rhydon, raichu], [rhyperior, pikachu], [rhyperior, raichu],
    [roselia, pikachu], [roselia, raichu], [roserade, pikachu], [roserade,
    raichu], [samurott, pikachu], [samurott, raichu], [sandslash, pikachu],
    [sandslash, raichu], [sawsbuck, pikachu], [sawsbuck, raichu], [scrafty,
    pikachu], [scrafty, raichu], [sealeo, pikachu], [sealeo, raichu],
    [serperior, pikachu], [serperior, raichu], [servine, pikachu], [servine,
    raichu], [shiftry, pikachu], [shiftry, raichu], [simipour, pikachu],
    [simipour, raichu], [simisage, pikachu], [simisage, raichu], [simisear,
    pikachu], [simisear, raichu], [skiploom, pikachu], [skiploom, raichu],
    [skuntank, pikachu], [skuntank, raichu], [slaking, pikachu], [slaking,
    raichu], [slurpuff, pikachu], [slurpuff, raichu], [stoutland, pikachu],
    [stoutland, raichu], [swoobat, pikachu], [swoobat, raichu], [sylveon,
    pikachu], [sylveon, raichu], [togekiss, pikachu], [togekiss, raichu],
    [togetic, pikachu], [togetic, raichu], [typhlosion, pikachu], [typhlosion,
    raichu], [umbreon, pikachu], [umbreon, raichu], [ursaring, pikachu],
    [ursaring, raichu], [vaporeon, pikachu], [vaporeon, raichu], [vigoroth,
    pikachu], [vigoroth, raichu], [wailord, pikachu], [wailord, raichu],
    [walrein, pikachu], [walrein, raichu], [watchog, pikachu], [watchog,
    raichu], [weavile, pikachu], [weavile, raichu], [whimsicott, pikachu],
    [whimsicott, raichu], [wigglytuff, pikachu], [wigglytuff, raichu],
    [zebstrika, pikachu], [zebstrika, raichu], [zoroark, pikachu], [zoroark,
    raichu]]),
    % what are the ways to get a ditto? (none)
    child_pok_options(ditto, []).

% breed_for_pok_type(DesiredPokType, MaleSpecies, FemaleSpecies, ChildSpecies).
test(breed_for_pok_type, [nondet]) :-
    % I have a venusaur (male), what can I breed with (female) to get a grass species child?
    setof([F, C], breed_for_pok_type(grass, venusaur, F, C), List),
    List = [[abomasnow, snover], [amoonguss, foongus], [bayleef, chikorita],
    [bellossom, oddish], [breloom, shroomish], [cacturne, cacnea], [cherrim,
    cherubi], [ditto, bulbasaur], [exeggutor, exeggcute], [ferrothorn,
    ferroseed], [gloom, oddish], [grotle, turtwig], [grovyle, treecko],
    [ivysaur, bulbasaur], [jumpluff, hoppip], [lilligant, petilil], [lombre,
    lotad], [ludicolo, lotad], [meganium, chikorita], [nuzleaf, seedot],
    [parasect, paras], [roselia, budew], [roserade, budew], [sceptile,
    treecko], [serperior, snivy], [servine, snivy], [shiftry, seedot],
    [skiploom, hoppip], [sunflora, sunkern], [tangrowth, tangela], [torterra,
    turtwig], [trevenant, phantump], [venusaur, bulbasaur], [victreebel,
    bellsprout], [vileplume, oddish], [weepinbell, bellsprout], [whimsicott,
    cottonee]].

% potential_child_move(ChildPok, Male, Female, MaleMove, FemaleMove, ChildMove).
test(potential_child_move, [nondet]) :-
    % what are all the ways to get a yamask child that knows the curse level_up move?
    setof([Male, Female, MaleMove, FemaleMove], potential_child_move(yamask, Male, Female, MaleMove, FemaleMove, curse), List),
    List = [[banette, cofagrigus, curse, curse], [cofagrigus, cofagrigus,
    curse, curse], [dusclops, cofagrigus, curse, curse], [dusknoir, cofagrigus,
    curse, curse], [ferrothorn, cofagrigus, curse, curse], [gengar, cofagrigus,
    curse, curse], [haunter, cofagrigus, curse, curse], [lampent, cofagrigus,
    curse, curse], [steelix, cofagrigus, curse, curse], [trevenant, cofagrigus,
    curse, curse]],
    % there is no way to breed a pichu that knows the bestow egg move
    \+(setof([Male, Female, MaleMove, FemaleMove], potential_child_move(pichu, Male, Female, MaleMove, FemaleMove, bestow), _)),
    % what are all the ways to get a yamask child that knows the endure egg
    % move?
    setof([Male, Female, MaleMove, FemaleMove], potential_child_move(yamask, Male, Female, MaleMove, FemaleMove, endure), List2),
    List2 = [[sudowoodo, cofagrigus, endure, astonish], [sudowoodo, cofagrigus,
    endure, attract], [sudowoodo, cofagrigus, endure, calm_mind], [sudowoodo,
    cofagrigus, endure, confide], [sudowoodo, cofagrigus, endure, curse],
    [sudowoodo, cofagrigus, endure, dark_pulse], [sudowoodo, cofagrigus,
    endure, destiny_bond], [sudowoodo, cofagrigus, endure, disable],
    [sudowoodo, cofagrigus, endure, double_team], [sudowoodo, cofagrigus,
    endure, dream_eater], [sudowoodo, cofagrigus, endure, embargo], [sudowoodo,
    cofagrigus, endure, energy_ball], [sudowoodo, cofagrigus, endure, facade],
    [sudowoodo, cofagrigus, endure, flash], [sudowoodo, cofagrigus, endure,
    frustration], [sudowoodo, cofagrigus, endure, giga_impact], [sudowoodo,
    cofagrigus, endure, grass_knot], [sudowoodo, cofagrigus, endure, grudge],
    [sudowoodo, cofagrigus, endure, guard_split], [sudowoodo, cofagrigus,
    endure, haze], [sudowoodo, cofagrigus, endure, hex], [sudowoodo,
    cofagrigus, endure, hidden_power], [sudowoodo, cofagrigus, endure,
    hyper_beam], [sudowoodo, cofagrigus, endure, infestation], [sudowoodo,
    cofagrigus, endure, mean_look], [sudowoodo, cofagrigus, endure,
    night_shade], [sudowoodo, cofagrigus, endure, ominous_wind], [sudowoodo,
    cofagrigus, endure, payback], [sudowoodo, cofagrigus, endure, power_split],
    [sudowoodo, cofagrigus, endure, protect], [sudowoodo, cofagrigus, endure,
    psych_up], [sudowoodo, cofagrigus, endure, psychic], [sudowoodo,
    cofagrigus, endure, rain_dance], [sudowoodo, cofagrigus, endure, rest],
    [sudowoodo, cofagrigus, endure, return], [sudowoodo, cofagrigus, endure,
    round], [sudowoodo, cofagrigus, endure, safeguard], [sudowoodo, cofagrigus,
    endure, scary_face], [sudowoodo, cofagrigus, endure, shadow_ball],
    [sudowoodo, cofagrigus, endure, sleep_talk], [sudowoodo, cofagrigus,
    endure, substitute], [sudowoodo, cofagrigus, endure, swagger], [sudowoodo,
    cofagrigus, endure, thief], [sudowoodo, cofagrigus, endure, toxic],
    [sudowoodo, cofagrigus, endure, trick_room], [sudowoodo, cofagrigus,
    endure, will_o_wisp]].

% child_moves(ChildPok, Male, Female, MaleMoves, FemaleMoves, ChildMoves). note, ChildMoves
% should be sorted (to ease testing)
test(child_moves, [nondet]) :-
    child_moves(pichu, chansey, pikachu, [endure, present, tail_whip], [agility, brick_break, feint, grass_knot, sleep_talk, tail_whip, endure, toxic, thunder_shock], [endure, present, tail_whip]),
    child_moves(ducklett, mantine, swanna, [air_slash, aqua_ring, bubble_beam, mud_sport, water_pulse, wing_attack], [air_slash, aqua_ring, bubble_beam, brave_bird, water_pulse, wing_attack], [air_slash, aqua_ring, bubble_beam, water_pulse]),
    child_moves(ducklett, mantine, swanna, [aqua_ring, bubble_beam, mud_sport, water_pulse, wing_attack], [air_slash, aqua_ring, bubble_beam, aerial_ace, brave_bird, water_pulse, wing_attack], [aqua_ring, bubble_beam, water_pulse, wing_attack]),
    child_moves(ducklett, mantine, swanna, [aqua_ring, bubble_beam, mud_sport, water_pulse, wing_attack], [air_slash, aqua_ring, bubble_beam, aerial_ace, brave_bird, water_pulse], [aqua_ring, bubble_beam, mud_sport, water_pulse]).


:- end_tests(breeding).

