Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix whitespace issues #10

Merged
merged 2 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Change delimiter to ,
  • Loading branch information
theoforger committed Sep 18, 2024
commit 5e202ccf668935f5aecab98856f430ff2a83598d
36 changes: 15 additions & 21 deletions examples/avoid.txt
Original file line number Diff line number Diff line change
@@ -1,22 +1,16 @@
lease
tooth
introduce
expect
disclose
sick
dry
merchant
skip
approval
taste
quantity
complete
sulphur
candidate
oh
formation
pier
accessible
angel
ski
captain
bass
boil
casino
star
ground
promise
fish
blind
day
tip
goldilocks
field
file
cotton
scarecrow
37 changes: 9 additions & 28 deletions examples/link.txt
Original file line number Diff line number Diff line change
@@ -1,28 +1,9 @@
sketch
arrow
light
few
torch
haunt
blonde
penalty
skeleton
half
night
restrict
illusion
recommendation
cotton
meal
unanimous
berry
ghost
cereal
observation
teacher
warning
horse
wrap
promote
body
pain
bond
sound
park
penny
bee
tokyo
walrus
hospital
scuba diver
4 changes: 2 additions & 2 deletions src/api/chat_completions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ I will give you a list of [agent word], followed by a list of [avoid word].
Try to link [agent word] together.
Tro to avoid [avoid word].
Answer in this format:
[clue word] [number of agent words] [agent word] [agent word] [agent word]
...
[clue word], [number of agent words], [agent word], [agent word], [agent word]
...
Here are the requirements:
- Always answer in lower case.
- No special characters.
Expand Down
3 changes: 2 additions & 1 deletion src/clue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ pub struct ClueCollection {
impl Clue {
/// Create a new instance of `Clue` from a single line of clue responses from the API
pub fn new(clue_line: &str) -> Option<Self> {
let chunks: Vec<&str> = clue_line.split_whitespace().collect();
println!("{}", clue_line);
let chunks: Vec<&str> = clue_line.split(", ").collect();

// Discard empty lines as well as clues with only one word linked
if chunks.len() < 4 {
Expand Down