Возникла трабла - Visavi.net
https://visavi.net/
RSS - Visavi.net
https://visavi.net/assets/img/images/logo_small.png
RSS - Visavi.net
https://visavi.net/
[email protected] (admin)
[email protected] (admin)
Sun, 12 Jan 2025 03:00:39 +0300
-
<blockquote class="blockquote"><strong>kilo</strong> (3 Ноября 2011 / 17:44)<br>
Хоть укажи этот 57 рядок <img src="https://visavi.net/uploads/stickers/smile.gif" alt="smile"> </blockquote>
Та я неправильно метод класса внутри класса вызывал (не писал this). Спасибо.
https://visavi.net/topics/26212/441618
Возникла трабла
CROWS
Thu, 03 Nov 2011 17:50:24 +0400
Сообщения
https://visavi.net/topics/26212/441618
-
Хоть укажи этот 57 рядок <img src="https://visavi.net/uploads/stickers/smile.gif" alt="smile">
https://visavi.net/topics/26212/441617
Возникла трабла
kilo
Thu, 03 Nov 2011 17:44:53 +0400
Сообщения
https://visavi.net/topics/26212/441617
-
Тю ты $this->searchFunction и $this->searchFunctionTwo )))
https://visavi.net/topics/26212/441616
Возникла трабла
CROWS
Thu, 03 Nov 2011 17:44:30 +0400
Сообщения
https://visavi.net/topics/26212/441616
-
<strong>Fatal error: Call to undefined function searchFunctionTwo() in T:\home\virtual\site.ru\_vig.php on line 57</strong><br>
<br>
Функция searchFunctionTwo определена выше. В чем проблема?
https://visavi.net/topics/26212/441613
Возникла трабла
CROWS
Thu, 03 Nov 2011 17:33:43 +0400
Сообщения
https://visavi.net/topics/26212/441613
-
Привет форумчанам.<br>
<br>
<?php<br>
<br>
<br>
class Viginer {<br>
<br>
var $A1 = array ("А","Б","В","Г","Д","Е","Ж","З","И","Й","К","Л","М","Н","О","П","Р","С","Т","У","Ф","Х","Ц","Ч","Ш","Щ","Ъ","Ы","Ь","Э","Ю","Я","#","0","1","2","3","4","5","6","7","8","9");<br>
<br>
var $message="";<br>
var $key="";<br>
var $table = array(array(),array());<br>
var $code="";<br>
var $decoding="";<br>
<br>
<br>
function Viginer($mes, $k) {<br>
$message = $mes;<br>
$key = $k; <br>
}<br>
<br>
<br>
function tablele() {<br>
echo "Constructing Viginer table:<br>";<br>
for ($i = 0; $i < count($this->A1); $i++) {<br>
for ($j = 0; $j < count($this->A1); $j++) {<br>
$table[$i][$j] = $this->A1[($j+$i)%count($this->A1)];<br>
echo $table[$i][$j];<br>
}<br>
echo '<br>';<br>
}<br>
}<br>
<br>
function searchFunction($sym, $ch) {<br>
for ($i = 0; $i < count($sym); $i++) {<br>
if ($sym[$i] == $ch)<br>
return $i;<br>
}<br>
return -1;<br>
}<br>
<br>
function searchFunctionTwo($sym, $n, $ch) {<br>
for ($i = 0; $i < count($this->sym); $i++) {<br>
if ($this->sym[$n][$i] == $this->ch)<br>
return $i;<br>
}<br>
return -1;<br>
}<br>
<br>
function encoding() {<br>
for ($i = 0; $i < strlen($this->message); $i++) {<br>
$this->code += $this->table[searchFunction($this->A1, substr(strlen($i%$this->key), 1, $this->key))][searchFunction($this->A1, substr($i, 1, $this->message))];<br>
}<br>
echo "Encrypting message: ".$this->code;<br>
}<br>
<br>
function decodingo() {<br>
for ($i = 0; $i < count($this->code); $i++) {<br>
$this->decoding += $this->A1[searchFunctionTwo($this->table, searchFunction($this->A1, substr(strlen($i%$this->key), 1, $this->key)), substr($i, 1, $this->code))];<br>
}<br>
echo "Decoded message: ".$this->decoding;<br>
}<br>
<br>
function alpha()<br>
{<br>
echo "Alphabet:";<br>
foreach($this->A1 as $alpha)<br>
{<br>
echo $alpha;<br>
}<br>
}<br>
}<br>
<br>
<br>
<br>
$mes="Сообщенийо";<br>
$key="Ключ";<br>
<br>
<br>
$vig = new Viginer($mes, $key);<br>
$vig->tablele();<br>
$vig->encoding();<br>
$vig->decodingo();<br>
$vig->alpha();<br>
<br>
<br>
<br>
<br>
<br>
<br>
?>
https://visavi.net/topics/26212/441612
Возникла трабла
CROWS
Thu, 03 Nov 2011 17:33:03 +0400
Сообщения
https://visavi.net/topics/26212/441612