Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var riches = JObject.Parse(File.ReadAllText("riches.json"));
- int all = 0;
- int remaining = 0;
- string foundSystem = string.Empty;
- foreach (var sys in riches["result"])
- {
- all++;
- if (sys["visited"] != null && (bool)sys["visited"] == true)
- {
- continue;
- }
- else if (foundSystem == string.Empty)
- {
- sys["visited"] = true;
- foundSystem = (string)sys["name"];
- }
- remaining++;
- }
- // VA.SetInt("TotalSystems", all);
- // VA.SetInt("RemainingSystems", remaining);
- // VA.SetText("NextSystem", foundSystem);
- Console.WriteLine("TotalSystems: " + all);
- Console.WriteLine("RemainingSystems: " + remaining);
- Console.WriteLine("NextSystem: " + foundSystem);
- File.WriteAllText("riches.json", riches.ToString());
Add Comment
Please, Sign In to add comment