diff --git a/Program.cs b/Program.cs index c9c5fce..6b8f68b 100644 --- a/Program.cs +++ b/Program.cs @@ -97,29 +97,24 @@ string SelectTopics(List topics) if (int.TryParse(input, out topicNum) == true) topicChoice = topicDict[topicNum]; else - NewTopic(topics, false); + NewTopic(topics); return topicChoice; } /// -/// Selects a new topic either by prompting the user or randomly choosing one from the list. +/// Allows the user to choose a new topic from a given list or default to placeholder if no selection is made. /// /// A list of available topics. -/// Indicates whether to prompt the user again if no selection was made. -/// The selected topic as a string. -string NewTopic(List topics, bool retry = false) +/// The selected topic or a default placeholder if none is chosen. +string NewTopic(List topics) { var newTopic = ""; - if (UserChoice("Choose a Topic?") || retry) + if (UserChoice("Choose a Topic?")) newTopic = SelectTopics(topics); else - { - var rng = new Random(); - var chooseTopic = rng.Next(0, topics.ToArray().Length); - newTopic = topics[chooseTopic].Trim(); - } + newTopic = "==="; return newTopic; } diff --git a/README.md b/README.md index 658035a..982e6d5 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,14 @@ This is a very simple console application that generates a list of times to publish news articles within a randomized 2-3 hour delay while avoiding time conflicts within a 30-minute window. +## Exporting + +Once it generates a list of times, you can retry or export the times. If you export, you're requested to select from a number of topics or default to none if no selection is made. Upon export, you can start over or exit. + + Choice selection is based on the Y/N keys. ``Enter`` works the same as ``Y`` while pressing any other key is the equivalent of ``N``. You can make mistakes, but it expects failure. + +An optional ``config.toml`` file allows for further customization of file name, directory, and topics. + ## Background A while back, I [found a tool](https://schedule.lemmings.world) to schedule articles on Lemmy. I've been posting within a few hours apart at random minutes and I wanted to something decide that for me. I had AI write the base algorithm, everything else is my own touches.