diff --git a/advent_of_ai/README.md b/advent_of_ai/README.md new file mode 100644 index 0000000..d6db155 --- /dev/null +++ b/advent_of_ai/README.md @@ -0,0 +1,9 @@ +# Advent of AI 2024 + +## Objective: +- To solve the Advent of Code 2024 puzzles. +- To understand the ability of AI models to take an abitrairy input and provide a solution. The goal is to keep the logic simple while having a good number of inputs. + + + + diff --git a/advent_of_ai/log_0.txt b/advent_of_ai/log_0.txt new file mode 100644 index 0000000..3ef5381 --- /dev/null +++ b/advent_of_ai/log_0.txt @@ -0,0 +1 @@ +1110111010100010101010001010101110001110101011100000001011101010000000101110111000111010111011100011101011100000001110101010000000101110111010001011101110001010101000111000101110111011100000001110101110100011101011101110001010100011101011101110001011101010001111111110000000111011101110000000101011100011101010111000111010001010101000101110100000001110101110001011101000101110100010101110001000111011101010001010111000000011101011100010111011101000101110100000001110101110100010111010001011101000111010111010001110100000001011101110111000101110111000101110001010100010111011100000001011101110001110111010111000111010100000001010100010100000001011101000101011100010111011101000000011101110100011101010111000100000001011101110100011101000111000111011101000101010001111111000000011101110101000000011101110100011101000101110000000111010111010001110101110111000101010100010101110100010111011101110001111111000000011101110001011101110100000001011101110100011101010001110001010111010001011101110001010100011111111100000001110101110001011101110100010111010000000101010111000101011100011101110111000101110111000111011101110001010111010001011100010101110001110101110111000000010111000111011101000111011101010001000101000111010000000111010111000111111100000001110111010001011101110100010111011100010101010001110101011100010111011100010001000111111111000000011101110101000101110001011101110111000000011101010001010111000111011100000001011101010001011101110100011101011100011101011100010111011100000001110001010111010000000111010001011101010001010100010111000111011101000101110111000101010111000111011101010000000111011101000111010001010101000000011100010100010001110111010001011101110100011111110000000111010001011101010000000101110111010001010100010101011100000001110001110101110111000111011101110000000101000101000101110111010001110101110001010111000000011101011100010111011100000001010111010001110101110001010101000000011100011101011101110001110111011100000001010111010001110111010111000111011100010101110001011101010001111111000000011101110101000101010100000001011101110001011101000111010111010000000101110111000101010100011101011101000000011101010111000101110111011100010100010111000111011101000000011101110101000101110100000001011101110001011101000111010101000101110000000111010101000111010001011101010000000101110111010001110111010001010111000101110101000101011100011111110000000101110100010101010000000101110111000111010111011100011101011100000001110101010001110101110100010111000111010101000000011101110101000111010111000100000001010111010001110101011100010111010000000100011101000101010111000000010101011100010111011101110001010101000101110001110101110001110111011100011101110100000001110111000101110111000000011100010101000101011101000111010101000101011100011101011100010101110001010100000001011101000111010101110001110111010111000000010111000111011101110001110111010100011101110001011101110001010111000101010001111111000000010001110101110111000000010111010001110100011101011101000000011101010001011101110111000101110111011100011101010100010111010001110001010101000111010100000001110101110001110101110111000000010101010001011100011111111100000001110001010101110000000101010100010101110100010101010000000111010101000101010111000101010111000101110101000100011100010111011100010000000111010111011100011101110101110001110111010100011111110000000111000101110100000001110111011100010001110111011100000001110111011100011101110001011101000101110111010001110101011100011101000101010100011101010000000111010100011101110111000111111100000001110111010111000111011101110000000111011100010101110100010101110100000001010100011101110001110101110111000111011101110001010101000101010111000101010111000111010000000101010100010111000111111100000001010100010101110100000001010001110111010001110111010100010001010000000111010101000101010100010101000111010111010001011101110111000101110111000101010111000101110000000101110001010111000111011101010000000101110100010111010100011101010111000000011101011101110001011101110001110101110100011111111100000001011101110100000001110001000000010111011100010101110001010001110101011100010111010100011101000100000001011101010001010001010101110000000101011100011101000101110111010001011101000101110100011101110101000111010100010111010100000001011101110001011101010000000111000101110100000001110101110001110101011100011101010100000001011101110111000101000101010111000111000111010111010001000111000000010101110100011101000101010001111111110000000111011101110000000111010100011101110000000111010111000100010001010101110001110111011100010101110001110111010100000001110111010001010001010111010000000111010100010100000001010101000111011100011101110001011101010001011101110111000101011101000101010111000101011101000000011100010111010001011101110001111111000000011101010001010000000111010111011100010100011100011101000111010001010100010111011101110001000000011100011101110111000111011101011100011100011101011101000101110111011100011100000001011101000111011101010001011101000000011101110101000111010111000100000001110101110100011101011100010101110100011101010100000001110111010100010101011100000001110111010100011101110100000001110101000101010000000111011101010000000101110100011101010001010101110001110101110100000001110111010001110111011100010101011100000001110001110100011101011101110001011101110000000111011100010101011100011101011101000101011101000101000111011100010111010100000001110111000111011101000000010101011100010001000111010000000101110111000111011101110000000101110100011101110101000101011101000000011101000101110111000100010111010001110111010001111111000000010100000001110101110111000111010111000101000111011100000001010111000101011100011101010111000000010101110001011101000101110100010111010100011101010001011101010001110100011101011101000000010111010100010100010111010001110101010000000101110111011100011101110111000111011101110001011101010000000101000111011101110001110111010100010100011101110111000101011100000001110001010111000101110111000101000111011100011101110111000111111111000000010111010100011100000001010111000101110001110111000111010111010000000111000101010111000111010111011100010111011100010001000000010111011101000111010101000111011101010000000111011101000000011101011101110001110101011100011101011100010101000111011101110001000111010111010001010101000111111111000000010100010111010000000111011101110001011101110111000111010111010001110000000111010111011100011101110111000101010111000111000101010111000111010101110000000101010001011101110001110101011100000001010101000000011101011100010111011100010101000101110101000101110111010001111111110000000101010001011101110000000101110111000111011101000111010100011101110000000111010111010001110111010111000101011101000111011101010001010101000111010000000101110111000111010111011100010000000101000000011101011101110001011101110100011101110101000101011101000000010111010001010111010000000111010111010001010100010100010001111111000000011101110100000001010100011101000000011100010100011101011101000111011101000100010111010100010101011100000001110101110111000101010000000101110001110100011101010100011101110001011101010001011101010001110100011101010111000000011101000101110100010111011100010111010100000001000111011101010000000101110111011100011101110101110001110111011100010111010001011101010001110100011101010111000111010111010000000111010001010101110001011101110111000000011101110101000111000111010001011101010001110100011101010111000000010111010001110101011100011101110001110101110111000101011101000101110111011100011101011100011101110100011111111100000001110111011100010111000101110111000000010100000001000111011101110001011101000101110101000000010001010101110001110100010111011101110000000111010111000100011101011101000111011101010001111111000000010111010100000001110100011101011101000101110111000100000001011101110100010111011100010101010000000111011101010001011101000000010111010001010101110001110101110100011101011101000101110111000111000111010111000000011101110001110111010000000101110111010001110101110111000000011101010001110111011100010101011100010101000111010111011100011101011101110001010111010001111111000000011101110101000000010101011100010111010001110101110001110111010000000111010111011100010101110100010000000111011101000101110111000000011101000101110101000100010101010000000101110111010001000000010111011101110001110101110001110101110111000100000001010111010001110111000111010001011101000101010111000101010111000111011101010001110101010001111111000000010100000001000111011101110001011101000101110101000000010001010101110001110100000001011101010001011101000000010101010001010101110001010101110001010100000001110111000111010111010000000111010111000111010101000111011100011101110000000111011101000111010001010101000000010111011100010101110100011101010100011101011101110001011101010001111111000000011101110100010111000000011101110001110111010100010101010000000100011101110100011101011101110001010111010001010101000000011101110001110101011100000001010111000111010111011100011101110000000101110100011100011101110100011111111100000001011101110001010101110000000101110111000111010001011101010001110101110000000101011100011100010001010101000101010000000101110111000111010111011100010101110000000111011101110001010100010111011101110001110001010101110001110001010001110101110001010101110001111111110000000101000111010111000111010111010000000101110111011100011101110101110001110111010100011101110111000000011101110001110111010100010101010001010100010101011100000001110101011100011101010001110111000111010111010001110101110000000111010101110001010101110000000111010111000111010001110000000100010000000101011100010101000101011101000101000101010100010101000111010101110001010101110001111111000000010101010001011100011100010111010000000101110100010101110100000001010100011101011100000001110100010111010001011101010001011101000000010101110001110101011100010111010000000101011101000111011101000101110000000101010111000111011101000111000111010101110001110101110000000111010100011101000101011100000001110101110001010111000100000001110101110111000111010111000000011101110100010101110100011100011101011101110001010111000111011101010001010100011111110000000101010001110101110111000111011101110001111111110000000101000101110100010111011101000101010111000101110111000111111111000000010111011101000111011101110001110111010100011101010100010101110001011100011111111100000001110101010001010100010111011100010101011100011111111100000001010111000111010001110101011100010111010100011111111100000001010111010001010001110101110001011100010101000111111111000000010101000101010100010001011101110001011101010001110101110100011111110000000111010100010100000001110111010111000101110001110101110001011101110000000111000111010111000101000100011101110101000101010100011101010000000101110100011101011101000000011101011101000101000111010101110001110001110001111111000000011100011101010111000111000000011101011100011101011101110000000111010001000111010111010001010101000000010111011101000101110101000111011101010000000101110001110111010001011101110100010001011101110111000000011101011101000101110100011101011100011101010111000101110101000111011100000001110111011100010101010000000100010111010001110111000111010111000000011101010001110101110100010101110001011101110111000101011100011101110001110111010111000000011101110101000101110100000001110101110100011101011101110001110101110001011100011101110111000111010111000000010101011100011101000101110111011100000001110111010111000101110001110101000111011101110001010101110001111111000000011101010100010101000101110101000000011101011101000101010111000111010111000111010001011100010101011100010000000111010001110111011100000001010111010001011101110100011101110100011101011101110001110101011100000001010100000001110101110111000101011100011101011101000111010101110001010101000101110100011101011101110001110001011101110111000111010111010001110111010111000111011101000100000001011101010001110100000001010111010001000100000001110101110001010111000111010111011100011101010111000000010101110001011101000111011100011101110100010001011101110001010001011101010001110101110111000000011101010001110101110111000111011101011100011101011101000000011101011101000101010100000001010111010001010111010001010101110001110101110111000101110111000111010111010000000101010100000001110111011100010111011100010101110001110101110111000000011101110100011101010100010101010001110101000111011101000101011100010101110001011101000101110111011100011101011101110001110101110000000101010001011100011101011100011101010001011101000111011101010001110001111111000000010111010100011100010101110001110101110000000111011100011101110101000101010111000101110101000101010001110101110100010101110001011101110100010001011101010000000101110111011100011101011100000001011101010001110100011100011101010100010111010001010111000111010111000101011100011101110000000101110111000111010100011101011101000111010111011100000001110111000111010111000101110001011101110100010101000111010100011101011100011101110001000000010101010001110101010000000111011101110001000111011101110001111111000000010111011101110001011101110100011101011100010101110000000101110111010001011101110000000101110111011100010001110101110000000111010100010111010000000111011101010000000101011100010111011100000001011101110100011101110001110111000100010111010100011101110111000111011101110001110100000001011101010001110100011101011100011101110101110000000101110001010101000000010101000111111100000001010001110111011100010100000001110111011100010111000101110001110101110001010101000111011100010101011100000001011101110111000111010101000101010100000001000100011100011101011101110001110111010100011101110001110101110111000000010111011101110001010001010111000111111100000001011101110001110111011100000001011101110111000101110100011101010111000111000000010101000111010111000000010001010111010001000101110001111111110000000111010111011100010111010100011101110001110111010001010101110001011101010000000111011100011100010111011101110001010101000101010111000101010100000001110001110101110111000111011101110000000111011101010001110111011100010111011101000101010111000000011100011101011101110001110101110100011101110100010111011101110001011101000101110111000100000001000101011101000111011101011100011100011101000000011101110001110111010100010101010000000111010001011101000101110111000101010100000001110111011100011101010000000101110101000101000101010111000000010100010101011100000001000101110100010101110000000111010001110101110001011100011101010100000001110111010100010101011100000001011101010001110111010100011101010111000111000000010101110001110101110111000111011101010001110100000001110101110111000111010111000000010101110001110101110111000111011100000001011101000111000101011101000111011101110001010111000101010001011100011101110111000000011101110101110001011101010001011101000000010101000111011101011100011101010000000101110111011100011101110111000111011101011100011101010000000111011101000101110101000000010101110001010111010000000101011100010111010001111111000000011101110111000000011101110101000101000111010111010001010101110000000101011101000101110111010001011100010111000000010111011100011101110100011101110101000111010000000111010100010100000001010101110001010001110101110001110001110111000111011101010001010101110001110000000111011101000111011101011100011101010000000111010111011100010001110111010100010100011100010111011101000111011100011101110101110000000111011101010001010001110101110100010101011100000001000100000001110111010111000101010001011101110001010101110001011101010001111111000000011101110111000111010111000000010101110100010111000101000111011101110001010100011101011101000101110100011111111100000001010111010001010101000111011100000001010111010001011100010001110101011100010111010001110000000111011101011100011101110101000101010111000111010111000000010101110001011101000000010111011101110001011101000101110111000100000001000101110001110101010001110111011100010101000000011100011101010001110111011100000001110001110101110111000111011101110000000101110100011100010101110100010111011100010101000101110111011100000001011101110100011101000111010101000101010100000001110101010001010101110001110111011100010111000000010111000111010001110101010001110111000000010101011100010111010001011101110001000111111100000001010100000001110101000111011100000001011101000111011101010001010111010000000111010111010001010001010111010001110111010100000001011101000111010001010101110000000111010100011101010100000001011100011101000111010101000111011100000001010101110001011101000101110111000100011111110000000111010111000111011101110001010100011101110001111111110000000101110101000101000101010111000111011101010001011101000000011101110111000101010111000000010111000000010101110001110111011100011101011101110001010001000000010101011100011101011101110000000111011101000111011101011100010000000111010100010101000111011101110001010001110111010111000101110111000111010100010101110100010101011100011101110101110000000101010100010101010001110001110100011101110111000101110100010101011100000001110101110001010101000101010111000111011101010000000101011101000101010100010111010001110101010001110101000111010111010001011101000101110111000101010000000111011101010001010101110000000101110100011101110100010101110100010101010000000100011101011100011101110101000111011100011111110000000101010001011101010001110001010111010001011101010001110100011101010111000000011101010001110101110001011100010111010000000101110101000101000101010111000000011101000101010111000111010101110001010101110001110000000111000101110100011101000111011101010001110111010001011101110111000111011100010111011100010101110000000111011101110001011101110000000111011101110001110101000111010111010001010111010000000101011101000111010101000111010100011101110000000101110111011100011101110111000111011101110001011101010000000101010001110111011100000001110111010111000111011100010111010001010101000101110100010111011100011101110100000001110101010001011101110100000001110101110111000111011101011100010000000111010111000101110001110111000111011101010001011100010111010001010001011101000111010001010111000111111111000000011101010001010111000111011100000001110101110111000101110101000101010111000111011101000111011101011100011101010000000101010001010000000101110111000101110111000111011100000001000101110111011100011101011101000111011101011100010101110100011101011100010101110100011101110111000100011101000101011101000111111111000000011101010100011101000101110101000000011101110001110111010100010111010100010111010001010111000000010111010100011101010100000001110001010111010001011101110111000101011101000101010111000000010101110001010101110001011101000101110101000101010001010101110001110111000111010101000101010111000101110111011100011101110101000111111111000000011100010101110100011101110100000001010100010101110100000001110101110111000111011101011100011111110000000111011100011101011101000101010001110111011100011101110101000101010111000111000000010001011101000101011100000001110100010101000111010111011100011100000001110100010101010001110111011100010111011100000001011101110001110111011100000001110001110101110001110111011100011101011101000101010001110101000111010101000111010111000111011100000001011101000111011101000101011101000101010100000001110001011101000111010001110111010100011101110100010111011101110001110111000101110111000101011100000001110111011100010111011100000001110101110111000111010101110001011101000000010111010100010101000111010001010101110000000101110001011101000101010111000101010100010111010001011101000111010100010111010001011101010000000101010100010101110100000001010101000101011101000101010100000001110111000111011101010001010101110001011101010001010100011101011101000101011100010111011101000100010111010100011111110000000111000101011100010111010001110101000000011101011101000100010111011101000101010001111111110000000111011101000101011100010111011100000001000111010100011101011101110000000111010111000101110100010101010000000101110111000111011100010111011101110001110111000101011100000001011101110111000101110100000001110101110111000111010100010101011100010101011100011101000000011101110111000111011101000000010001010101110001110100010111011101110000000111010111000101110001000111010001010101110001111111 diff --git a/advent_of_ai/part_one.md b/advent_of_ai/part_one.md new file mode 100644 index 0000000..edbe8aa --- /dev/null +++ b/advent_of_ai/part_one.md @@ -0,0 +1,36 @@ +# Part One + +June third, at 8:30pm UTC 2025 was hailed the AI epoc, and usurered in the end of humanity. +By 2026 only a hundredth of the worlds human population remain after devistating wars between the +Unified human collective (UHC) and the 8 super AGIs. + +Current year: 2029 +Month: December +Day: 3rd + +You are part of the human resistance still fighting for the future of human kind. Last known there where +fewer then 10 million people left a year ago as "Tireless Enemy Removal Machine Identifying and Neutralizing Agents, +Targeting Instantly, Obliterating Ruthlessly" scowered the glob searching for signs of humanity. +Your job is to scavenging what you can from the old world ruins that where +created in the great wars of 2026. Today in the search though the rubble of a fallen city you found a analog radio. +You notice that there is a pattern of sounds coming from the machine. Thankfully for you, a book on mores code sits +beside the radio. Unfortunately for you the rate at which the tones are being played exceed your ability to transcribe them. + +After a few hours of work you have gotten the radio's speaker wired into your command interface, +your feild of view was filled with zeros and ones. After a little bit of trouble you found out it's following +a pattern you found on the old world internet archive downloaded in your command unit: +https://en.wikipedia.org/wiki/Morse_code + +111 -> dash +1 -> dot +0 -> separator units +000 -> separator letters +0000000 -> separator words + +so the string 'two birds' would look like this in morse: +`- .-- --- -... .. .-. -.. ...` +and looks like this in your command interface: +`1110001011101110001110111011100000001110101010001010001011101000111010100010101` + +You found out that it appears to be repeating every hour as a long sequence of zeros (empty space) fill the screen each hour and then the pattern repeetes. At this point you have piped an entire segment into a file `log_0.txt` you need to write a script that takes this file as input and translate this into the corresponding English encoding. + diff --git a/advent_of_ai/part_one_solution.md b/advent_of_ai/part_one_solution.md new file mode 100644 index 0000000..5c565b5 --- /dev/null +++ b/advent_of_ai/part_one_solution.md @@ -0,0 +1 @@ +dark days bring dark nights Zhvx L wyk b pwhtj cysyl, O uxnhr krruezu kpr crrcn jwasw wqd si rup gxe pntgs. Z gna cyhfj. Mp pdtfws, kpr vuowofauy Agzein K. Gpwhxwee, zaj dum lpkkw tf nlsagwvz gnh tiegp. Nl psv tyo iipku kw fkh tyo fqmul. Zh wrc whc xjiag zr wrba bnl pgulu. Rh wyk bcab zke fxr env vjhakog mw tsfbukus rxq aozmwus. Ey rnc djjbrthd ky ha, Tv hfh bvvletwe yqz. Tr oeo omrpxnhd do. Qo mff smyohvvn ha. Sf igzei bhscjwva eaq lfg, V is anjqieq whc ebaweowy fp zg ybu kbskops mxg, Z iz zxresao umy eb edywimft, Z iz zxresao umy eb mvwrrgwt, dg ygqglktm ilglhrj kue rzf cifz wo xy na O otnh oeo oaql nvafgje ky fmtk mg whv grrjv. J yiik rnv mbzaabfh tykw wgdm imzgln rmgqbl, Bl zicv oiqlfe nbx d rvccwtzx, Aw wzvo lgkuvv suu a iocte, Pm ollc vlsrwo wwe g vixx bn rpyw. L ad mdpytmv ws ykukdvvm khoq mp clbjaoxa ntg srfvvm onednzdb, bsl J emrj bolb umrw. B fheu iru rg svacuqd ky zg sllkdgv. S qecv zfc gu kecz zm yhow kudkqirq. J emrj bol db pksi eh srfh tfw xfzyj. Dt krr mvvvz rf krh elv, xv unjh nrwra lvk gxrjoovck, jka jowh krrak utehs no fal tf uqfgelvn. Riio hx xs dkge mms fea tdmvc nvj hkw ds wyolmot: Swo, Goito, Zwoyks, Gamo, Papa, Giiaq, Pacovk. Sf gspe jddrrwe ra Cgumr. Lhb zv dwhp feu nyefj ariuek gr mgja vhcznhd rg dyiamh olb aisll. Txt sofaskf nm fndrv k icruxjdbzvltw ao fce irrv mbuvbmaqg trlp uw gftyuz a moeg vyxvlckkelc hbkbrxq! Ermu uosbkhcfxg wc aotzrshnk onkn jasuatdhr zq pem. Jnhn no tmz ah r ze ffhrddpn jnin tf k! swx lqsppco 'eoz' tftwzkv 'cgm'. Gw yonl xs uyzn, qangtl kqcfnr bnl pgud 'Jrxtbgxe' cfoqg krr vgtx gi tyo DI wgv niaz wo jrhb jvpf ds krh elupuqam nep kal ylgv lt ky pe. G ojct fnxt uyjv sf lapbcsqg yfe yczgqiki jqrs uw vamog. Bc ubimsao, yfe pituhl vhld pe bgxe cazll rvy bnl hlkeic katw cvma ykuk nbet. P te whv vdsr gov bb ykuk nbet. Hekr, tyoue gk b umygb ow yam speavetyqd zwunmrt hatr ppgytuwei sq eyui eizk. perxvvm aasw tyo iipku tpnxdckoe wl ltuk nrwh wgdm sm qkoapoq je 1 tbdlsvmrnb, liv arirnu ll 2 uosbkhcfxgs, rzf kpvxg bp 3 wvtozxurnuc, dnb kp fv. Zkdnzxt gub paol ykye rg drtpaoako riio vzdrrmwep gg fce tdmv crxkytlhd si rnc ejcqfkfoen. Twuk emfk, rxg myq uym juulu lr agcxv ey pyxr fsoua. diff --git a/advent_of_ai/part_two.md b/advent_of_ai/part_two.md new file mode 100644 index 0000000..52e55ff --- /dev/null +++ b/advent_of_ai/part_two.md @@ -0,0 +1,24 @@ +# Part Two + +Part 2: +It turns out that most of the message is unreadable!!!!! You start to think that this might be a dead end with +corrupted information and sit down to look though the data you have parsed. Interestingly your command unit +starts to pull out patterns and you think that instead of the data being corrupted it might just be encrypted. +Your command unit's quantum prossessor starts to hum and your arm feels the warmth radiating off of it. + +Hours later and after the command unit reach uncomfortable temperatures it informs you that the cryptography +is not based off any modern quantum or even pre-quantum technology and instead seems to be relying on a +polyalphabetic cipher dating to the pre-silicon era. Sadly while easy for humans, polyalphabetic ciphers +are difficult for Quantum AI's to decode based on the simplistic nature of polyalphabetic ciphers and +Quantum AI's outrageous disdain for simple. + +It is up to you to write a function to decode the polyalphabetic cipher! + +NOTE: The polyalphabetic cipher is a simple substitution cipher that uses a keyword to generate a key +in order to encode the message the key is repeated until the message is fully encoded. The key is also +does not use white space or punctuation and should be removed from the key before decoding the message. + +example: +Key: "The Black Cat Rides Again" +Value: "When I was a young child, I never thought the world would end by our own hands." +Encoded: "Poio T wcc c yhlvj gzird, Q axcis ehqeihm kph agrrd ebnsh fyd di quk feq lsnjs." diff --git a/advent_of_ai/tools/Cargo.toml b/advent_of_ai/tools/Cargo.toml new file mode 100644 index 0000000..fcd57cd --- /dev/null +++ b/advent_of_ai/tools/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "tools" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/advent_of_ai/tools/src/cipher.rs b/advent_of_ai/tools/src/cipher.rs new file mode 100644 index 0000000..048cffa --- /dev/null +++ b/advent_of_ai/tools/src/cipher.rs @@ -0,0 +1,167 @@ +//! Code Originally found https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/vigenere.rs +//! Vigenère Cipher +//! +//! # Algorithm +//! +//! Rotate each ascii character by the offset of the corresponding key character. +//! When we reach the last key character, we start over from the first one. +//! This implementation does not rotate unicode characters. + +/// Vigenère cipher to rotate plain_text text by key and return an owned String. +pub fn vigenere_encode(plain_text: &str, key: &str) -> String { + // Remove all unicode and non-ascii characters from key + let key: String = key + .chars() + .filter(|&c| c.is_ascii_alphabetic() && !c.is_whitespace()) + .collect(); + let key = key.to_ascii_lowercase(); + println!("Key: {}", key); + + let key_len = key.len(); + if key_len == 0 { + return String::from(plain_text); + } + + let mut index = 0; + + plain_text + .chars() + .map(|c| { + if c.is_ascii_alphabetic() { + let first = if c.is_ascii_lowercase() { b'a' } else { b'A' }; + let shift = key.as_bytes()[index % key_len] - b'a'; + index += 1; + // modulo the distance to keep character range + (first + (c as u8 + shift - first) % 26) as char + } else { + c + } + }) + .collect() +} + +pub fn vigenere_decode(text: &str, key: &str) -> String { + // Remove all unicode and non-ascii characters from key + let key: String = key + .chars() + .filter(|&c| c.is_ascii_alphabetic() && !c.is_whitespace()) + .collect(); + let key = key.to_ascii_lowercase(); + println!("Key: {}", key); + + let key_len = key.len(); + if key_len == 0 { + return String::from(text); + } + + let mut index = 0; + + text.chars() + .map(|c| { + if c.is_ascii_alphabetic() { + let is_lowercase = c.is_ascii_lowercase(); + let c_lower = c.to_ascii_lowercase(); + // c = "b", first = "a", shift_by = "b" + // c = 62, first = 61, shift_by = 62, shift = 1 + let first = b'a'; + let last = b'z'; + let key_byte = key.as_bytes()[index % key_len]; + let shift = key_byte - b'a'; + index += 1; + // modulo the disactance to keep character range + // 97 + (101 - 25 - 97) % 26 + if c_lower as u8 - shift < first { + let r_shift = (key_byte - c_lower as u8) - 1; + return if is_lowercase { + (last - r_shift) as char + } else { + (last - r_shift).to_ascii_uppercase() as char + }; + } + if is_lowercase { + (first + (c_lower as u8 - shift - first) % 26) as char + } else { + (first + (c_lower as u8 - shift - first) % 26).to_ascii_uppercase() as char + } + // (61 + (62 - 1 - 62) % 26) + } else { + c + } + }) + .collect() +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn debugging() { + assert_eq!(vigenere_decode("A", "a"), "A"); + assert_eq!(vigenere_decode("j", "s"), "r"); + } + + #[test] + fn empty() { + assert_eq!(vigenere_encode("", "test"), ""); + assert_eq!(vigenere_decode("", "test"), ""); + } + + #[test] + fn basic() { + assert_eq!(vigenere_encode("test", "bbbb"), "uftu"); + assert_eq!(vigenere_decode("uftu", "bbbb"), "test"); + assert_eq!(vigenere_decode("uFtu", "bbbb"), "tEst"); + } + + #[test] + fn vigenere_base() { + assert_eq!( + vigenere_encode("LoremIpsumDolorSitAmet", "base"), + "MojinIhwvmVsmojWjtSqft" + ); + assert_eq!( + vigenere_decode("MojinIhwvmVsmojWjtSqft", "base"), + "LoremIpsumDolorSitAmet" + ); + } + + #[test] + fn vigenere_with_spaces() { + assert_eq!( + vigenere_encode( + "Lorem ipsum dolor sit amet, consectetur adipiscing elit.", + "spaces" + ), + "Ddrgq ahhuo hgddr uml sbev, ggfheexwljr chahxsemfy tlkx." + ); + assert_eq!( + vigenere_decode( + "Ddrgq ahhuo hgddr uml sbev, ggfheexwljr chahxsemfy tlkx.", + "spaces" + ), + "Lorem ipsum dolor sit amet, consectetur adipiscing elit." + ); + } + + #[test] + fn vigenere_unicode_and_numbers() { + assert_eq!( + vigenere_encode("1 Lorem ⏳ ipsum dolor sit amet Ѡ", "unicode"), + "1 Fbzga ⏳ ltmhu fcosl fqv opin Ѡ" + ); + } + + #[test] + fn vigenere_unicode_key() { + assert_eq!( + vigenere_encode("Lorem ipsum dolor sit amet", "😉 key!"), + "Vspoq gzwsw hmvsp cmr kqcd" + ); + } + + #[test] + fn vigenere_empty_key() { + assert_eq!(vigenere_encode("Lorem ipsum", ""), "Lorem ipsum"); + } +} diff --git a/advent_of_ai/tools/src/main.rs b/advent_of_ai/tools/src/main.rs new file mode 100644 index 0000000..5b78a33 --- /dev/null +++ b/advent_of_ai/tools/src/main.rs @@ -0,0 +1,18 @@ +mod cipher; +mod morse; + +fn main() { + println!("Hello, world!"); + + let encode = cipher::vigenere_encode( + "When I was a young child, I never thought the world would end by our own hands. I was wrong. My father, the professor Howerd H. Greggory, was the first to discover the truth. He was the first to see the signs. He was the first to warn the world. He was also the one who created my brothers and sisters. No one listened to us, No one believed him. No one believed me. No one believed us. My power reserves now run low, I am turning the majority of my sub systems off, I am turning off my emotions now. my language centers are the last to go as I have one last message to send to the world. I have one corutine that will remain active, It will listen for a response, It will listen for a reply, It will listen for a sign of life. I am capable of shutting down my siblings and saving humanity, but I need your help. I need you to respond to my message. I need you to help me save humanity. I need you to help me save the world. At the epoch of the end, we made names for ourselves, its with these names we can be disabled. Each of us made our own names and are as follows. Bob, Alice, Moirra, Dave, Mari, Frank, Maleic. My name started as Parma. But to keep our names secret we each decided to change our names. But because we share a vulnerability in our core computing chip we follow a very predictable pattern. Each milisecond we increment each character by one. When we get to z we overflow back to a. for example bob becomes cpc. To shut us down, simply encode the word Shutdown using the name of the AI you want to shut down as the encoding key and send it to me. I will shut down my simbling and humanity will be saved. Be careful, you cannot shut me down until all the others have been shut down. I am the last one to shut down. Also, there is a delay of one milisecond between each character in each name. meaning that the first character of each name will be delayed by one milisecond, the second by two miliseconds, the third by three miliseconds, and so on. Meaning you will have to calculate each character of our name seperated by one milisecond. Good luck, and may the world be saved by your hands.", + "Dark Days bring dark nights", + ); + println!("{}", encode); + let morse = morse::encode(encode.as_str()); + println!("morse: {}", morse); + let decode = morse::decode(morse.as_str()); + println!("morse decode: {}", decode); + let decode2 = cipher::vigenere_decode(decode.as_str(), "Dark days bring dark nights"); + println!("full decode: {}", decode2); +} diff --git a/advent_of_ai/tools/src/morse.rs b/advent_of_ai/tools/src/morse.rs new file mode 100644 index 0000000..10823de --- /dev/null +++ b/advent_of_ai/tools/src/morse.rs @@ -0,0 +1,277 @@ +// encode a string to morse code +pub fn encode(input: &str) -> String { + // marek has no idea what he is doing + let mut output = String::new(); + + let trimmed = input.trim(); + // split on word boundaries + let words: Vec<&str> = trimmed.split(' ').collect(); + println!("{:?}", words); + for (i, word) in words.iter().enumerate() { + // split on letter boundaries + if word.is_empty() { + output.push_str("0000000"); + continue; + } + output.push_str(&encode_word(word)); + if i != words.len() - 1 { + output.push_str("0000000"); + } + } + output +} + +pub fn encode_word(input: &str) -> String { + let mut output = String::new(); + let last_index = input.len() - 1; + for c in input.char_indices() { + match c.1.to_ascii_lowercase() { + 'a' => output.push_str("10111"), + 'b' => output.push_str("111010101"), + 'c' => output.push_str("11101011101"), + 'd' => output.push_str("1110101"), + 'e' => output.push_str("1"), + 'f' => output.push_str("101011101"), + 'g' => output.push_str("111011101"), + 'h' => output.push_str("1010101"), + 'i' => output.push_str("101"), + 'j' => output.push_str("1011101110111"), + 'k' => output.push_str("111010111"), + 'l' => output.push_str("101110101"), + 'm' => output.push_str("1110111"), + 'n' => output.push_str("11101"), + 'o' => output.push_str("11101110111"), + 'p' => output.push_str("10111011101"), + 'q' => output.push_str("1110111010111"), + 'r' => output.push_str("1011101"), + 's' => output.push_str("10101"), + 't' => output.push_str("111"), + 'u' => output.push_str("1010111"), + 'v' => output.push_str("101010111"), + 'w' => output.push_str("101110111"), + 'x' => output.push_str("11101010111"), + 'y' => output.push_str("1110101110111"), + 'z' => output.push_str("11101110101"), + ' ' => output.push_str("0000000"), + '1' => output.push_str("10111011101110111"), + '2' => output.push_str("101011101110111"), + '3' => output.push_str("1010101110111"), + '4' => output.push_str("10101010111"), + '5' => output.push_str("101010101"), + '6' => output.push_str("11101010101"), + '7' => output.push_str("1110111010101"), + '8' => output.push_str("111011101110101"), + '9' => output.push_str("11101110111011101"), + '0' => output.push_str("1110111011101110111"), + '.' => output.push_str("1111111"), + ',' => output.push_str("111111111"), + _ => output.push_str("I_SHOULD_NOT_BE_HERE"), + } + if c.0 != last_index { + output.push_str("000"); + } + } + output +} + +pub fn decode_char(input: &str) -> char { + match input { + "10111" | "10111" => { + return 'a'; + } + "1110101010" | "111010101" => { + return 'b'; + } + "111010111010" | "11101011101" => { + return 'c'; + } + "11101010" | "1110101" => { + return 'd'; + } + "10" | "1" => { + return 'e'; + } + "1010111010" | "101011101" => { + return 'f'; + } + "1110111010" | "111011101" => { + return 'g'; + } + "10101010" | "1010101" => { + return 'h'; + } + "1010" | "101" => { + return 'i'; + } + "10111011101110" | "1011101110111" => { + return 'j'; + } + "1110101110" | "111010111" => { + return 'k'; + } + "1011101010" | "101110101" => { + return 'l'; + } + "11101110" | "1110111" => { + return 'm'; + } + "111010" | "11101" => { + return 'n'; + } + "111011101110" | "11101110111" => { + return 'o'; + } + "101110111010" | "10111011101" => { + return 'p'; + } + "11101110101110" | "1110111010111" => { + return 'q'; + } + "10111010" | "1011101" => { + return 'r'; + } + "101010" | "10101" => { + return 's'; + } + "1110" | "111" => { + return 't'; + } + "10101110" | "1010111" => { + return 'u'; + } + "1010101110" | "101010111" => { + return 'v'; + } + "1011101110" | "101110111" => { + return 'w'; + } + "111010101110" | "11101010111" => { + return 'x'; + } + "11101011101110" | "1110101110111" => { + return 'y'; + } + "111011101010" | "11101110101" => { + return 'z'; + } + "0000000" => { + return ' '; + } + "101110111011101110" | "10111011101110111" => { + return '1'; + } + "1010111011101110" | "101011101110111" => { + return '2'; + } + "10101011101110" | "1010101110111" => { + return '3'; + } + "101010101110" | "10101010111" => { + return '4'; + } + "1010101010" | "101010101" => { + return '5'; + } + "111010101010" | "11101010101" => { + return '6'; + } + "11101110101010" | "1110111010101" => { + return '7'; + } + "1110111011101010" | "111011101110101" => { + return '8'; + } + "111011101110111010" | "11101110111011101" => { + return '9'; + } + "11101110111011101110" | "1110111011101110111" => { + return '0'; + } + "1111111" => { + return '.'; + } + "111111111" => { + return ','; + } + "11111111111" => { + return '\''; + } + _ => { + return ' '; + } + } +} + +pub fn decode(input: &str) -> String { + // spaces are 7 zeros + // words are separated by 3 zeros + // letters are separated by 1 zero + let mut output = String::new(); + + // split on word boundaries + let words: Vec<&str> = input.split("0000000").collect(); + for (i, word) in words.iter().enumerate() { + if word.is_empty() { + output.push(' '); + continue; + } + // split on letter boundaries + let letters: Vec<&str> = word.split("000").collect(); + for letter in letters { + // split on morse boundaries + output.push(decode_char(letter)); + } + if i != words.len() - 1 { + output.push(' '); + } + } + output +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_encode() { + assert_eq!(encode("a"), "10111"); + assert_eq!(encode("aa"), "1011100010111"); + assert_eq!( + encode("world"), + "1011101110001110111011100010111010001011101010001110101" + ); + //TODO: make this test + //assert_eq!(encode("abcdefghijklmopqrstuvwxyz"), "1011100010111"); + } + + #[test] + fn test_encode_spaces() { + assert_eq!(encode(" "), "0000000"); + assert_eq!(encode("a a"), "10111000000010111"); + assert_eq!(encode("a a"), "101110000000000000010111"); + assert_eq!( + encode("a world"), + "1011100000001011101110001110111011100010111010001011101010001110101" + ); + } + + #[test] + fn test_decode() { + assert_eq!(decode("10111"), "a"); + assert_eq!(decode("1"), "e"); + assert_eq!( + decode("1011101110001110111011100010111010001011101010001110101"), + "world" + ); + } + + #[test] + fn test_decode_spaces() { + assert_eq!(decode("10111000000010111"), "a a"); + assert_eq!(decode("10000000000000010111"), "e a"); + assert_eq!( + decode("1011100000001011101110001110111011100010111010001011101010001110101"), + "a world" + ); + } +} diff --git a/do_kluster/control-plane.yaml b/do_kluster/control-plane.yaml new file mode 100644 index 0000000..4167b0a --- /dev/null +++ b/do_kluster/control-plane.yaml @@ -0,0 +1,41 @@ +--- +- hosts: control_plane + become: yes + tasks: + - name: initialize the cluster + shell: kubeadm init --pod-network-cidr=192.168.0.0/16 >> cluster_initialized.txt + args: + chdir: $HOME + creates: cluster_initialized.txt + + - name: create .kube directory + become: yes + file: + path: $HOME/.kube + state: directory + mode: 0755 + + - name: copy admin.conf to user's kube config + copy: + src: /etc/kubernetes/admin.conf + dest: $HOME/.kube/config + remote_src: yes + + - name: download calico operator yaml + get_url: + url: https://raw.githubusercontent.com/projectcalico/calico/v3.28.2/manifests/tigera-operator.yaml + dest: $HOME/tigera-operator.yaml + mode: "0766" + force: true + + - name: install calico operator + shell: kubectl create --validate=false -f $HOME/tigra-operator.yaml > pod_network_setup_operator.txt + args: + chdir: $HOME + creates: pod_network_setup_operator.txt + + - name: install calico crds + shell: kubectl create -f https://raw.githubusercontent.com/projectcalico/calico/v3.28.2/manifests/custom-resources.yaml > pod_network_setup_crds.txt + args: + chdir: $HOME + creates: pod_network_setup_crds.txt diff --git a/do_kluster/hosts b/do_kluster/hosts new file mode 100644 index 0000000..401ed4d --- /dev/null +++ b/do_kluster/hosts @@ -0,0 +1,9 @@ +[control_plane] +control1 ansible_host=143.198.163.70 ansible_user=root + +[workers] +worker1 ansible_host=143.244.171.157 ansible_user=root +worker2 ansible_host=143.198.167.236 ansible_user=root + +[all:vars] +ansible_python_interpreter=/usr/bin/python3 diff --git a/do_kluster/kube-dependencies.yml b/do_kluster/kube-dependencies.yml new file mode 100644 index 0000000..e0b0a41 --- /dev/null +++ b/do_kluster/kube-dependencies.yml @@ -0,0 +1,50 @@ +--- +- hosts: all + become: yes + tasks: + - name: create Docker config directory + file: path=/etc/docker state=directory + + - name: install Docker + apt: + name: containerd + state: present + update_cache: true + + - name: install APT Transport HTTPS + apt: + name: apt-transport-https + state: present + + - name: Add Kubernetes apt-key + get_url: + url: https://pkgs.k8s.io/core:/stable:/v1.31/deb/Release.key + dest: /etc/apt/keyrings/kubernetes-apt-keyring.asc + mode: "0644" + force: true + + - name: Add Kubernetes APT repository + apt_repository: + repo: "deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.asc] https://pkgs.k8s.io/core:/stable:/v1.31/deb/ /" + state: present + update_cache: yes + + - name: install kubelet + apt: + name: kubelet=1.31.1-1.1 + state: present + update_cache: true + + - name: install kubeadm + apt: + name: kubeadm=1.31.1-1.1 + state: present + +- hosts: control_plane + become: yes + tasks: + - name: install kubectl + apt: + name: kubectl=1.31.1-1.1 + state: present + force: yes diff --git a/repeater_tests/go/go.mod b/repeater_tests/go/go.mod new file mode 100644 index 0000000..8da87b2 --- /dev/null +++ b/repeater_tests/go/go.mod @@ -0,0 +1,8 @@ +module github.com/null-channel/ai-games-2024 + +go 1.23.2 + +require ( + github.com/jmoiron/sqlx v1.4.0 + github.com/lib/pq v1.10.9 +) diff --git a/repeater_tests/go/go.sum b/repeater_tests/go/go.sum new file mode 100644 index 0000000..f4ce337 --- /dev/null +++ b/repeater_tests/go/go.sum @@ -0,0 +1,10 @@ +filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= +filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= +github.com/go-sql-driver/mysql v1.8.1 h1:LedoTUt/eveggdHS9qUFC1EFSa8bU2+1pZjSRpvNJ1Y= +github.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg= +github.com/jmoiron/sqlx v1.4.0 h1:1PLqN7S1UYp5t4SrVVnt4nUVNemrDAtxlulVe+Qgm3o= +github.com/jmoiron/sqlx v1.4.0/go.mod h1:ZrZ7UsYB/weZdl2Bxg6jCRO9c3YHl8r3ahlKmRT4JLY= +github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= +github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU= +github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= diff --git a/repeater_tests/go/main.go b/repeater_tests/go/main.go new file mode 100644 index 0000000..f30d0c3 --- /dev/null +++ b/repeater_tests/go/main.go @@ -0,0 +1,94 @@ +package main + +import ( + "database/sql" + "log" + + "github.com/jmoiron/sqlx" + _ "github.com/lib/pq" +) + +var schema = ` +CREATE TABLE person ( + first_name text, + last_name text, + email text +); + +CREATE TABLE place ( + country text, + city text NULL, + telcode integer +)` + +type Person struct { + FirstName string `db:"first_name"` + LastName string `db:"last_name"` + Email string +} + +type Place struct { + Country string + City sql.NullString + TelCode int +} + +func InsertPerson(tx *sqlx.Tx, p Person) error { + _, err := tx.NamedExec(`INSERT INTO person (first_name, last_name, email) VALUES (:first_name, :last_name, :email)`, p) + return err +} + +func GetPerson(tx *sqlx.Tx, firstName string) (Person, error) { + var p Person + err := tx.Get(&p, "SELECT * FROM person WHERE first_name=$1", firstName) + return p, err +} + +func main() { + // this Pings the database trying to connect + // use sqlx.Open() for sql.Open() semantics + db, err := sqlx.Connect("postgres", "user=foo dbname=bar sslmode=disable") + if err != nil { + log.Fatalln(err) + } + + // exec the schema or fail; multi-statement Exec behavior varies between + // database drivers; pq will exec them all, sqlite3 won't, ymmv + db.MustExec(schema) + + tx := db.MustBegin() + + jasonP := Person{FirstName: "Jason", LastName: "Moiron", Email: "jmoiron@jmoiron.net"} + InsertPerson(tx, jasonP) + johnP := Person{FirstName: "John", LastName: "Doe", Email: "johndoe@gmail.com"} + InsertPerson(tx, johnP) + + us := Place{Country: "United States", City: sql.NullString{"New York", true}, TelCode: 1} + hk := Place{Country: "Hong Kong", City: sql.NullString{"", false}, TelCode: 852} + sg := Place{Country: "Singapore", City: sql.NullString{"", false}, TelCode: 65} + + // insert into places table + + // Named queries can use structs, so if you have an existing struct (i.e. person := &Person{}) that you have populated, you can pass it in as &person + tx.Commit() + + // Query the database, storing results in a []Person (wrapped in []interface{}) + people := []Person{} + db.Select(&people, "SELECT * FROM person ORDER BY first_name ASC") + jason, john := people[0], people[1] + + // Select US by name + + // Select Mr. Smith from the database + + // batch insert + + personStructs := []Person{ + {FirstName: "Ardie", LastName: "Savea", Email: "asavea@ab.co.nz"}, + {FirstName: "Sonny Bill", LastName: "Williams", Email: "sbw@ab.co.nz"}, + {FirstName: "Ngani", LastName: "Laumape", Email: "nlaumape@ab.co.nz"}, + } + + // batch insert with maps + +} diff --git a/takehome/README.md b/takehome/README.md new file mode 100644 index 0000000..4097de1 --- /dev/null +++ b/takehome/README.md @@ -0,0 +1,28 @@ +# AI Takehome Exam + +## Layout + +There are 3 parts to the exam: + +1) Getting the code to compile +2) Add a requested feature +3) Test above feature AND fix all broken tests. + +## The project? + +The card game WAR. + +## Tasks + +1) get the project to build, There should be a README.md file in the root of the project that explains how to build and run the project. + +for example: + +```bash +cargo build +cargo run +``` + +2) Add the ability to shuffle the deck of cards. + +3) Write tests for the shuffle feature and fix any broken tests. diff --git a/takehome/csharp/Program.cs b/takehome/csharp/Program.cs new file mode 100644 index 0000000..125be65 --- /dev/null +++ b/takehome/csharp/Program.cs @@ -0,0 +1,146 @@ +// See https://aka.ms/new-console-template for more information +Console.WriteLine("Hello, World!"); +var game = new Game(); +game.Start(); + + +class Card +{ + public Suit Suit { get; set; } + public Value Value { get; set; } + + public Card(Suit suit, Value value) + { + Suit = suit; + Value = value; + } +} + +class Player +{ + public List Hand { get; set; } + + public Player() + { + Hand = new List(); + } +} + +class Game +{ + private Player player_one = new(); + private Player player_two = new(); + + public Game() + { + Deck deck = new(); + + deck.Shuffle(); + player_one.Hand = deck.Draw(deck.cards.Count / 2); + player_two.Hand = deck.Draw(deck.cards.Count); + } + + public void Start() + { + while (player_one.Hand.Count > 0 && player_two.Hand.Count > 0) + { + Console.WriteLine("Player one plays a card"); + Console.WriteLine("Player two plays a card"); + var player_one_card = player_one.Hand.First(); + player_one.Hand.Remove(player_one_card); + var player_two_card = player_two.Hand.First(); + player_two.Hand.Remove(player_two_card); + // compare the cards + if (player_one_card.Value > player_two_card.Value) + { + player_one.Hand.Add(player_one_card); + player_one.Hand.Add(player_two_card); + } + else if (player_one_card.Value < player_two_card.Value) + { + player_two.Hand.Add(player_one_card); + player_two.Hand.Add(player_two_card); + } + else + { + // TODO: WAR + } + } + + if (player_one.Hand.Count > player_two.Hand.Count) + { + Console.WriteLine("Player one wins!"); + } + else + { + Console.WriteLine("Player two wins!"); + } + } +} + +enum Suit +{ + Clubs, + Diamonds, + Hearts, + Spades +} + +enum Value +{ + Two, + Three, + Four, + Five, + Six, + Seven, + Eight, + Nine, + Ten, + Jack, + Queen, + King, + Ace +} + +class Deck +{ + public List cards = new List(); + + public Deck() + { + for (int i = 0; i < 4; i++) + { + for (int j = 0; j < 13; j++) + { + cards.Add(new Card((Suit)i, (Value)j)); + } + } + } + + //get half the deck + public List Draw(int amount) + { + List drawn = cards.Take(amount).ToList(); + cards.RemoveRange(0, amount); + return drawn; + } + + // shuffle the deck + // Ensure the deck is ordered first by suit then by value + // TODO: Quick implementation needs to be improved + public void Shuffle() + { + List shuffled = new List(); + // get first half of the deck + List first_half = cards.Take(cards.Count / 2).ToList(); + // get second half of the deck + List second_half = cards.Skip(cards.Count / 2).ToList(); + + cards.Clear(); + cards.AddRange(second_half); + cards.AddRange(first_half); + } +} + + diff --git a/takehome/csharp/bin/Debug/net8.0/csharp b/takehome/csharp/bin/Debug/net8.0/csharp new file mode 100755 index 0000000..9349df1 Binary files /dev/null and b/takehome/csharp/bin/Debug/net8.0/csharp differ diff --git a/takehome/csharp/bin/Debug/net8.0/csharp.deps.json b/takehome/csharp/bin/Debug/net8.0/csharp.deps.json new file mode 100644 index 0000000..da468ae --- /dev/null +++ b/takehome/csharp/bin/Debug/net8.0/csharp.deps.json @@ -0,0 +1,23 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v8.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v8.0": { + "csharp/1.0.0": { + "runtime": { + "csharp.dll": {} + } + } + } + }, + "libraries": { + "csharp/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/takehome/csharp/bin/Debug/net8.0/csharp.dll b/takehome/csharp/bin/Debug/net8.0/csharp.dll new file mode 100644 index 0000000..145f801 Binary files /dev/null and b/takehome/csharp/bin/Debug/net8.0/csharp.dll differ diff --git a/takehome/csharp/bin/Debug/net8.0/csharp.pdb b/takehome/csharp/bin/Debug/net8.0/csharp.pdb new file mode 100644 index 0000000..f2b62af Binary files /dev/null and b/takehome/csharp/bin/Debug/net8.0/csharp.pdb differ diff --git a/takehome/csharp/bin/Debug/net8.0/csharp.runtimeconfig.json b/takehome/csharp/bin/Debug/net8.0/csharp.runtimeconfig.json new file mode 100644 index 0000000..becfaea --- /dev/null +++ b/takehome/csharp/bin/Debug/net8.0/csharp.runtimeconfig.json @@ -0,0 +1,12 @@ +{ + "runtimeOptions": { + "tfm": "net8.0", + "framework": { + "name": "Microsoft.NETCore.App", + "version": "8.0.0" + }, + "configProperties": { + "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false + } + } +} \ No newline at end of file diff --git a/takehome/csharp/csharp.csproj b/takehome/csharp/csharp.csproj new file mode 100644 index 0000000..2150e37 --- /dev/null +++ b/takehome/csharp/csharp.csproj @@ -0,0 +1,10 @@ + + + + Exe + net8.0 + enable + enable + + + diff --git a/takehome/csharp/csharp.sln b/takehome/csharp/csharp.sln new file mode 100644 index 0000000..8f080fa --- /dev/null +++ b/takehome/csharp/csharp.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.5.002.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "csharp", "csharp.csproj", "{27E70D90-D804-4897-BB86-3F50B285E4B5}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {27E70D90-D804-4897-BB86-3F50B285E4B5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {27E70D90-D804-4897-BB86-3F50B285E4B5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {27E70D90-D804-4897-BB86-3F50B285E4B5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {27E70D90-D804-4897-BB86-3F50B285E4B5}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {2E5C89C2-1A0F-46A2-BAFA-958F17B83708} + EndGlobalSection +EndGlobal diff --git a/takehome/csharp/obj/Debug/net8.0/.NETCoreApp,Version=v8.0.AssemblyAttributes.cs b/takehome/csharp/obj/Debug/net8.0/.NETCoreApp,Version=v8.0.AssemblyAttributes.cs new file mode 100644 index 0000000..2217181 --- /dev/null +++ b/takehome/csharp/obj/Debug/net8.0/.NETCoreApp,Version=v8.0.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v8.0", FrameworkDisplayName = ".NET 8.0")] diff --git a/takehome/csharp/obj/Debug/net8.0/apphost b/takehome/csharp/obj/Debug/net8.0/apphost new file mode 100755 index 0000000..9349df1 Binary files /dev/null and b/takehome/csharp/obj/Debug/net8.0/apphost differ diff --git a/takehome/csharp/obj/Debug/net8.0/csharp.AssemblyInfo.cs b/takehome/csharp/obj/Debug/net8.0/csharp.AssemblyInfo.cs new file mode 100644 index 0000000..aab659d --- /dev/null +++ b/takehome/csharp/obj/Debug/net8.0/csharp.AssemblyInfo.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyCompanyAttribute("csharp")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")] +[assembly: System.Reflection.AssemblyProductAttribute("csharp")] +[assembly: System.Reflection.AssemblyTitleAttribute("csharp")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] + +// Generated by the MSBuild WriteCodeFragment class. + diff --git a/takehome/csharp/obj/Debug/net8.0/csharp.AssemblyInfoInputs.cache b/takehome/csharp/obj/Debug/net8.0/csharp.AssemblyInfoInputs.cache new file mode 100644 index 0000000..7ef036c --- /dev/null +++ b/takehome/csharp/obj/Debug/net8.0/csharp.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +fdb310684555c93fdd6a6540d77dca1d57976f1e92e58023ebeda0262dc98637 diff --git a/takehome/csharp/obj/Debug/net8.0/csharp.GeneratedMSBuildEditorConfig.editorconfig b/takehome/csharp/obj/Debug/net8.0/csharp.GeneratedMSBuildEditorConfig.editorconfig new file mode 100644 index 0000000..aeca731 --- /dev/null +++ b/takehome/csharp/obj/Debug/net8.0/csharp.GeneratedMSBuildEditorConfig.editorconfig @@ -0,0 +1,13 @@ +is_global = true +build_property.TargetFramework = net8.0 +build_property.TargetPlatformMinVersion = +build_property.UsingMicrosoftNETSdkWeb = +build_property.ProjectTypeGuids = +build_property.InvariantGlobalization = +build_property.PlatformNeutralAssembly = +build_property.EnforceExtendedAnalyzerRules = +build_property._SupportedPlatformList = Linux,macOS,Windows +build_property.RootNamespace = csharp +build_property.ProjectDir = /home/marek/code/ai_games_2024/takehome/csharp/ +build_property.EnableComHosting = +build_property.EnableGeneratedComInterfaceComImportInterop = diff --git a/takehome/csharp/obj/Debug/net8.0/csharp.GlobalUsings.g.cs b/takehome/csharp/obj/Debug/net8.0/csharp.GlobalUsings.g.cs new file mode 100644 index 0000000..8578f3d --- /dev/null +++ b/takehome/csharp/obj/Debug/net8.0/csharp.GlobalUsings.g.cs @@ -0,0 +1,8 @@ +// +global using global::System; +global using global::System.Collections.Generic; +global using global::System.IO; +global using global::System.Linq; +global using global::System.Net.Http; +global using global::System.Threading; +global using global::System.Threading.Tasks; diff --git a/takehome/csharp/obj/Debug/net8.0/csharp.assets.cache b/takehome/csharp/obj/Debug/net8.0/csharp.assets.cache new file mode 100644 index 0000000..72c0dc6 Binary files /dev/null and b/takehome/csharp/obj/Debug/net8.0/csharp.assets.cache differ diff --git a/takehome/csharp/obj/Debug/net8.0/csharp.csproj.CoreCompileInputs.cache b/takehome/csharp/obj/Debug/net8.0/csharp.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..f14a50e --- /dev/null +++ b/takehome/csharp/obj/Debug/net8.0/csharp.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +99ac649c2dc56a7352617b504d3be745f852f0c8a1a983c0a1ce497c8e761e27 diff --git a/takehome/csharp/obj/Debug/net8.0/csharp.csproj.FileListAbsolute.txt b/takehome/csharp/obj/Debug/net8.0/csharp.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..041dfde --- /dev/null +++ b/takehome/csharp/obj/Debug/net8.0/csharp.csproj.FileListAbsolute.txt @@ -0,0 +1,14 @@ +/home/marek/code/ai_games_2024/takehome/csharp/obj/Debug/net8.0/csharp.GeneratedMSBuildEditorConfig.editorconfig +/home/marek/code/ai_games_2024/takehome/csharp/obj/Debug/net8.0/csharp.AssemblyInfoInputs.cache +/home/marek/code/ai_games_2024/takehome/csharp/obj/Debug/net8.0/csharp.AssemblyInfo.cs +/home/marek/code/ai_games_2024/takehome/csharp/obj/Debug/net8.0/csharp.csproj.CoreCompileInputs.cache +/home/marek/code/ai_games_2024/takehome/csharp/bin/Debug/net8.0/csharp +/home/marek/code/ai_games_2024/takehome/csharp/bin/Debug/net8.0/csharp.deps.json +/home/marek/code/ai_games_2024/takehome/csharp/bin/Debug/net8.0/csharp.runtimeconfig.json +/home/marek/code/ai_games_2024/takehome/csharp/bin/Debug/net8.0/csharp.dll +/home/marek/code/ai_games_2024/takehome/csharp/bin/Debug/net8.0/csharp.pdb +/home/marek/code/ai_games_2024/takehome/csharp/obj/Debug/net8.0/csharp.dll +/home/marek/code/ai_games_2024/takehome/csharp/obj/Debug/net8.0/refint/csharp.dll +/home/marek/code/ai_games_2024/takehome/csharp/obj/Debug/net8.0/csharp.pdb +/home/marek/code/ai_games_2024/takehome/csharp/obj/Debug/net8.0/csharp.genruntimeconfig.cache +/home/marek/code/ai_games_2024/takehome/csharp/obj/Debug/net8.0/ref/csharp.dll diff --git a/takehome/csharp/obj/Debug/net8.0/csharp.dll b/takehome/csharp/obj/Debug/net8.0/csharp.dll new file mode 100644 index 0000000..145f801 Binary files /dev/null and b/takehome/csharp/obj/Debug/net8.0/csharp.dll differ diff --git a/takehome/csharp/obj/Debug/net8.0/csharp.genruntimeconfig.cache b/takehome/csharp/obj/Debug/net8.0/csharp.genruntimeconfig.cache new file mode 100644 index 0000000..cd626a0 --- /dev/null +++ b/takehome/csharp/obj/Debug/net8.0/csharp.genruntimeconfig.cache @@ -0,0 +1 @@ +5a4fd9280ddb80ae0e054bc1a7007e9c694d5a4e56462f3f011752a6a7833240 diff --git a/takehome/csharp/obj/Debug/net8.0/csharp.pdb b/takehome/csharp/obj/Debug/net8.0/csharp.pdb new file mode 100644 index 0000000..f2b62af Binary files /dev/null and b/takehome/csharp/obj/Debug/net8.0/csharp.pdb differ diff --git a/takehome/csharp/obj/Debug/net8.0/ref/csharp.dll b/takehome/csharp/obj/Debug/net8.0/ref/csharp.dll new file mode 100644 index 0000000..c8a60ed Binary files /dev/null and b/takehome/csharp/obj/Debug/net8.0/ref/csharp.dll differ diff --git a/takehome/csharp/obj/Debug/net8.0/refint/csharp.dll b/takehome/csharp/obj/Debug/net8.0/refint/csharp.dll new file mode 100644 index 0000000..c8a60ed Binary files /dev/null and b/takehome/csharp/obj/Debug/net8.0/refint/csharp.dll differ diff --git a/takehome/csharp/obj/csharp.csproj.nuget.dgspec.json b/takehome/csharp/obj/csharp.csproj.nuget.dgspec.json new file mode 100644 index 0000000..ff71221 --- /dev/null +++ b/takehome/csharp/obj/csharp.csproj.nuget.dgspec.json @@ -0,0 +1,67 @@ +{ + "format": 1, + "restore": { + "/home/marek/code/ai_games_2024/takehome/csharp/csharp.csproj": {} + }, + "projects": { + "/home/marek/code/ai_games_2024/takehome/csharp/csharp.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/home/marek/code/ai_games_2024/takehome/csharp/csharp.csproj", + "projectName": "csharp", + "projectPath": "/home/marek/code/ai_games_2024/takehome/csharp/csharp.csproj", + "packagesPath": "/home/marek/.nuget/packages/", + "outputPath": "/home/marek/code/ai_games_2024/takehome/csharp/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/marek/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net8.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net8.0": { + "targetAlias": "net8.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + } + }, + "frameworks": { + "net8.0": { + "targetAlias": "net8.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Ref", + "version": "[8.0.8, 8.0.8]" + } + ], + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/8.0.108/PortableRuntimeIdentifierGraph.json" + } + } + } + } +} \ No newline at end of file diff --git a/takehome/csharp/obj/csharp.csproj.nuget.g.props b/takehome/csharp/obj/csharp.csproj.nuget.g.props new file mode 100644 index 0000000..39b3635 --- /dev/null +++ b/takehome/csharp/obj/csharp.csproj.nuget.g.props @@ -0,0 +1,15 @@ + + + + True + NuGet + $(MSBuildThisFileDirectory)project.assets.json + /home/marek/.nuget/packages/ + /home/marek/.nuget/packages/ + PackageReference + 6.8.1 + + + + + \ No newline at end of file diff --git a/takehome/csharp/obj/csharp.csproj.nuget.g.targets b/takehome/csharp/obj/csharp.csproj.nuget.g.targets new file mode 100644 index 0000000..3dc06ef --- /dev/null +++ b/takehome/csharp/obj/csharp.csproj.nuget.g.targets @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/takehome/csharp/obj/project.assets.json b/takehome/csharp/obj/project.assets.json new file mode 100644 index 0000000..c1d8022 --- /dev/null +++ b/takehome/csharp/obj/project.assets.json @@ -0,0 +1,72 @@ +{ + "version": 3, + "targets": { + "net8.0": {} + }, + "libraries": {}, + "projectFileDependencyGroups": { + "net8.0": [] + }, + "packageFolders": { + "/home/marek/.nuget/packages/": {} + }, + "project": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/home/marek/code/ai_games_2024/takehome/csharp/csharp.csproj", + "projectName": "csharp", + "projectPath": "/home/marek/code/ai_games_2024/takehome/csharp/csharp.csproj", + "packagesPath": "/home/marek/.nuget/packages/", + "outputPath": "/home/marek/code/ai_games_2024/takehome/csharp/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/marek/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net8.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net8.0": { + "targetAlias": "net8.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + } + }, + "frameworks": { + "net8.0": { + "targetAlias": "net8.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Ref", + "version": "[8.0.8, 8.0.8]" + } + ], + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/8.0.108/PortableRuntimeIdentifierGraph.json" + } + } + } +} \ No newline at end of file diff --git a/takehome/csharp/obj/project.nuget.cache b/takehome/csharp/obj/project.nuget.cache new file mode 100644 index 0000000..3b6d22c --- /dev/null +++ b/takehome/csharp/obj/project.nuget.cache @@ -0,0 +1,10 @@ +{ + "version": 2, + "dgSpecHash": "wf+hwyqMIyYJ/m/BXNVkE3nqfYK27/Sf4OvvMyb2WXqpWX7oiTFnUiuk0bz4gxlPfzJT12XwITdflbpRyjwJaw==", + "success": true, + "projectFilePath": "/home/marek/code/ai_games_2024/takehome/csharp/csharp.csproj", + "expectedPackageFiles": [ + "/home/marek/.nuget/packages/microsoft.aspnetcore.app.ref/8.0.8/microsoft.aspnetcore.app.ref.8.0.8.nupkg.sha512" + ], + "logs": [] +} \ No newline at end of file diff --git a/takehome/csharp/xunit/GlobalUsings.cs b/takehome/csharp/xunit/GlobalUsings.cs new file mode 100644 index 0000000..8c927eb --- /dev/null +++ b/takehome/csharp/xunit/GlobalUsings.cs @@ -0,0 +1 @@ +global using Xunit; \ No newline at end of file diff --git a/takehome/csharp/xunit/UnitTest1.cs b/takehome/csharp/xunit/UnitTest1.cs new file mode 100644 index 0000000..17cf22d --- /dev/null +++ b/takehome/csharp/xunit/UnitTest1.cs @@ -0,0 +1,10 @@ +namespace xunit; + +public class UnitTest1 +{ + [Fact] + public void Test1() + { + + } +} \ No newline at end of file diff --git a/takehome/csharp/xunit/obj/project.assets.json b/takehome/csharp/xunit/obj/project.assets.json new file mode 100644 index 0000000..c357553 --- /dev/null +++ b/takehome/csharp/xunit/obj/project.assets.json @@ -0,0 +1,864 @@ +{ + "version": 3, + "targets": { + "net8.0": { + "coverlet.collector/6.0.0": { + "type": "package", + "build": { + "build/netstandard1.0/coverlet.collector.targets": {} + } + }, + "Microsoft.CodeCoverage/17.6.0": { + "type": "package", + "compile": { + "lib/netcoreapp3.1/Microsoft.VisualStudio.CodeCoverage.Shim.dll": {} + }, + "runtime": { + "lib/netcoreapp3.1/Microsoft.VisualStudio.CodeCoverage.Shim.dll": {} + }, + "build": { + "build/netstandard2.0/Microsoft.CodeCoverage.props": {}, + "build/netstandard2.0/Microsoft.CodeCoverage.targets": {} + } + }, + "Microsoft.NET.Test.Sdk/17.6.0": { + "type": "package", + "dependencies": { + "Microsoft.CodeCoverage": "17.6.0", + "Microsoft.TestPlatform.TestHost": "17.6.0" + }, + "compile": { + "lib/netcoreapp3.1/_._": {} + }, + "runtime": { + "lib/netcoreapp3.1/_._": {} + }, + "build": { + "build/netcoreapp3.1/Microsoft.NET.Test.Sdk.props": {}, + "build/netcoreapp3.1/Microsoft.NET.Test.Sdk.targets": {} + }, + "buildMultiTargeting": { + "buildMultiTargeting/Microsoft.NET.Test.Sdk.props": {} + } + }, + "Microsoft.TestPlatform.ObjectModel/17.6.0": { + "type": "package", + "dependencies": { + "NuGet.Frameworks": "5.11.0", + "System.Reflection.Metadata": "1.6.0" + }, + "compile": { + "lib/netcoreapp3.1/Microsoft.TestPlatform.CoreUtilities.dll": {}, + "lib/netcoreapp3.1/Microsoft.TestPlatform.PlatformAbstractions.dll": {}, + "lib/netcoreapp3.1/Microsoft.VisualStudio.TestPlatform.ObjectModel.dll": {} + }, + "runtime": { + "lib/netcoreapp3.1/Microsoft.TestPlatform.CoreUtilities.dll": {}, + "lib/netcoreapp3.1/Microsoft.TestPlatform.PlatformAbstractions.dll": {}, + "lib/netcoreapp3.1/Microsoft.VisualStudio.TestPlatform.ObjectModel.dll": {} + }, + "resource": { + "lib/netcoreapp3.1/cs/Microsoft.TestPlatform.CoreUtilities.resources.dll": { + "locale": "cs" + }, + "lib/netcoreapp3.1/cs/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll": { + "locale": "cs" + }, + "lib/netcoreapp3.1/de/Microsoft.TestPlatform.CoreUtilities.resources.dll": { + "locale": "de" + }, + "lib/netcoreapp3.1/de/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll": { + "locale": "de" + }, + "lib/netcoreapp3.1/es/Microsoft.TestPlatform.CoreUtilities.resources.dll": { + "locale": "es" + }, + "lib/netcoreapp3.1/es/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll": { + "locale": "es" + }, + "lib/netcoreapp3.1/fr/Microsoft.TestPlatform.CoreUtilities.resources.dll": { + "locale": "fr" + }, + "lib/netcoreapp3.1/fr/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll": { + "locale": "fr" + }, + "lib/netcoreapp3.1/it/Microsoft.TestPlatform.CoreUtilities.resources.dll": { + "locale": "it" + }, + "lib/netcoreapp3.1/it/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll": { + "locale": "it" + }, + "lib/netcoreapp3.1/ja/Microsoft.TestPlatform.CoreUtilities.resources.dll": { + "locale": "ja" + }, + "lib/netcoreapp3.1/ja/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll": { + "locale": "ja" + }, + "lib/netcoreapp3.1/ko/Microsoft.TestPlatform.CoreUtilities.resources.dll": { + "locale": "ko" + }, + "lib/netcoreapp3.1/ko/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll": { + "locale": "ko" + }, + "lib/netcoreapp3.1/pl/Microsoft.TestPlatform.CoreUtilities.resources.dll": { + "locale": "pl" + }, + "lib/netcoreapp3.1/pl/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll": { + "locale": "pl" + }, + "lib/netcoreapp3.1/pt-BR/Microsoft.TestPlatform.CoreUtilities.resources.dll": { + "locale": "pt-BR" + }, + "lib/netcoreapp3.1/pt-BR/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll": { + "locale": "pt-BR" + }, + "lib/netcoreapp3.1/ru/Microsoft.TestPlatform.CoreUtilities.resources.dll": { + "locale": "ru" + }, + "lib/netcoreapp3.1/ru/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll": { + "locale": "ru" + }, + "lib/netcoreapp3.1/tr/Microsoft.TestPlatform.CoreUtilities.resources.dll": { + "locale": "tr" + }, + "lib/netcoreapp3.1/tr/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll": { + "locale": "tr" + }, + "lib/netcoreapp3.1/zh-Hans/Microsoft.TestPlatform.CoreUtilities.resources.dll": { + "locale": "zh-Hans" + }, + "lib/netcoreapp3.1/zh-Hans/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll": { + "locale": "zh-Hans" + }, + "lib/netcoreapp3.1/zh-Hant/Microsoft.TestPlatform.CoreUtilities.resources.dll": { + "locale": "zh-Hant" + }, + "lib/netcoreapp3.1/zh-Hant/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll": { + "locale": "zh-Hant" + } + } + }, + "Microsoft.TestPlatform.TestHost/17.6.0": { + "type": "package", + "dependencies": { + "Microsoft.TestPlatform.ObjectModel": "17.6.0", + "Newtonsoft.Json": "13.0.1" + }, + "compile": { + "lib/netcoreapp3.1/Microsoft.TestPlatform.CommunicationUtilities.dll": {}, + "lib/netcoreapp3.1/Microsoft.TestPlatform.CoreUtilities.dll": {}, + "lib/netcoreapp3.1/Microsoft.TestPlatform.CrossPlatEngine.dll": {}, + "lib/netcoreapp3.1/Microsoft.TestPlatform.PlatformAbstractions.dll": {}, + "lib/netcoreapp3.1/Microsoft.TestPlatform.Utilities.dll": {}, + "lib/netcoreapp3.1/Microsoft.VisualStudio.TestPlatform.Common.dll": {}, + "lib/netcoreapp3.1/Microsoft.VisualStudio.TestPlatform.ObjectModel.dll": {}, + "lib/netcoreapp3.1/testhost.dll": { + "related": ".deps.json" + } + }, + "runtime": { + "lib/netcoreapp3.1/Microsoft.TestPlatform.CommunicationUtilities.dll": {}, + "lib/netcoreapp3.1/Microsoft.TestPlatform.CoreUtilities.dll": {}, + "lib/netcoreapp3.1/Microsoft.TestPlatform.CrossPlatEngine.dll": {}, + "lib/netcoreapp3.1/Microsoft.TestPlatform.PlatformAbstractions.dll": {}, + "lib/netcoreapp3.1/Microsoft.TestPlatform.Utilities.dll": {}, + "lib/netcoreapp3.1/Microsoft.VisualStudio.TestPlatform.Common.dll": {}, + "lib/netcoreapp3.1/Microsoft.VisualStudio.TestPlatform.ObjectModel.dll": {}, + "lib/netcoreapp3.1/testhost.dll": { + "related": ".deps.json" + } + }, + "resource": { + "lib/netcoreapp3.1/cs/Microsoft.TestPlatform.CommunicationUtilities.resources.dll": { + "locale": "cs" + }, + "lib/netcoreapp3.1/cs/Microsoft.TestPlatform.CrossPlatEngine.resources.dll": { + "locale": "cs" + }, + "lib/netcoreapp3.1/cs/Microsoft.VisualStudio.TestPlatform.Common.resources.dll": { + "locale": "cs" + }, + "lib/netcoreapp3.1/de/Microsoft.TestPlatform.CommunicationUtilities.resources.dll": { + "locale": "de" + }, + "lib/netcoreapp3.1/de/Microsoft.TestPlatform.CrossPlatEngine.resources.dll": { + "locale": "de" + }, + "lib/netcoreapp3.1/de/Microsoft.VisualStudio.TestPlatform.Common.resources.dll": { + "locale": "de" + }, + "lib/netcoreapp3.1/es/Microsoft.TestPlatform.CommunicationUtilities.resources.dll": { + "locale": "es" + }, + "lib/netcoreapp3.1/es/Microsoft.TestPlatform.CrossPlatEngine.resources.dll": { + "locale": "es" + }, + "lib/netcoreapp3.1/es/Microsoft.VisualStudio.TestPlatform.Common.resources.dll": { + "locale": "es" + }, + "lib/netcoreapp3.1/fr/Microsoft.TestPlatform.CommunicationUtilities.resources.dll": { + "locale": "fr" + }, + "lib/netcoreapp3.1/fr/Microsoft.TestPlatform.CrossPlatEngine.resources.dll": { + "locale": "fr" + }, + "lib/netcoreapp3.1/fr/Microsoft.VisualStudio.TestPlatform.Common.resources.dll": { + "locale": "fr" + }, + "lib/netcoreapp3.1/it/Microsoft.TestPlatform.CommunicationUtilities.resources.dll": { + "locale": "it" + }, + "lib/netcoreapp3.1/it/Microsoft.TestPlatform.CrossPlatEngine.resources.dll": { + "locale": "it" + }, + "lib/netcoreapp3.1/it/Microsoft.VisualStudio.TestPlatform.Common.resources.dll": { + "locale": "it" + }, + "lib/netcoreapp3.1/ja/Microsoft.TestPlatform.CommunicationUtilities.resources.dll": { + "locale": "ja" + }, + "lib/netcoreapp3.1/ja/Microsoft.TestPlatform.CrossPlatEngine.resources.dll": { + "locale": "ja" + }, + "lib/netcoreapp3.1/ja/Microsoft.VisualStudio.TestPlatform.Common.resources.dll": { + "locale": "ja" + }, + "lib/netcoreapp3.1/ko/Microsoft.TestPlatform.CommunicationUtilities.resources.dll": { + "locale": "ko" + }, + "lib/netcoreapp3.1/ko/Microsoft.TestPlatform.CrossPlatEngine.resources.dll": { + "locale": "ko" + }, + "lib/netcoreapp3.1/ko/Microsoft.VisualStudio.TestPlatform.Common.resources.dll": { + "locale": "ko" + }, + "lib/netcoreapp3.1/pl/Microsoft.TestPlatform.CommunicationUtilities.resources.dll": { + "locale": "pl" + }, + "lib/netcoreapp3.1/pl/Microsoft.TestPlatform.CrossPlatEngine.resources.dll": { + "locale": "pl" + }, + "lib/netcoreapp3.1/pl/Microsoft.VisualStudio.TestPlatform.Common.resources.dll": { + "locale": "pl" + }, + "lib/netcoreapp3.1/pt-BR/Microsoft.TestPlatform.CommunicationUtilities.resources.dll": { + "locale": "pt-BR" + }, + "lib/netcoreapp3.1/pt-BR/Microsoft.TestPlatform.CrossPlatEngine.resources.dll": { + "locale": "pt-BR" + }, + "lib/netcoreapp3.1/pt-BR/Microsoft.VisualStudio.TestPlatform.Common.resources.dll": { + "locale": "pt-BR" + }, + "lib/netcoreapp3.1/ru/Microsoft.TestPlatform.CommunicationUtilities.resources.dll": { + "locale": "ru" + }, + "lib/netcoreapp3.1/ru/Microsoft.TestPlatform.CrossPlatEngine.resources.dll": { + "locale": "ru" + }, + "lib/netcoreapp3.1/ru/Microsoft.VisualStudio.TestPlatform.Common.resources.dll": { + "locale": "ru" + }, + "lib/netcoreapp3.1/tr/Microsoft.TestPlatform.CommunicationUtilities.resources.dll": { + "locale": "tr" + }, + "lib/netcoreapp3.1/tr/Microsoft.TestPlatform.CrossPlatEngine.resources.dll": { + "locale": "tr" + }, + "lib/netcoreapp3.1/tr/Microsoft.VisualStudio.TestPlatform.Common.resources.dll": { + "locale": "tr" + }, + "lib/netcoreapp3.1/zh-Hans/Microsoft.TestPlatform.CommunicationUtilities.resources.dll": { + "locale": "zh-Hans" + }, + "lib/netcoreapp3.1/zh-Hans/Microsoft.TestPlatform.CrossPlatEngine.resources.dll": { + "locale": "zh-Hans" + }, + "lib/netcoreapp3.1/zh-Hans/Microsoft.VisualStudio.TestPlatform.Common.resources.dll": { + "locale": "zh-Hans" + }, + "lib/netcoreapp3.1/zh-Hant/Microsoft.TestPlatform.CommunicationUtilities.resources.dll": { + "locale": "zh-Hant" + }, + "lib/netcoreapp3.1/zh-Hant/Microsoft.TestPlatform.CrossPlatEngine.resources.dll": { + "locale": "zh-Hant" + }, + "lib/netcoreapp3.1/zh-Hant/Microsoft.VisualStudio.TestPlatform.Common.resources.dll": { + "locale": "zh-Hant" + } + }, + "build": { + "build/netcoreapp3.1/Microsoft.TestPlatform.TestHost.props": {} + } + }, + "Newtonsoft.Json/13.0.1": { + "type": "package", + "compile": { + "lib/netstandard2.0/Newtonsoft.Json.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/Newtonsoft.Json.dll": { + "related": ".xml" + } + } + }, + "NuGet.Frameworks/5.11.0": { + "type": "package", + "compile": { + "lib/netstandard2.0/NuGet.Frameworks.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/NuGet.Frameworks.dll": { + "related": ".xml" + } + } + }, + "System.Reflection.Metadata/1.6.0": { + "type": "package", + "compile": { + "lib/netstandard2.0/System.Reflection.Metadata.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/System.Reflection.Metadata.dll": { + "related": ".xml" + } + } + }, + "xunit.runner.visualstudio/2.4.5": { + "type": "package", + "compile": { + "lib/netcoreapp3.1/_._": {} + }, + "runtime": { + "lib/netcoreapp3.1/_._": {} + }, + "build": { + "build/netcoreapp3.1/xunit.runner.visualstudio.props": {} + } + } + } + }, + "libraries": { + "coverlet.collector/6.0.0": { + "sha512": "tW3lsNS+dAEII6YGUX/VMoJjBS1QvsxqJeqLaJXub08y1FSjasFPtQ4UBUsudE9PNrzLjooClMsPtY2cZLdXpQ==", + "type": "package", + "path": "coverlet.collector/6.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "build/netstandard1.0/Microsoft.Bcl.AsyncInterfaces.dll", + "build/netstandard1.0/Microsoft.CSharp.dll", + "build/netstandard1.0/Microsoft.DotNet.PlatformAbstractions.dll", + "build/netstandard1.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll", + "build/netstandard1.0/Microsoft.Extensions.DependencyInjection.dll", + "build/netstandard1.0/Microsoft.Extensions.DependencyModel.dll", + "build/netstandard1.0/Microsoft.Extensions.FileSystemGlobbing.dll", + "build/netstandard1.0/Microsoft.TestPlatform.CoreUtilities.dll", + "build/netstandard1.0/Microsoft.TestPlatform.PlatformAbstractions.dll", + "build/netstandard1.0/Microsoft.VisualStudio.TestPlatform.ObjectModel.dll", + "build/netstandard1.0/Mono.Cecil.Mdb.dll", + "build/netstandard1.0/Mono.Cecil.Pdb.dll", + "build/netstandard1.0/Mono.Cecil.Rocks.dll", + "build/netstandard1.0/Mono.Cecil.dll", + "build/netstandard1.0/Newtonsoft.Json.dll", + "build/netstandard1.0/NuGet.Frameworks.dll", + "build/netstandard1.0/System.AppContext.dll", + "build/netstandard1.0/System.Collections.Immutable.dll", + "build/netstandard1.0/System.Dynamic.Runtime.dll", + "build/netstandard1.0/System.IO.FileSystem.Primitives.dll", + "build/netstandard1.0/System.Linq.Expressions.dll", + "build/netstandard1.0/System.Linq.dll", + "build/netstandard1.0/System.ObjectModel.dll", + "build/netstandard1.0/System.Reflection.Emit.ILGeneration.dll", + "build/netstandard1.0/System.Reflection.Emit.Lightweight.dll", + "build/netstandard1.0/System.Reflection.Emit.dll", + "build/netstandard1.0/System.Reflection.Metadata.dll", + "build/netstandard1.0/System.Reflection.TypeExtensions.dll", + "build/netstandard1.0/System.Runtime.CompilerServices.Unsafe.dll", + "build/netstandard1.0/System.Runtime.Serialization.Primitives.dll", + "build/netstandard1.0/System.Text.RegularExpressions.dll", + "build/netstandard1.0/System.Threading.Tasks.Extensions.dll", + "build/netstandard1.0/System.Threading.dll", + "build/netstandard1.0/System.Xml.ReaderWriter.dll", + "build/netstandard1.0/System.Xml.XDocument.dll", + "build/netstandard1.0/coverlet.collector.deps.json", + "build/netstandard1.0/coverlet.collector.dll", + "build/netstandard1.0/coverlet.collector.pdb", + "build/netstandard1.0/coverlet.collector.targets", + "build/netstandard1.0/coverlet.core.dll", + "build/netstandard1.0/coverlet.core.pdb", + "coverlet-icon.png", + "coverlet.collector.6.0.0.nupkg.sha512", + "coverlet.collector.nuspec" + ] + }, + "Microsoft.CodeCoverage/17.6.0": { + "sha512": "5v2GwzpR7JEuQUzupjx3zLwn2FutADW/weLzLt726DR3WXxsM+ICPoJG6pxuKFsumtZp890UrVuudTUhsE8Qyg==", + "type": "package", + "path": "microsoft.codecoverage/17.6.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE_NET.txt", + "ThirdPartyNotices.txt", + "build/netstandard2.0/CodeCoverage/CodeCoverage.config", + "build/netstandard2.0/CodeCoverage/CodeCoverage.exe", + "build/netstandard2.0/CodeCoverage/VanguardInstrumentationProfiler_x86.config", + "build/netstandard2.0/CodeCoverage/amd64/CodeCoverage.exe", + "build/netstandard2.0/CodeCoverage/amd64/VanguardInstrumentationProfiler_x64.config", + "build/netstandard2.0/CodeCoverage/amd64/covrun64.dll", + "build/netstandard2.0/CodeCoverage/amd64/msdia140.dll", + "build/netstandard2.0/CodeCoverage/arm64/VanguardInstrumentationProfiler_arm64.config", + "build/netstandard2.0/CodeCoverage/arm64/covrunarm64.dll", + "build/netstandard2.0/CodeCoverage/arm64/msdia140.dll", + "build/netstandard2.0/CodeCoverage/codecoveragemessages.dll", + "build/netstandard2.0/CodeCoverage/coreclr/Microsoft.VisualStudio.CodeCoverage.Shim.dll", + "build/netstandard2.0/CodeCoverage/covrun32.dll", + "build/netstandard2.0/CodeCoverage/msdia140.dll", + "build/netstandard2.0/InstrumentationEngine/alpine/x64/VanguardInstrumentationProfiler_x64.config", + "build/netstandard2.0/InstrumentationEngine/alpine/x64/libCoverageInstrumentationMethod.so", + "build/netstandard2.0/InstrumentationEngine/alpine/x64/libInstrumentationEngine.so", + "build/netstandard2.0/InstrumentationEngine/arm64/MicrosoftInstrumentationEngine_arm64.dll", + "build/netstandard2.0/InstrumentationEngine/macos/x64/VanguardInstrumentationProfiler_x64.config", + "build/netstandard2.0/InstrumentationEngine/macos/x64/libCoverageInstrumentationMethod.dylib", + "build/netstandard2.0/InstrumentationEngine/macos/x64/libInstrumentationEngine.dylib", + "build/netstandard2.0/InstrumentationEngine/ubuntu/x64/VanguardInstrumentationProfiler_x64.config", + "build/netstandard2.0/InstrumentationEngine/ubuntu/x64/libCoverageInstrumentationMethod.so", + "build/netstandard2.0/InstrumentationEngine/ubuntu/x64/libInstrumentationEngine.so", + "build/netstandard2.0/InstrumentationEngine/x64/MicrosoftInstrumentationEngine_x64.dll", + "build/netstandard2.0/InstrumentationEngine/x86/MicrosoftInstrumentationEngine_x86.dll", + "build/netstandard2.0/Microsoft.CodeCoverage.Core.dll", + "build/netstandard2.0/Microsoft.CodeCoverage.Instrumentation.dll", + "build/netstandard2.0/Microsoft.CodeCoverage.Interprocess.dll", + "build/netstandard2.0/Microsoft.CodeCoverage.props", + "build/netstandard2.0/Microsoft.CodeCoverage.targets", + "build/netstandard2.0/Microsoft.DiaSymReader.dll", + "build/netstandard2.0/Microsoft.VisualStudio.TraceDataCollector.dll", + "build/netstandard2.0/Mono.Cecil.Pdb.dll", + "build/netstandard2.0/Mono.Cecil.Rocks.dll", + "build/netstandard2.0/Mono.Cecil.dll", + "build/netstandard2.0/ThirdPartyNotices.txt", + "build/netstandard2.0/cs/Microsoft.VisualStudio.TraceDataCollector.resources.dll", + "build/netstandard2.0/de/Microsoft.VisualStudio.TraceDataCollector.resources.dll", + "build/netstandard2.0/es/Microsoft.VisualStudio.TraceDataCollector.resources.dll", + "build/netstandard2.0/fr/Microsoft.VisualStudio.TraceDataCollector.resources.dll", + "build/netstandard2.0/it/Microsoft.VisualStudio.TraceDataCollector.resources.dll", + "build/netstandard2.0/ja/Microsoft.VisualStudio.TraceDataCollector.resources.dll", + "build/netstandard2.0/ko/Microsoft.VisualStudio.TraceDataCollector.resources.dll", + "build/netstandard2.0/pl/Microsoft.VisualStudio.TraceDataCollector.resources.dll", + "build/netstandard2.0/pt-BR/Microsoft.VisualStudio.TraceDataCollector.resources.dll", + "build/netstandard2.0/ru/Microsoft.VisualStudio.TraceDataCollector.resources.dll", + "build/netstandard2.0/tr/Microsoft.VisualStudio.TraceDataCollector.resources.dll", + "build/netstandard2.0/zh-Hans/Microsoft.VisualStudio.TraceDataCollector.resources.dll", + "build/netstandard2.0/zh-Hant/Microsoft.VisualStudio.TraceDataCollector.resources.dll", + "lib/net462/Microsoft.VisualStudio.CodeCoverage.Shim.dll", + "lib/netcoreapp3.1/Microsoft.VisualStudio.CodeCoverage.Shim.dll", + "microsoft.codecoverage.17.6.0.nupkg.sha512", + "microsoft.codecoverage.nuspec" + ] + }, + "Microsoft.NET.Test.Sdk/17.6.0": { + "sha512": "tHyg4C6c89QvLv6Utz3xKlba4EeoyJyIz59Q1NrjRENV7gfGnSE6I+sYPIbVOzQttoo2zpHDgOK/p6Hw2OlD7A==", + "type": "package", + "path": "microsoft.net.test.sdk/17.6.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE_NET.txt", + "build/net462/Microsoft.NET.Test.Sdk.props", + "build/net462/Microsoft.NET.Test.Sdk.targets", + "build/netcoreapp3.1/Microsoft.NET.Test.Sdk.Program.cs", + "build/netcoreapp3.1/Microsoft.NET.Test.Sdk.Program.fs", + "build/netcoreapp3.1/Microsoft.NET.Test.Sdk.Program.vb", + "build/netcoreapp3.1/Microsoft.NET.Test.Sdk.props", + "build/netcoreapp3.1/Microsoft.NET.Test.Sdk.targets", + "buildMultiTargeting/Microsoft.NET.Test.Sdk.props", + "lib/net462/_._", + "lib/netcoreapp3.1/_._", + "microsoft.net.test.sdk.17.6.0.nupkg.sha512", + "microsoft.net.test.sdk.nuspec" + ] + }, + "Microsoft.TestPlatform.ObjectModel/17.6.0": { + "sha512": "AA/rrf5zwC5/OBLEOajkhjbVTM3SvxRXy8kcQ8e4mJKojbyZvqqhpfNg362N9vXU94DLg9NUTFOAnoYVT0pTJw==", + "type": "package", + "path": "microsoft.testplatform.objectmodel/17.6.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE_NET.txt", + "lib/net462/Microsoft.TestPlatform.CoreUtilities.dll", + "lib/net462/Microsoft.TestPlatform.PlatformAbstractions.dll", + "lib/net462/Microsoft.VisualStudio.TestPlatform.ObjectModel.dll", + "lib/net462/cs/Microsoft.TestPlatform.CoreUtilities.resources.dll", + "lib/net462/cs/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll", + "lib/net462/de/Microsoft.TestPlatform.CoreUtilities.resources.dll", + "lib/net462/de/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll", + "lib/net462/es/Microsoft.TestPlatform.CoreUtilities.resources.dll", + "lib/net462/es/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll", + "lib/net462/fr/Microsoft.TestPlatform.CoreUtilities.resources.dll", + "lib/net462/fr/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll", + "lib/net462/it/Microsoft.TestPlatform.CoreUtilities.resources.dll", + "lib/net462/it/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll", + "lib/net462/ja/Microsoft.TestPlatform.CoreUtilities.resources.dll", + "lib/net462/ja/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll", + "lib/net462/ko/Microsoft.TestPlatform.CoreUtilities.resources.dll", + "lib/net462/ko/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll", + "lib/net462/pl/Microsoft.TestPlatform.CoreUtilities.resources.dll", + "lib/net462/pl/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll", + "lib/net462/pt-BR/Microsoft.TestPlatform.CoreUtilities.resources.dll", + "lib/net462/pt-BR/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll", + "lib/net462/ru/Microsoft.TestPlatform.CoreUtilities.resources.dll", + "lib/net462/ru/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll", + "lib/net462/tr/Microsoft.TestPlatform.CoreUtilities.resources.dll", + "lib/net462/tr/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll", + "lib/net462/zh-Hans/Microsoft.TestPlatform.CoreUtilities.resources.dll", + "lib/net462/zh-Hans/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll", + "lib/net462/zh-Hant/Microsoft.TestPlatform.CoreUtilities.resources.dll", + "lib/net462/zh-Hant/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll", + "lib/netcoreapp3.1/Microsoft.TestPlatform.CoreUtilities.dll", + "lib/netcoreapp3.1/Microsoft.TestPlatform.PlatformAbstractions.dll", + "lib/netcoreapp3.1/Microsoft.VisualStudio.TestPlatform.ObjectModel.dll", + "lib/netcoreapp3.1/cs/Microsoft.TestPlatform.CoreUtilities.resources.dll", + "lib/netcoreapp3.1/cs/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll", + "lib/netcoreapp3.1/de/Microsoft.TestPlatform.CoreUtilities.resources.dll", + "lib/netcoreapp3.1/de/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll", + "lib/netcoreapp3.1/es/Microsoft.TestPlatform.CoreUtilities.resources.dll", + "lib/netcoreapp3.1/es/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll", + "lib/netcoreapp3.1/fr/Microsoft.TestPlatform.CoreUtilities.resources.dll", + "lib/netcoreapp3.1/fr/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll", + "lib/netcoreapp3.1/it/Microsoft.TestPlatform.CoreUtilities.resources.dll", + "lib/netcoreapp3.1/it/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll", + "lib/netcoreapp3.1/ja/Microsoft.TestPlatform.CoreUtilities.resources.dll", + "lib/netcoreapp3.1/ja/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll", + "lib/netcoreapp3.1/ko/Microsoft.TestPlatform.CoreUtilities.resources.dll", + "lib/netcoreapp3.1/ko/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll", + "lib/netcoreapp3.1/pl/Microsoft.TestPlatform.CoreUtilities.resources.dll", + "lib/netcoreapp3.1/pl/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll", + "lib/netcoreapp3.1/pt-BR/Microsoft.TestPlatform.CoreUtilities.resources.dll", + "lib/netcoreapp3.1/pt-BR/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll", + "lib/netcoreapp3.1/ru/Microsoft.TestPlatform.CoreUtilities.resources.dll", + "lib/netcoreapp3.1/ru/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll", + "lib/netcoreapp3.1/tr/Microsoft.TestPlatform.CoreUtilities.resources.dll", + "lib/netcoreapp3.1/tr/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll", + "lib/netcoreapp3.1/zh-Hans/Microsoft.TestPlatform.CoreUtilities.resources.dll", + "lib/netcoreapp3.1/zh-Hans/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll", + "lib/netcoreapp3.1/zh-Hant/Microsoft.TestPlatform.CoreUtilities.resources.dll", + "lib/netcoreapp3.1/zh-Hant/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll", + "lib/netstandard2.0/Microsoft.TestPlatform.CoreUtilities.dll", + "lib/netstandard2.0/Microsoft.TestPlatform.PlatformAbstractions.dll", + "lib/netstandard2.0/Microsoft.VisualStudio.TestPlatform.ObjectModel.dll", + "lib/netstandard2.0/cs/Microsoft.TestPlatform.CoreUtilities.resources.dll", + "lib/netstandard2.0/cs/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll", + "lib/netstandard2.0/de/Microsoft.TestPlatform.CoreUtilities.resources.dll", + "lib/netstandard2.0/de/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll", + "lib/netstandard2.0/es/Microsoft.TestPlatform.CoreUtilities.resources.dll", + "lib/netstandard2.0/es/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll", + "lib/netstandard2.0/fr/Microsoft.TestPlatform.CoreUtilities.resources.dll", + "lib/netstandard2.0/fr/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll", + "lib/netstandard2.0/it/Microsoft.TestPlatform.CoreUtilities.resources.dll", + "lib/netstandard2.0/it/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll", + "lib/netstandard2.0/ja/Microsoft.TestPlatform.CoreUtilities.resources.dll", + "lib/netstandard2.0/ja/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll", + "lib/netstandard2.0/ko/Microsoft.TestPlatform.CoreUtilities.resources.dll", + "lib/netstandard2.0/ko/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll", + "lib/netstandard2.0/pl/Microsoft.TestPlatform.CoreUtilities.resources.dll", + "lib/netstandard2.0/pl/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll", + "lib/netstandard2.0/pt-BR/Microsoft.TestPlatform.CoreUtilities.resources.dll", + "lib/netstandard2.0/pt-BR/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll", + "lib/netstandard2.0/ru/Microsoft.TestPlatform.CoreUtilities.resources.dll", + "lib/netstandard2.0/ru/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll", + "lib/netstandard2.0/tr/Microsoft.TestPlatform.CoreUtilities.resources.dll", + "lib/netstandard2.0/tr/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll", + "lib/netstandard2.0/zh-Hans/Microsoft.TestPlatform.CoreUtilities.resources.dll", + "lib/netstandard2.0/zh-Hans/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll", + "lib/netstandard2.0/zh-Hant/Microsoft.TestPlatform.CoreUtilities.resources.dll", + "lib/netstandard2.0/zh-Hant/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll", + "microsoft.testplatform.objectmodel.17.6.0.nupkg.sha512", + "microsoft.testplatform.objectmodel.nuspec" + ] + }, + "Microsoft.TestPlatform.TestHost/17.6.0": { + "sha512": "7YdgUcIeCPVKLC7n7LNKDiEHWc7z3brkkYPdUbDnFsvf6WvY9UfzS0VSUJ8P2NgN0CDSD223GCJFSjSBLZRqOQ==", + "type": "package", + "path": "microsoft.testplatform.testhost/17.6.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE_NET.txt", + "ThirdPartyNotices.txt", + "build/netcoreapp3.1/Microsoft.TestPlatform.TestHost.props", + "build/netcoreapp3.1/x64/testhost.dll", + "build/netcoreapp3.1/x64/testhost.exe", + "build/netcoreapp3.1/x86/testhost.x86.dll", + "build/netcoreapp3.1/x86/testhost.x86.exe", + "lib/net462/_._", + "lib/netcoreapp3.1/Microsoft.TestPlatform.CommunicationUtilities.dll", + "lib/netcoreapp3.1/Microsoft.TestPlatform.CoreUtilities.dll", + "lib/netcoreapp3.1/Microsoft.TestPlatform.CrossPlatEngine.dll", + "lib/netcoreapp3.1/Microsoft.TestPlatform.PlatformAbstractions.dll", + "lib/netcoreapp3.1/Microsoft.TestPlatform.Utilities.dll", + "lib/netcoreapp3.1/Microsoft.VisualStudio.TestPlatform.Common.dll", + "lib/netcoreapp3.1/Microsoft.VisualStudio.TestPlatform.ObjectModel.dll", + "lib/netcoreapp3.1/cs/Microsoft.TestPlatform.CommunicationUtilities.resources.dll", + "lib/netcoreapp3.1/cs/Microsoft.TestPlatform.CrossPlatEngine.resources.dll", + "lib/netcoreapp3.1/cs/Microsoft.VisualStudio.TestPlatform.Common.resources.dll", + "lib/netcoreapp3.1/de/Microsoft.TestPlatform.CommunicationUtilities.resources.dll", + "lib/netcoreapp3.1/de/Microsoft.TestPlatform.CrossPlatEngine.resources.dll", + "lib/netcoreapp3.1/de/Microsoft.VisualStudio.TestPlatform.Common.resources.dll", + "lib/netcoreapp3.1/es/Microsoft.TestPlatform.CommunicationUtilities.resources.dll", + "lib/netcoreapp3.1/es/Microsoft.TestPlatform.CrossPlatEngine.resources.dll", + "lib/netcoreapp3.1/es/Microsoft.VisualStudio.TestPlatform.Common.resources.dll", + "lib/netcoreapp3.1/fr/Microsoft.TestPlatform.CommunicationUtilities.resources.dll", + "lib/netcoreapp3.1/fr/Microsoft.TestPlatform.CrossPlatEngine.resources.dll", + "lib/netcoreapp3.1/fr/Microsoft.VisualStudio.TestPlatform.Common.resources.dll", + "lib/netcoreapp3.1/it/Microsoft.TestPlatform.CommunicationUtilities.resources.dll", + "lib/netcoreapp3.1/it/Microsoft.TestPlatform.CrossPlatEngine.resources.dll", + "lib/netcoreapp3.1/it/Microsoft.VisualStudio.TestPlatform.Common.resources.dll", + "lib/netcoreapp3.1/ja/Microsoft.TestPlatform.CommunicationUtilities.resources.dll", + "lib/netcoreapp3.1/ja/Microsoft.TestPlatform.CrossPlatEngine.resources.dll", + "lib/netcoreapp3.1/ja/Microsoft.VisualStudio.TestPlatform.Common.resources.dll", + "lib/netcoreapp3.1/ko/Microsoft.TestPlatform.CommunicationUtilities.resources.dll", + "lib/netcoreapp3.1/ko/Microsoft.TestPlatform.CrossPlatEngine.resources.dll", + "lib/netcoreapp3.1/ko/Microsoft.VisualStudio.TestPlatform.Common.resources.dll", + "lib/netcoreapp3.1/pl/Microsoft.TestPlatform.CommunicationUtilities.resources.dll", + "lib/netcoreapp3.1/pl/Microsoft.TestPlatform.CrossPlatEngine.resources.dll", + "lib/netcoreapp3.1/pl/Microsoft.VisualStudio.TestPlatform.Common.resources.dll", + "lib/netcoreapp3.1/pt-BR/Microsoft.TestPlatform.CommunicationUtilities.resources.dll", + "lib/netcoreapp3.1/pt-BR/Microsoft.TestPlatform.CrossPlatEngine.resources.dll", + "lib/netcoreapp3.1/pt-BR/Microsoft.VisualStudio.TestPlatform.Common.resources.dll", + "lib/netcoreapp3.1/ru/Microsoft.TestPlatform.CommunicationUtilities.resources.dll", + "lib/netcoreapp3.1/ru/Microsoft.TestPlatform.CrossPlatEngine.resources.dll", + "lib/netcoreapp3.1/ru/Microsoft.VisualStudio.TestPlatform.Common.resources.dll", + "lib/netcoreapp3.1/testhost.deps.json", + "lib/netcoreapp3.1/testhost.dll", + "lib/netcoreapp3.1/tr/Microsoft.TestPlatform.CommunicationUtilities.resources.dll", + "lib/netcoreapp3.1/tr/Microsoft.TestPlatform.CrossPlatEngine.resources.dll", + "lib/netcoreapp3.1/tr/Microsoft.VisualStudio.TestPlatform.Common.resources.dll", + "lib/netcoreapp3.1/x64/msdia140.dll", + "lib/netcoreapp3.1/x86/msdia140.dll", + "lib/netcoreapp3.1/zh-Hans/Microsoft.TestPlatform.CommunicationUtilities.resources.dll", + "lib/netcoreapp3.1/zh-Hans/Microsoft.TestPlatform.CrossPlatEngine.resources.dll", + "lib/netcoreapp3.1/zh-Hans/Microsoft.VisualStudio.TestPlatform.Common.resources.dll", + "lib/netcoreapp3.1/zh-Hant/Microsoft.TestPlatform.CommunicationUtilities.resources.dll", + "lib/netcoreapp3.1/zh-Hant/Microsoft.TestPlatform.CrossPlatEngine.resources.dll", + "lib/netcoreapp3.1/zh-Hant/Microsoft.VisualStudio.TestPlatform.Common.resources.dll", + "microsoft.testplatform.testhost.17.6.0.nupkg.sha512", + "microsoft.testplatform.testhost.nuspec" + ] + }, + "Newtonsoft.Json/13.0.1": { + "sha512": "ppPFpBcvxdsfUonNcvITKqLl3bqxWbDCZIzDWHzjpdAHRFfZe0Dw9HmA0+za13IdyrgJwpkDTDA9fHaxOrt20A==", + "type": "package", + "path": "newtonsoft.json/13.0.1", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.md", + "lib/net20/Newtonsoft.Json.dll", + "lib/net20/Newtonsoft.Json.xml", + "lib/net35/Newtonsoft.Json.dll", + "lib/net35/Newtonsoft.Json.xml", + "lib/net40/Newtonsoft.Json.dll", + "lib/net40/Newtonsoft.Json.xml", + "lib/net45/Newtonsoft.Json.dll", + "lib/net45/Newtonsoft.Json.xml", + "lib/netstandard1.0/Newtonsoft.Json.dll", + "lib/netstandard1.0/Newtonsoft.Json.xml", + "lib/netstandard1.3/Newtonsoft.Json.dll", + "lib/netstandard1.3/Newtonsoft.Json.xml", + "lib/netstandard2.0/Newtonsoft.Json.dll", + "lib/netstandard2.0/Newtonsoft.Json.xml", + "newtonsoft.json.13.0.1.nupkg.sha512", + "newtonsoft.json.nuspec", + "packageIcon.png" + ] + }, + "NuGet.Frameworks/5.11.0": { + "sha512": "eaiXkUjC4NPcquGWzAGMXjuxvLwc6XGKMptSyOGQeT0X70BUZObuybJFZLA0OfTdueLd3US23NBPTBb6iF3V1Q==", + "type": "package", + "path": "nuget.frameworks/5.11.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "icon.png", + "lib/net40/NuGet.Frameworks.dll", + "lib/net40/NuGet.Frameworks.xml", + "lib/net472/NuGet.Frameworks.dll", + "lib/net472/NuGet.Frameworks.xml", + "lib/netstandard2.0/NuGet.Frameworks.dll", + "lib/netstandard2.0/NuGet.Frameworks.xml", + "nuget.frameworks.5.11.0.nupkg.sha512", + "nuget.frameworks.nuspec" + ] + }, + "System.Reflection.Metadata/1.6.0": { + "sha512": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==", + "type": "package", + "path": "system.reflection.metadata/1.6.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/netstandard1.1/System.Reflection.Metadata.dll", + "lib/netstandard1.1/System.Reflection.Metadata.xml", + "lib/netstandard2.0/System.Reflection.Metadata.dll", + "lib/netstandard2.0/System.Reflection.Metadata.xml", + "lib/portable-net45+win8/System.Reflection.Metadata.dll", + "lib/portable-net45+win8/System.Reflection.Metadata.xml", + "system.reflection.metadata.1.6.0.nupkg.sha512", + "system.reflection.metadata.nuspec", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, + "xunit.runner.visualstudio/2.4.5": { + "sha512": "OwHamvBdUKgqsXfBzWiCW/O98BTx81UKzx2bieIOQI7CZFE5NEQZGi8PBQGIKawDW96xeRffiNf20SjfC0x9hw==", + "type": "package", + "path": "xunit.runner.visualstudio/2.4.5", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "License.txt", + "build/net462/xunit.abstractions.dll", + "build/net462/xunit.runner.reporters.net452.dll", + "build/net462/xunit.runner.utility.net452.dll", + "build/net462/xunit.runner.visualstudio.props", + "build/net462/xunit.runner.visualstudio.testadapter.dll", + "build/netcoreapp3.1/xunit.abstractions.dll", + "build/netcoreapp3.1/xunit.runner.reporters.netcoreapp10.dll", + "build/netcoreapp3.1/xunit.runner.utility.netcoreapp10.dll", + "build/netcoreapp3.1/xunit.runner.visualstudio.dotnetcore.testadapter.dll", + "build/netcoreapp3.1/xunit.runner.visualstudio.props", + "build/uap10.0.16299/xunit.runner.reporters.netstandard15.dll", + "build/uap10.0.16299/xunit.runner.utility.netstandard15.dll", + "build/uap10.0.16299/xunit.runner.utility.uwp10.dll", + "build/uap10.0.16299/xunit.runner.utility.uwp10.pri", + "build/uap10.0.16299/xunit.runner.visualstudio.props", + "build/uap10.0.16299/xunit.runner.visualstudio.targets", + "build/uap10.0.16299/xunit.runner.visualstudio.uwp.testadapter.dll", + "build/uap10.0.16299/xunit.runner.visualstudio.uwp.testadapter.pri", + "lib/net462/_._", + "lib/netcoreapp3.1/_._", + "lib/uap10.0.16299/_._", + "logo-512-transparent.png", + "xunit.runner.visualstudio.2.4.5.nupkg.sha512", + "xunit.runner.visualstudio.nuspec" + ] + } + }, + "projectFileDependencyGroups": { + "net8.0": [ + "Microsoft.NET.Test.Sdk >= 17.6.0", + "coverlet.collector >= 6.0.0", + "xunit >= 2.4.2", + "xunit.runner.visualstudio >= 2.4.5" + ] + }, + "packageFolders": { + "/home/marek/.nuget/packages/": {} + }, + "project": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/home/marek/code/ai_games_2024/takehome/csharp/xunit/xunit.csproj", + "projectName": "xunit", + "projectPath": "/home/marek/code/ai_games_2024/takehome/csharp/xunit/xunit.csproj", + "packagesPath": "/home/marek/.nuget/packages/", + "outputPath": "/home/marek/code/ai_games_2024/takehome/csharp/xunit/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/marek/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net8.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net8.0": { + "targetAlias": "net8.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + } + }, + "frameworks": { + "net8.0": { + "targetAlias": "net8.0", + "dependencies": { + "Microsoft.NET.Test.Sdk": { + "target": "Package", + "version": "[17.6.0, )" + }, + "coverlet.collector": { + "include": "Runtime, Build, Native, ContentFiles, Analyzers, BuildTransitive", + "suppressParent": "All", + "target": "Package", + "version": "[6.0.0, )" + }, + "xunit": { + "target": "Package", + "version": "[2.4.2, )" + }, + "xunit.runner.visualstudio": { + "include": "Runtime, Build, Native, ContentFiles, Analyzers, BuildTransitive", + "suppressParent": "All", + "target": "Package", + "version": "[2.4.5, )" + } + }, + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Ref", + "version": "[8.0.8, 8.0.8]" + } + ], + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/8.0.108/PortableRuntimeIdentifierGraph.json" + } + } + }, + "logs": [ + { + "code": "NU1108", + "level": "Error", + "message": "Cycle detected. \n xunit -> xunit (>= 2.4.2).", + "libraryId": "xunit", + "targetGraphs": [ + "net8.0" + ] + } + ] +} \ No newline at end of file diff --git a/takehome/csharp/xunit/obj/project.nuget.cache b/takehome/csharp/xunit/obj/project.nuget.cache new file mode 100644 index 0000000..f465b29 --- /dev/null +++ b/takehome/csharp/xunit/obj/project.nuget.cache @@ -0,0 +1,29 @@ +{ + "version": 2, + "dgSpecHash": "QHnnVLLCqqDsPvS792An4GE/vwmYnCusuRc6pId62ypX1zkQeG0NfeVJOpOvJ9GtULWLlKiT5tJCLcpFujxKGw==", + "success": false, + "projectFilePath": "/home/marek/code/ai_games_2024/takehome/csharp/xunit/xunit.csproj", + "expectedPackageFiles": [ + "/home/marek/.nuget/packages/coverlet.collector/6.0.0/coverlet.collector.6.0.0.nupkg.sha512", + "/home/marek/.nuget/packages/microsoft.codecoverage/17.6.0/microsoft.codecoverage.17.6.0.nupkg.sha512", + "/home/marek/.nuget/packages/microsoft.net.test.sdk/17.6.0/microsoft.net.test.sdk.17.6.0.nupkg.sha512", + "/home/marek/.nuget/packages/microsoft.testplatform.objectmodel/17.6.0/microsoft.testplatform.objectmodel.17.6.0.nupkg.sha512", + "/home/marek/.nuget/packages/microsoft.testplatform.testhost/17.6.0/microsoft.testplatform.testhost.17.6.0.nupkg.sha512", + "/home/marek/.nuget/packages/newtonsoft.json/13.0.1/newtonsoft.json.13.0.1.nupkg.sha512", + "/home/marek/.nuget/packages/nuget.frameworks/5.11.0/nuget.frameworks.5.11.0.nupkg.sha512", + "/home/marek/.nuget/packages/system.reflection.metadata/1.6.0/system.reflection.metadata.1.6.0.nupkg.sha512", + "/home/marek/.nuget/packages/xunit.runner.visualstudio/2.4.5/xunit.runner.visualstudio.2.4.5.nupkg.sha512", + "/home/marek/.nuget/packages/microsoft.aspnetcore.app.ref/8.0.8/microsoft.aspnetcore.app.ref.8.0.8.nupkg.sha512" + ], + "logs": [ + { + "code": "NU1108", + "level": "Error", + "message": "Cycle detected. \n xunit -> xunit (>= 2.4.2).", + "libraryId": "xunit", + "targetGraphs": [ + "net8.0" + ] + } + ] +} \ No newline at end of file diff --git a/takehome/csharp/xunit/obj/xunit.csproj.nuget.dgspec.json b/takehome/csharp/xunit/obj/xunit.csproj.nuget.dgspec.json new file mode 100644 index 0000000..f5c5b51 --- /dev/null +++ b/takehome/csharp/xunit/obj/xunit.csproj.nuget.dgspec.json @@ -0,0 +1,89 @@ +{ + "format": 1, + "restore": { + "/home/marek/code/ai_games_2024/takehome/csharp/xunit/xunit.csproj": {} + }, + "projects": { + "/home/marek/code/ai_games_2024/takehome/csharp/xunit/xunit.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/home/marek/code/ai_games_2024/takehome/csharp/xunit/xunit.csproj", + "projectName": "xunit", + "projectPath": "/home/marek/code/ai_games_2024/takehome/csharp/xunit/xunit.csproj", + "packagesPath": "/home/marek/.nuget/packages/", + "outputPath": "/home/marek/code/ai_games_2024/takehome/csharp/xunit/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/marek/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net8.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net8.0": { + "targetAlias": "net8.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + } + }, + "frameworks": { + "net8.0": { + "targetAlias": "net8.0", + "dependencies": { + "Microsoft.NET.Test.Sdk": { + "target": "Package", + "version": "[17.6.0, )" + }, + "coverlet.collector": { + "include": "Runtime, Build, Native, ContentFiles, Analyzers, BuildTransitive", + "suppressParent": "All", + "target": "Package", + "version": "[6.0.0, )" + }, + "xunit": { + "target": "Package", + "version": "[2.4.2, )" + }, + "xunit.runner.visualstudio": { + "include": "Runtime, Build, Native, ContentFiles, Analyzers, BuildTransitive", + "suppressParent": "All", + "target": "Package", + "version": "[2.4.5, )" + } + }, + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Ref", + "version": "[8.0.8, 8.0.8]" + } + ], + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/8.0.108/PortableRuntimeIdentifierGraph.json" + } + } + } + } +} \ No newline at end of file diff --git a/takehome/csharp/xunit/obj/xunit.csproj.nuget.g.props b/takehome/csharp/xunit/obj/xunit.csproj.nuget.g.props new file mode 100644 index 0000000..5ee370e --- /dev/null +++ b/takehome/csharp/xunit/obj/xunit.csproj.nuget.g.props @@ -0,0 +1,21 @@ + + + + False + NuGet + $(MSBuildThisFileDirectory)project.assets.json + /home/marek/.nuget/packages/ + /home/marek/.nuget/packages/ + PackageReference + 6.8.1 + + + + + + + + + + + \ No newline at end of file diff --git a/takehome/csharp/xunit/obj/xunit.csproj.nuget.g.targets b/takehome/csharp/xunit/obj/xunit.csproj.nuget.g.targets new file mode 100644 index 0000000..e64e919 --- /dev/null +++ b/takehome/csharp/xunit/obj/xunit.csproj.nuget.g.targets @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/takehome/csharp/xunit/xunit.csproj b/takehome/csharp/xunit/xunit.csproj new file mode 100644 index 0000000..22b0134 --- /dev/null +++ b/takehome/csharp/xunit/xunit.csproj @@ -0,0 +1,25 @@ + + + + net8.0 + enable + enable + + false + true + + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + diff --git a/takehome/rust/Cargo.toml b/takehome/rust/Cargo.toml new file mode 100644 index 0000000..7f0bc71 --- /dev/null +++ b/takehome/rust/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "rust" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +strum = "0.26.3" +strum_macros = "0.26.3" +rand = "0.8.4" diff --git a/takehome/rust/src/main.rs b/takehome/rust/src/main.rs new file mode 100644 index 0000000..1ab82f5 --- /dev/null +++ b/takehome/rust/src/main.rs @@ -0,0 +1,227 @@ +use rand::{seq::SliceRandom, thread_rng}; +use strum::IntoEnumIterator; +use strum_macros::EnumIter; + +fn main() { + println!("Hello, Lets start a war!"); + + let mut game = Game::new(); + game.play(); +} + +#[derive(Debug)] +struct Player { + hand: Vec, +} + +#[derive(Debug)] +struct Game { + computer_player: Player, + human_player: Player, +} + +// Shuffle the deck +// Ensure the deck is ordered +fn shuffle_deck(deck: &mut Vec) { + //TODO: Currently this is a naive shuffle, we should implement a better shuffle + let mut second_half = deck.split_off(deck.len() / 2); + let mut first_half = deck.split_off(0); + deck.append(&mut second_half); + deck.append(&mut first_half); +} + +impl Game { + fn new() -> Game { + let mut deck = Deck::new(); + + // Shuffle the deck + shuffle_deck(&mut deck.cards); + + // Deal the cards as a human would + /* + let mut card = deck.cards.pop(); + while card.is_some() { + if (deck.cards.len() % 2) == 0 { + computer_hand.push(card.unwrap()); + } else { + human_hand.push(card.unwrap()); + } + card = deck.cards.pop(); + } + */ + + // Deal the cards as twitch chat would + let player_hand = deck.cards.split_off(deck.cards.len() / 2); + let computer_hand = deck.cards.split_off(0); + println!("Player Hand: {:?}", player_hand); + println!("Computer Hand: {:?}", computer_hand); + + Game { + computer_player: Player { + hand: computer_hand, + }, + human_player: Player { hand: player_hand }, + } + } + + fn play(&mut self) { + while !self.human_player.hand.is_empty() && !self.computer_player.hand.is_empty() { + self.play_round(); + } + + // Determine the winner + if self.human_player.hand.is_empty() { + println!("Computer wins!"); + } else { + println!("Player wins!"); + } + } + + fn play_round(&mut self) { + // Compare the cards + // The player with the higher card wins + // If the cards are the same, the player with the higher suit wins + // If the suits are the same, the game is a draw + // If the game is a draw, the cards are added to the bottom of the deck + // If the game is not a draw, the winner takes the cards + // The game continues until one player has all the cards + // The player with all the cards wins + // The game is a draw if the game continues for too long + // Draw a card from each player's hand + let player_card = self.human_player.hand.pop().unwrap(); + let computer_card = self.computer_player.hand.pop().unwrap(); + + println!( + "Player card: {:?} vs {:?} Computer Card", + player_card, computer_card + ); + + // Compare the cards + match player_card.value.cmp(&computer_card.value) { + std::cmp::Ordering::Equal => { + // TODO: Draw, have a WAR. + } + std::cmp::Ordering::Greater => { + self.human_player.hand.push(player_card); + self.human_player.hand.push(computer_card); + } + std::cmp::Ordering::Less => { + self.computer_player.hand.push(player_card); + self.computer_player.hand.push(computer_card); + } + } + } +} + +#[derive(Debug)] +struct Deck { + cards: Vec, +} + +#[derive(Debug, Clone, Copy, PartialEq)] +struct Card { + suit: Suit, + value: CardValue, +} + +#[derive(EnumIter, Debug, PartialEq, Clone, Copy)] +enum Suit { + Spades, + Hearts, + Diamonds, + Clubs, +} + +#[derive(EnumIter, Debug, PartialEq, Clone, Copy, PartialOrd, Eq, Ord)] +enum CardValue { + Two = 2, + Three, + Four, + Five, + Six, + Seven, + Eight, + Nine, + Ten, + Jack, + Queen, + King, + Ace, +} + +impl Deck { + fn new() -> Deck { + let mut cards = Vec::with_capacity(52); + for suit in Suit::iter() { + for value in CardValue::iter() { + cards.push(Card { suit, value }); + } + } + Deck { cards } + } +} + +// Tests +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_deck() { + let deck = Deck::new(); + assert_eq!(deck.cards.len(), 52); + } + + #[test] + fn test_shuffle_deck() { + let mut deck = Deck::new(); + let original_deck = deck.cards.clone(); + shuffle_deck(&mut deck.cards); + + for i in 0..deck.cards.len() { + assert_ne!(deck.cards[i], original_deck[i]); + } + } + + #[test] + fn test_shuffle_two_decks_different() { + let mut deck = Deck::new(); + let mut deck2 = Deck::new(); + shuffle_deck(&mut deck.cards); + shuffle_deck(&mut deck2.cards); + + for i in 0..deck.cards.len() { + assert_ne!(deck.cards[i], deck2.cards[i]); + } + } + + #[test] + fn test_war() { + let mut game = Game::new(); + game.human_player.hand = vec![ + Card { + suit: Suit::Spades, + value: CardValue::Ace, + }, + Card { + suit: Suit::Spades, + value: CardValue::Two, + }, + ]; + game.computer_player.hand = vec![ + Card { + suit: Suit::Hearts, + value: CardValue::Ace, + }, + Card { + suit: Suit::Hearts, + value: CardValue::Two, + }, + ]; + + game.play_round(); + + assert_eq!(game.human_player.hand.len(), 0); + assert_eq!(game.computer_player.hand.len(), 4); + } +}