XGM Forum
Сайт - Статьи - Проекты - Ресурсы - Блоги

Форуме в режиме ТОЛЬКО ЧТЕНИЕ. Вы можете задать вопросы в Q/A на сайте, либо создать свой проект или ресурс.
Вернуться   XGM Forum > Общение> Трактир
Ник
Пароль
Войти через VK в один клик
Сайт использует только имя.

Ответ
 
DioD

offline
Опыт: 45,134
Активность:
Временная тема про индийский код
Делаем цикл на яве!
	static public boolean TestWhile(int Input){
		System.out.println(""+Input);
		if (Input <= 0)
		return false;
		return true;
	}
	
	public static void main(String[] args) {
		int i = 5;
		while(TestWhile(i--)){}
	}
Кто круче?
Старый 27.04.2013, 13:05
Clamp
Lost in space
offline
Опыт: 71,158
Активность:
А джасс можно?
Старый 27.04.2013, 13:22
DioD

offline
Опыт: 45,134
Активность:
можно что угодно и победит индейший!

Отредактировано DioD, 28.04.2013 в 04:25.
Старый 27.04.2013, 13:39
MF
Что-то вокруг не так
offline
Опыт: 26,594
Активность:
Хм...
ну классика жанра. Апгрейд Диодовского примера:
	public class IsBolean 
	{
		bolean result;
		public IsBolean(boolean result)
		{
			this.result = result;
		}
		
		public boolean getResult()
		{
			String s;
			bolean b;
			if(result)
			{s= "true";}
			else
			{s = "false";}
			b = (s.length() == 4);
			return b;
		}
	}

	static public boolean TestWhile(int Input){
		System.out.println(""+Input);
		IsBolean isBoolean = new IsBolean(Input <= 0)
		if (isBolean.getResult())
		return false;
		return true;
	}

Отредактировано MF, 27.04.2013 в 13:51.
Старый 27.04.2013, 13:45
Clamp
Lost in space
offline
Опыт: 71,158
Активность:
((кат много раз
function Trig_mult_Actions takes nothing returns nothing

    call CreateMultiboardBJ( 4, 10, "Choose you hero" )

    //=======================================================================//
    //              initial size of points multiboard                        //
    //=======================================================================//

    call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 1, 1, 4.50 )
    call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 2, 1, 5.00 )
    call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 3, 1, 7.00 )
    call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 4, 1, 4.00 )

    call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 1, 2, 4.50 )
    call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 2, 2, 5.00 )
    call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 3, 2, 7.00 )
    call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 4, 2, 4.00 )

    call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 1, 3, 4.50 )
    call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 2, 3, 5.00 )
    call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 3, 3, 7.00 )
    call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 4, 3, 4.00 )

    call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 1, 4, 4.50 )
    call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 2, 4, 5.00 )
    call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 3, 4, 7.00 )
    call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 4, 4, 4.00 )

    call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 1, 5, 4.50 )
    call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 2, 5, 5.00 )
    call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 3, 5, 7.00 )
    call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 4, 5, 4.00 )

    call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 1, 6, 4.50 )
    call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 2, 6, 5.00 )
    call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 3, 6, 7.00 )
    call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 4, 6, 4.00 )

    call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 1, 7, 4.50 )
    call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 2, 7, 5.00 )
    call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 3, 7, 7.00 )
    call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 4, 7, 4.00 )

    call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 1, 8, 4.50 )
    call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 2, 8, 5.00 )
    call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 3, 8, 7.00 )
    call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 4, 8, 4.00 )

    call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 1, 9, 4.50 )
    call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 2, 9, 5.00 )
    call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 3, 9, 7.00 )
    call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 4, 9, 4.00 )

    call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 1, 10, 5.50 )
    call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 2, 10, 3.00 )
    call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 3, 10, 0.50 )
    call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 4, 10, 3.00 )

    //=======================================================================//
    //              initial text of points of multiboard                     //
    //=======================================================================//

    call MultiboardSetItemValueBJ( GetLastCreatedMultiboard(), 1, 1, "CON:" )
    call MultiboardSetItemValueBJ( GetLastCreatedMultiboard(), 1, 2, "STR:" )
    call MultiboardSetItemValueBJ( GetLastCreatedMultiboard(), 1, 3, "AGI:" )
    call MultiboardSetItemValueBJ( GetLastCreatedMultiboard(), 1, 4, "WSD:" )
    call MultiboardSetItemValueBJ( GetLastCreatedMultiboard(), 1, 5, "INT:" )
    call MultiboardSetItemValueBJ( GetLastCreatedMultiboard(), 1, 6, "LCK:" )

    call MultiboardSetItemValueBJ( GetLastCreatedMultiboard(), 3, 1, "max hits:" )
    call MultiboardSetItemValueBJ( GetLastCreatedMultiboard(), 3, 2, "p damage:" )
    call MultiboardSetItemValueBJ( GetLastCreatedMultiboard(), 3, 3, "evasion:" )
    call MultiboardSetItemValueBJ( GetLastCreatedMultiboard(), 3, 4, "max mana:" )
    call MultiboardSetItemValueBJ( GetLastCreatedMultiboard(), 3, 5, "m damage:" )
    call MultiboardSetItemValueBJ( GetLastCreatedMultiboard(), 3, 6, "critical:" )

    call MultiboardSetItemValueBJ( GetLastCreatedMultiboard(), 1, 8, "gold:" )
    call MultiboardSetItemValueBJ( GetLastCreatedMultiboard(), 3, 8, "platinum:" )

    call MultiboardSetItemValueBJ( GetLastCreatedMultiboard(), 1, 10, "EXP:" )
    call MultiboardSetItemValueBJ( GetLastCreatedMultiboard(), 3, 10, "/" )

    //=======================================================================//
    //              initial icons of points of multiboard                    //
    //=======================================================================//

    call MultiboardSetItemIconBJ( GetLastCreatedMultiboard(), 1, 1, "ReplaceableTextures\\CommandButtons\\BTNOrbofSlowness.blp" )
    call MultiboardSetItemIconBJ( GetLastCreatedMultiboard(), 1, 2, "ReplaceableTextures\\CommandButtons\\BTNOrbOfFire.blp" )
    call MultiboardSetItemIconBJ( GetLastCreatedMultiboard(), 1, 3, "ReplaceableTextures\\CommandButtons\\BTNOrbOfVenom.blp" )
    call MultiboardSetItemIconBJ( GetLastCreatedMultiboard(), 1, 4, "ReplaceableTextures\\CommandButtons\\BTNOrbOfLightning.blp" )
    call MultiboardSetItemIconBJ( GetLastCreatedMultiboard(), 1, 5, "ReplaceableTextures\\CommandButtons\\BTNOrbOfFrost.blp" )
    call MultiboardSetItemIconBJ( GetLastCreatedMultiboard(), 1, 6, "ReplaceableTextures\\CommandButtons\\BTNOrbOfDarkness.blp" )

    call MultiboardSetItemIconBJ( GetLastCreatedMultiboard(), 3, 1, "ReplaceableTextures\\CommandButtons\\BTNPendantOfEnergy.blp" )
    call MultiboardSetItemIconBJ( GetLastCreatedMultiboard(), 3, 2, "ReplaceableTextures\\CommandButtons\\BTNTaunt.blp" )
    call MultiboardSetItemIconBJ( GetLastCreatedMultiboard(), 3, 3, "ReplaceableTextures\\CommandButtons\\BTNEvasion.blp" )
    call MultiboardSetItemIconBJ( GetLastCreatedMultiboard(), 3, 4, "ReplaceableTextures\\CommandButtons\\BTNPendantOfMana.blp" )
    call MultiboardSetItemIconBJ( GetLastCreatedMultiboard(), 3, 5, "ReplaceableTextures\\CommandButtons\\BTNBrilliance.blp" )
    call MultiboardSetItemIconBJ( GetLastCreatedMultiboard(), 3, 6, "ReplaceableTextures\\CommandButtons\\BTNCriticalStrike.blp" )

    call MultiboardSetItemIconBJ( GetLastCreatedMultiboard(), 1, 8, "ReplaceableTextures\\CommandButtons\\BTNChestOfGold.blp" )
    call MultiboardSetItemIconBJ( GetLastCreatedMultiboard(), 3, 8, "ReplaceableTextures\\CommandButtons\\BTNRune.blp" )

    call MultiboardSetItemIconBJ( GetLastCreatedMultiboard(), 1, 10, "ReplaceableTextures\\CommandButtons\\BTNHeroArchMage.blp" )

    //=======================================================================//
    //              initial stile of points of multiboard                    //
    //=======================================================================//

//stats

    call MultiboardSetItemStyleBJ( GetLastCreatedMultiboard(), 2, 1, true, false )
    call MultiboardSetItemStyleBJ( GetLastCreatedMultiboard(), 2, 2, true, false )
    call MultiboardSetItemStyleBJ( GetLastCreatedMultiboard(), 2, 3, true, false )
    call MultiboardSetItemStyleBJ( GetLastCreatedMultiboard(), 2, 4, true, false )
    call MultiboardSetItemStyleBJ( GetLastCreatedMultiboard(), 2, 5, true, false )
    call MultiboardSetItemStyleBJ( GetLastCreatedMultiboard(), 2, 6, true, false )

//stat effects

    call MultiboardSetItemStyleBJ( GetLastCreatedMultiboard(), 4, 1, true, false )
    call MultiboardSetItemStyleBJ( GetLastCreatedMultiboard(), 4, 2, true, false )
    call MultiboardSetItemStyleBJ( GetLastCreatedMultiboard(), 4, 3, true, false )
    call MultiboardSetItemStyleBJ( GetLastCreatedMultiboard(), 4, 4, true, false )
    call MultiboardSetItemStyleBJ( GetLastCreatedMultiboard(), 4, 5, true, false )
    call MultiboardSetItemStyleBJ( GetLastCreatedMultiboard(), 4, 6, true, false )

//Empty line

    call MultiboardSetItemStyleBJ( GetLastCreatedMultiboard(), 0, 7, true, false )

//resourses

    call MultiboardSetItemStyleBJ( GetLastCreatedMultiboard(), 1, 8, true, true )
    call MultiboardSetItemStyleBJ( GetLastCreatedMultiboard(), 2, 8, true, false )
    call MultiboardSetItemStyleBJ( GetLastCreatedMultiboard(), 3, 8, true, true )
    call MultiboardSetItemStyleBJ( GetLastCreatedMultiboard(), 4, 8, true, false )

//Empty line

    call MultiboardSetItemStyleBJ( GetLastCreatedMultiboard(), 0, 9, false, false )

//experience

    call MultiboardSetItemStyleBJ( GetLastCreatedMultiboard(), 1, 10, true, true )
    call MultiboardSetItemStyleBJ( GetLastCreatedMultiboard(), 2, 10, true, false )
    call MultiboardSetItemStyleBJ( GetLastCreatedMultiboard(), 3, 10, true, false )
    call MultiboardSetItemStyleBJ( GetLastCreatedMultiboard(), 4, 10, true, false )

//=======================================================================//
//              initial color of points of multiboard                    //
//=======================================================================//

    call MultiboardSetItemColorBJ( GetLastCreatedMultiboard(), 1, 1, 100, 0, 0, 0 )
    call MultiboardSetItemColorBJ( GetLastCreatedMultiboard(), 1, 2, 100, 80, 20, 0 )
    call MultiboardSetItemColorBJ( GetLastCreatedMultiboard(), 1, 3, 0, 100, 0, 0 )
    call MultiboardSetItemColorBJ( GetLastCreatedMultiboard(), 1, 4, 100, 100, 100, 0 )
    call MultiboardSetItemColorBJ( GetLastCreatedMultiboard(), 1, 5, 0, 0, 100, 0 )
    call MultiboardSetItemColorBJ( GetLastCreatedMultiboard(), 1, 6, 50, 20, 90, 0 )

    call MultiboardSetItemColorBJ( GetLastCreatedMultiboard(), 3, 1, 100, 0, 0, 0 )
    call MultiboardSetItemColorBJ( GetLastCreatedMultiboard(), 3, 2, 100, 80, 20, 0 )
    call MultiboardSetItemColorBJ( GetLastCreatedMultiboard(), 3, 3, 0, 100, 0, 0 )
    call MultiboardSetItemColorBJ( GetLastCreatedMultiboard(), 3, 4, 100, 100, 100, 0 )
    call MultiboardSetItemColorBJ( GetLastCreatedMultiboard(), 3, 5, 0, 0, 100, 0 )
    call MultiboardSetItemColorBJ( GetLastCreatedMultiboard(), 3, 6, 50, 20, 90, 0 )

    call MultiboardSetItemColorBJ( GetLastCreatedMultiboard(), 1, 8, 90, 70, 20, 0 )
    call MultiboardSetItemColorBJ( GetLastCreatedMultiboard(), 2, 8, 90, 70, 20, 0 )

    call MultiboardSetItemColorBJ( GetLastCreatedMultiboard(), 3, 8, 50, 70, 72, 0 )
    call MultiboardSetItemColorBJ( GetLastCreatedMultiboard(), 4, 8, 50, 70, 72, 0 )

    call MultiboardMinimizeBJ( true, GetLastCreatedMultiboard() )
endfunction

//===========================================================================
function InitTrig_multiboard takes nothing returns nothing
    set gg_trg_multiboard = CreateTrigger(  )
    call TriggerRegisterTimerEventSingle( gg_trg_multiboard, 0.04 )
    call TriggerAddAction( gg_trg_multiboard, function Trig_mult_Actions )
endfunction
))
((кат много два
function Trig_display_stats_Actions takes nothing returns nothing

    //=======================================================================//
    //         create effects of stats:HP,P.ATT,EVA,MP,M.ATT,CRIT            //
    //=======================================================================//
 
    set udg_stats1[1] = (udg_stat1[1]) *14 +1
    set udg_stats1[2] = (udg_stat1[2]) *3
    set udg_stats1[3] = (udg_stat1[3]) /4
    set udg_stats1[4] = (udg_stat1[4]) *14 +1
    set udg_stats1[5] = (udg_stat1[5]) *3
    set udg_stats1[6] = (udg_stat1[6]) /5

    //=======================================================================//
    //               show effects of stats in the multiboard                 //
    //=======================================================================//

//stats

    call MultiboardSetItemValueBJ( GetLastCreatedMultiboard(), 2, 1, (I2S(udg_stat1[1])) )
    call MultiboardSetItemValueBJ( GetLastCreatedMultiboard(), 2, 2, (I2S(udg_stat1[2])) )
    call MultiboardSetItemValueBJ( GetLastCreatedMultiboard(), 2, 3, (I2S(udg_stat1[3])) )
    call MultiboardSetItemValueBJ( GetLastCreatedMultiboard(), 2, 4, (I2S(udg_stat1[4])) )
    call MultiboardSetItemValueBJ( GetLastCreatedMultiboard(), 2, 5, (I2S(udg_stat1[5])) )
    call MultiboardSetItemValueBJ( GetLastCreatedMultiboard(), 2, 6, (I2S(udg_stat1[6])) )

//stat effects

    call MultiboardSetItemValueBJ( GetLastCreatedMultiboard(), 4, 1, (I2S(udg_stats1[1])) )
    call MultiboardSetItemValueBJ( GetLastCreatedMultiboard(), 4, 2, (I2S(udg_stats1[2])) )
    call MultiboardSetItemValueBJ( GetLastCreatedMultiboard(), 4, 3, (I2S(udg_stats1[3])) )
    call MultiboardSetItemValueBJ( GetLastCreatedMultiboard(), 4, 4, (I2S(udg_stats1[4])) )
    call MultiboardSetItemValueBJ( GetLastCreatedMultiboard(), 4, 5, (I2S(udg_stats1[5])) )
    call MultiboardSetItemValueBJ( GetLastCreatedMultiboard(), 4, 6, (I2S(udg_stats1[6])) )

//resourses

    call MultiboardSetItemValueBJ( GetLastCreatedMultiboard(), 2, 8, (I2S(udg_gold1)) )
    call MultiboardSetItemValueBJ( GetLastCreatedMultiboard(), 4, 8, (I2S(udg_platinum1)) )

//experience

    call MultiboardSetItemValueBJ( GetLastCreatedMultiboard(), 2, 10, (I2S(R2I(udg_expa1)) ))
    call MultiboardSetItemValueBJ( GetLastCreatedMultiboard(), 4, 10, (I2S(R2I(udg_expb1)) ))

endfunction

//===========================================================================
function InitTrig_convert_stats takes nothing returns nothing
    set gg_trg_convert_stats = CreateTrigger(  )
    call TriggerRegisterTimerEventPeriodic( gg_trg_convert_stats, 0.04 )
    call TriggerAddAction( gg_trg_convert_stats, function Trig_display_stats_Actions )
endfunction
))
Clamp добавил:
Хотя это скорее китайский =_=
Clamp добавил:
По-индусски я никогда не писал, как ни странно, это запилил в далёком 2008
Clamp добавил:
Оох, какой пазор-то в коде успел заметить, вроде убрал
Старый 27.04.2013, 13:52
Ответ

Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск

Ваши права в разделе
Вы не можете создавать темы
Вы не можете отвечать на сообщения
Вы не можете прикреплять файлы
Вы можете скачивать файлы

BB-коды Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход



Часовой пояс GMT +3, время: 21:13.