ThomasMertes / seed7

Source code of Seed7
GNU General Public License v2.0
201 stars 11 forks source link

Anadromes entry on Rosetta Code #23

Open celtic-coder opened 8 months ago

celtic-coder commented 8 months ago

Hi Thomas (@ThomasMertes),

The Seed7 entry on Rosetta Code for Anadromes is not displaying correctly:

Anadromes-entry-on-RC

It is displaying as Wiki-Text and is highlighted as if it is part of the previous Rust entry.

The Rust entry is missing the following three lines at the end of the code and before the output:

</syntaxhighlight>
{{out}}
<pre>

This is shown below:

=={{header|Rust}}==
<syntaxhighlight lang="rust">use std::collections::BTreeSet;
use std::fs::File;
use std::io::{self, BufRead};

fn load_dictionary(filename: &str, min_length: usize) -> std::io::Result<BTreeSet<String>> {
    let file = File::open(filename)?;
    let mut dict = BTreeSet::new();
    for line in io::BufReader::new(file).lines() {
        let word = line?;
        if word.len() >= min_length {
            dict.insert(word);
        }
    }
    Ok(dict)
}

fn main() {
    match load_dictionary("words.txt", 7) {
        Ok(dictionary) => {
            for word in &dictionary {
                let rev = String::from_iter(word.chars().rev());
                if rev > *word && dictionary.contains(&rev) {
                    println!("{:<8} <-> {}", word, rev);
                }
            }
        }
        Err(error) => eprintln!("{}", error),
    }
}
</syntaxhighlight>    <<-- Missing
{{out}}               <<-- Missing
<pre>                 <<-- Missing
amaroid  <-> diorama
degener  <-> reneged
deifier  <-> reified
deliver  <-> reviled
dessert  <-> tressed
desserts <-> stressed
deviler  <-> relived
dioramas <-> samaroid
gateman  <-> nametag
leveler  <-> relevel
pat-pat  <-> tap-tap
redrawer <-> rewarder
reknits  <-> stinker
relever  <-> reveler
reliver  <-> reviler
revotes  <-> setover
sallets  <-> stellas
</pre>

I do not yet have a login to Rosetta Code. I will work on that and see if I can correct the Rust entry.

Kind Regards, Liam

celtic-coder commented 8 months ago

Hi Thomas (@ThomasMertes),

I have corrected the Rust entry and now the Seed7 entry for "Anadromes" is now displaying correctly. However, an additional entry for Seed7 that is incorrect is One-dimensional cellular automata as can be seen here:

One-dimensional-cellular-automata-error

I will check the Wiki-Text and see if the display can be corrected.

Kind Regards, Liam

celtic-coder commented 8 months ago

Hi Thomas (@ThomasMertes),

I have updated the Seed7 entry for the One-dimensional cellular automata. Please let me know if the two edits done today are correct or if any further updates are required.

Kind Regards, Liam