Пређи на садржај

Разговор:БꙊква́рь Славе́нскїй трїа́збꙊчный/Прибавле́нїе ѡ̑ числѣхъ

Садржај странице није подржан на другим језицима
Додај тему
Извор: Викизворник
Последњи коментар: Никола Смоленски, пре 13 година

Ево програма̂ које сам користио за израду таблица, можда неком послуже и за неку другу књигу:

sab.php

<?

echo "<center>\n{| cellspacing=\"0\"\n";

$a = $b = 1; $c = $d = 4;
$s1 = "style=\"padding-left: 0.5em; padding-right: 0.5em;\"";
$s2 = "style=\"padding-left: 0.5em; padding-right: 0.5em; text-align: right;\"";
$s3 = "style=\"padding-left: 0.5em; padding-right: 0.5em; border-left: 0.1em solid black;\"";
while($a < 4) {
	echo "|-\n";

	if($b == 10) {
		echo "|colspan=\"5\"|\n----\n|";
		$a ++; $b = $a-1;
	} else {
		if($a == $b) {
			$a1 = "и`(`"; $b1 = "`је(`с`оу\`";
		} else {
			$a1 = $b1 = "";
		}
		$ab = $a + $b;
		echo "|$s1|$a
|$a1
|$s1|$b
|$b1
|$s2|$ab
|";
	}

	if($d == 10 && $c < 9) {
		echo "style=\"border-left: 0.1em solid black;\" colspan=\"5\"|\n----\n";
		$c ++; $d = $c-1;
	} else {
		if($c == $d) {
			$c1 = "и`(`"; $d1 = "`је(`с`оу\`";
		} else {
			$c1 = $d1 = "";
		}
		$cd = $c + $d;
		echo "$s3|$c
|$c1
|$s2|$d
|$d1
|$s2|$cd\n";
	}

	$b++; $d++;
}

echo "|}\n</center>";

odu.php

<?

echo "<center>\n{| cellspacing=\"0\"\n";

$a = 1; $b = 7; $c = 5; $d = 8;
$s1 = "style=\"padding-left: 0.5em; padding-right: 0.5em;\"";
$s2 = "style=\"padding-left: 0.5em; padding-right: 0.5em; text-align: right;\"";
$s3 = "style=\"padding-left: 0.5em; padding-right: 0.5em; border-left: 0.1em solid black;\"";
while($d < 19) {
	echo "|-\n";

	$ab = $b - $a;
	if($ab == 10) {
		echo "|colspan=\"5\"|\n----\n|";
		$a++; $b = $a;
	} else {
		if($ab == 1) {
			$a1 = "`ом(`т`дј`"; $b1 = "`ом(`ста`/``је`";
		} else if($ab == 2 || ($a == 1 && $b == 7) || ($a == 8 && $b == 16)) {
			$a1 = ""; $b1 = "`ом(`ста`/``ју`";
		} else if(($a == 1 && $b == 7) || ($a == 8 && $b == 16)) {
			$a1 = "`ом(`т`дј`"; $b1 = "`ом(`ста`/``ју`";
		} else {
			$a1 = $b1 = "";
		}
		echo "|$s1|$a
|$a1
|$s2|$b
|$b1
|$s2|$ab
|";
	}

	$cd = $d - $c;
	if($cd == 10) {
		echo "style=\"border-left: 0.1em solid black;\" colspan=\"5\"|\n----\n";
		$c++; $d = $c;
	} else {
		if($cd == 1) {
			$a1 = "`ом(`т`дј`"; $b1 = "`ом(`ста`/``је`";
		} else if($cd == 2) {
			$a1 = ""; $b1 = "`ом(`ста`/``ју`";
		} else if(($c == 5 && $d == 8) || ($c == 9 && $d == 13)) {
			$a1 = "`ом(`т`дј`"; $b1 = "`ом(`ста`/``ју`";
		} else {
			$a1 = $b1 = "";
		}
		echo "$s3|$c
|$a1
|$s2|$d
|$b1
|$s2|$cd\n";
	}

	$b++; $d++;
}

echo "|}\n</center>";

mno.php

<?

echo "<center>\n{| cellspacing=\"0\"\n";

//$a = 1; $b = 1; $c = 4; $d = 6;
$a = 8; $b = 8; $c = 9; $d = 9;
$s1 = "style=\"padding-left: 0.5em; padding-right: 0.5em;\"";
$s2 = "style=\"padding-left: 0.5em; padding-right: 0.5em; text-align: right;\"";
$s3 = "style=\"padding-left: 0.5em; padding-right: 0.5em; border-left: 0.1em solid black;\"";
while($c * $d <= /*70*/ 100) {
	echo "|-\n";

	$ab = $a * $b;
	if($b == 11) {
		echo "|colspan=\"5\"|\n----\n|";
		$a++; $b = $a - 1;
	} else {
		if($a == $b) {
			$a1 = "кра`/`т`дј`"; $b1 = "`је(`с`оу\`";
		} else {
			$a1 = $b1 = "";
		}
		echo "|$s1|$a
|$a1
|$s2|$b
|$b1
|$s2|$ab
|";
	}

	$cd = $c * $d;
	if($d == 11) {
		echo "style=\"border-left: 0.1em solid black;\" colspan=\"5\"|\n----\n";
		$c++; $d = $c - 1;
	} else {
		if($c == $d || ($c == 4 && $d == 6)) {
			$a1 = "кра`/`т`дј`"; $b1 = "`је(`с`оу\`";
		} else {
			$a1 = $b1 = "";
		}
		echo "$s3|$c
|$a1
|$s2|$d
|$b1
|$s2|$cd\n";
	}

	if($a == 1) {
		$b = 11;
	} else {
		$b++;
	}
	$d++;
}

echo "|}\n</center>";

del.php

<?

echo "<center>\n{| cellspacing=\"0\"\n";

//$a = 2; $b = 1; $c = 4; $d = 1;
$a = 6; $b = 1; $c = 8; $d = 1;
$s1 = "style=\"padding-left: 0.5em; padding-right: 0.5em;\"";
$s2 = "style=\"padding-left: 0.5em; padding-right: 0.5em; text-align: right;\"";
$s3 = "style=\"padding-left: 0.5em; padding-right: 0.5em; border-left: 0.1em solid black;\"";
while($c < /*6*/ 10) {
	echo "|-\n";

	$ab = $a * $b;
	if($b == 10) {
		echo "|colspan=\"5\"|\n----\n|";
		$a++; $b = 0;
	} else {
		if($b == 1) {
			$a1 = "у`(`"; $b1 = "и`(/`масе";
		} else {
			$a1 = $b1 = "";
		}
		echo "|$s1|$a
|$a1
|$s2|$ab
|$b1
|$s1|$b
|";
	}

	$cd = $c * $d;
	if($d == 10) {
		echo "style=\"border-left: 0.1em solid black;\" colspan=\"5\"|\n----\n";
		$c++; $d = 0;
	} else {
		if($b == 1) {
			$a1 = "у`(`"; $b1 = "и`(/`масе";
		} else {
			$a1 = $b1 = "";
		}
		echo "$s3|$c
|$a1
|$s2|$cd
|$b1
|$s1|$d\n";
	}

	$b++; $d++;
}

echo "|}\n</center>";

Никола (разговор) 12:00, 20. октобар 2011. (CEST)Одговори