-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.php
47 lines (43 loc) · 966 Bytes
/
main.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
/**
* Created by PhpStorm.
* User: fris
* Date: 07/05/18
* Time: 08:28 AM
*/
require_once "Database.php";
require_once "Conversation.php";
require_once "SelfLearning.php";
$conversation = new Conversation();
$SL = new SelfLearning($conversation);
$conversation->start($SL);
/**
* @param string $text
* @param bool $newline
*/
function fprint(string $text, bool $newline = true): void
{
echo $text;
echo $newline ? PHP_EOL : null;
}
/* Implemented a new to add new text.
function run_addtext(): void
{
fprint("you say:");
$line = readline("you say:");
fprint("i say to " . $line . " :");
$line2 = readline("i say:");
$db = new Database("database.db");
$db->addData($line, $line2)->close();
unset($db);
run_addtext();
}*/
/**
* @param int $number1
* @param int $number2
* @return int
*/
function difference(int $number1, int $number2): int
{
return max($number1, $number2) - min($number1, $number2);
}