sitelen li ante

This commit is contained in:
tess 2022-05-05 22:16:57 +02:00
parent 7249e570bf
commit 36a7a17e40
12 changed files with 33 additions and 14 deletions

1
Cargo.lock generated
View File

@ -492,6 +492,7 @@ version = "0.1.0"
dependencies = [
"markov",
"rand 0.8.5",
"rand_chacha 0.3.1",
"rocket",
"rocket_contrib",
]

View File

@ -9,6 +9,7 @@ edition = "2021"
rand = "0.8.5"
markov = "1.1.0"
rocket = "0.4.10"
rand_chacha = "0.3.1"
[dependencies.rocket_contrib]

15
nimi
View File

@ -534,3 +534,18 @@ to seize with teeth;
to wound, pierce or sting with a fang;
to bit or have the habit of biting something;
long-eared short-tailed mammals with long hind legs
to hit a home run;
aware of and actively attentive to the important facts and issues;
to come into possession or control of by unspecified means;
to locate and hold;
an english apple of a variety often sold after being dried in the oven;
the quality or aggregate of qualities in a person or thing that gives pleasure to the senses or pleasurably exalts the mind or spirit;
a beautiful person;
a group of individuals living under one roof;
a group of things related by common characteristics;
a unit of a crime syndicate (such as the Mafia) operating within a geographical area;
to send an instant message to;
to communicate by instant message;
an unintentional revelation or betrayal;
the act of giving something away for free;
fully developed and mature;

View File

@ -21,6 +21,7 @@ pub fn pana_lipu(i: usize, j: usize) -> Vec<String> {
///# wile
///`i` - nimi li ken tan linja ni
pub fn pana(i: &[usize]) -> String {
let mut npsa = rand::thread_rng();
let lipu_nimi = std::fs::read_to_string("nimi_ale.txt").unwrap();
let mut kulupu_nimi = Vec::new();
for nanpa in i {
@ -28,7 +29,7 @@ pub fn pana(i: &[usize]) -> String {
kulupu_nimi.push(String::from(nimi));
}
}
String::clone(kulupu_nimi.choose(&mut rand::thread_rng()).unwrap())
String::clone(kulupu_nimi.choose(&mut npsa).unwrap())
}
///ni li pana e nimi lili pi sona ala tan lipu nimi
@ -36,6 +37,7 @@ pub fn pana(i: &[usize]) -> String {
///# wile
///`i` - nimi lili li ken tan linja ni
pub fn pana_lili(i: &[usize]) -> char {
let mut npsa = rand::thread_rng();
let lipu_nimi = std::fs::read_to_string("nimi_ale.txt").unwrap();
let mut kulupu_nimi = Vec::new();
for nanpa in i {
@ -43,5 +45,5 @@ pub fn pana_lili(i: &[usize]) -> char {
kulupu_nimi.push(nimi.chars().nth(0).unwrap());
}
}
*kulupu_nimi.choose(&mut rand::thread_rng()).unwrap()
*kulupu_nimi.choose(&mut npsa).unwrap()
}

View File

@ -17,7 +17,7 @@ pub fn pali(i: u8) -> String {
while x < mute {
let mut nimi: char;
if rand::random() || x > 0 {
if npsa.gen_range(0..1) == 0 || x > 0 {
//kipisi wan la nimi ni li ken lon li ken lon ala. kipisi mute la nimi ni li wile lon
if nimi_pini == 'n' {
nimi = lipu_nimi::pana_lili(&[3]);

View File

@ -18,17 +18,18 @@ pub fn pali(nimi_sin: &str) -> String {
/// `la_li_ken` - nimi "la" li lon la nimi "la" li ken ala. ante la ona li ken
/// `nimi_sin_li_lon` - nimi sin li lon anu seme?
fn pali_lili(nimi_sin: &str, la_li_ken: bool, mut nimi_sin_li_lon: bool) -> String {
let mut npsa = rand::thread_rng();
let mut toki_sin = String::new();
let mut mi_anu_sina = false;
let mut la_anu_seme = rand::thread_rng().gen_range(0_u8..10) == 0;
let mut la_anu_seme = npsa.gen_range(0_u8..10) == 0;
if la_li_ken == false {
la_anu_seme = false;
}
let mut x = 0;
let suli = rand::thread_rng().gen_range(1_u8..4); // toki la, kipisi tu tu li ken lon.
let suli = npsa.gen_range(1_u8..4); // toki la, kipisi tu tu li ken lon.
while x < suli {
if x == 1 {
if rand::thread_rng().gen_range(0_u8..10) == 0 {
if npsa.gen_range(0_u8..10) == 0 {
toki_sin.push_str("o "); //o li ken lon
} else if !mi_anu_sina {
toki_sin.push_str("li "); //nimi "mi" anu nimi "sina" li lon ala la nimi "li" li ken lon
@ -44,13 +45,12 @@ fn pali_lili(nimi_sin: &str, la_li_ken: bool, mut nimi_sin_li_lon: bool) -> Stri
let mut y = 0;
let suli_kipisi;
if suli == 1 {
suli_kipisi = rand::thread_rng().gen_range(2_u8..4); //kipisi wan taso li lon la nimi tu anu nimi mute o lon kipisi
suli_kipisi = npsa.gen_range(2_u8..4); //kipisi wan taso li lon la nimi tu anu nimi mute o lon kipisi
} else {
suli_kipisi = rand::thread_rng().gen_range(1_u8..4); //ante la nimi wan li ken lon kin!
suli_kipisi = npsa.gen_range(1_u8..4); //ante la nimi wan li ken lon kin!
}
while y < suli_kipisi {
if (rand::thread_rng().gen_range(0_u8..4) == 0
|| (x == suli - 1 && y == suli_kipisi - 1))
if (npsa.gen_range(0_u8..4) == 0 || (x == suli - 1 && y == suli_kipisi - 1))
&& !nimi_sin_li_lon
{
toki_sin.push_str(nimi_sin); //ilo li pana e nimi sin.
@ -64,7 +64,7 @@ fn pali_lili(nimi_sin: &str, la_li_ken: bool, mut nimi_sin_li_lon: bool) -> Stri
}
toki_sin.push_str(" ");
y += 1;
if suli_kipisi - y > 1 && rand::random() {
if suli_kipisi - y > 1 && npsa.gen_range(0_u8..1) == 0 {
//nimi "pi" li ken lon la, ona li ken lon!
toki_sin.push_str("pi ");
}

View File

@ -9,7 +9,7 @@
<body>
<header id=header>
<h1>󱤎󱥉<a href="/" class=nena>󱥍󱦒󱥂󱥝</a></h1>
<h1><a href="/"><img src="static/󱥠󱥣.png" width="64px"/></a></h1>
</header>
<div class=poki>

View File

@ -96,7 +96,7 @@ a:hover {
}
.nena:hover {
text-shadow: 0 0 5px #7979ff;
box-shadow: 0 0 5px #7979ff;
text-decoration:none;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
static/󱥠󱥣.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

@ -9,7 +9,7 @@
<body>
<header id=header>
<h2>󱤎󱥉<a href="/" class=nena>󱥍󱦒󱥂󱥝</a></h2>
<h2><a href="/"><img src="static/󱥠󱥣.png" width="64px" alt="ilo pi nimi sin"></a></h2>
</header>
<div class=nimisin-poki>