Include: y_tho
Cemu sluzi y_tho?
Ako ste ikada pozeleli da "promenite" Pawn jezik onda to mozete uz y_tho include!
Najbolje cete to videti uz primere ispod..
Primeri
Pre:
for (new i = 0; i != 10; ++i)
{
printf("i is %d", i);
}
Posle:
for i in {0 .. 10}
do
echo i is %d, i
done
Pre:
if (playerid < 7)
{
SetPlayerPos(playerid, 0.0, 0.0, 4.0);
}
Posle:
if [ playerid -lt 7 ]
then
SetPlayerPos playerid, 0.0, 0.0, 4.0
fi
Sintakse
if/elif/else
if [ i -gt 5 ]
then
echo "i is %d", i
elif [ i -eq 5 ]
then
echo i is 5
else
echo "i is something else"
fi
for(range)
for j in {7 .. 11}
do
echo j is %d, j
done
for (arithmetic)
for ((k = 10; k != 100; ++k))
do
echo k is %d, k
done
while
while [ i -lt 10 ]
do
echo "i is %d", i
++i
done
until (!while)
until [ i -eq 15 ]
do
echo "i is %d", i
SetPlayerPos i, 0.0, 0.0, 4.0
++i
done
switch
switch i of
case 5)
echo i is 5
case 10)
echo i is 5
default)
echo i is %d, i
esac
echo
echo Hello world
echo "How are you?"
echo "The answer is %d", 42
Poredjenja
-lt Manje (Less than)
-le Manje od ili manje i jednako (Less than or equal to)
-eq Jednako (Equal)
-ne Nije jednako (Not equal)
-ge Vece ili vece jednako (Greater than or equal to)
-gt Vece od (Greater than)
Download