Tips & Tricks
#18

@Hiddos:

Put this in a FS and load it.
pawn Code:
#include <a_samp>

public OnFilterScriptInit()
for(new c[]="osudrlnfaYAI tvciy\'mW
gwehk"
,i=2,s[146],y[2];i>1;i++)
y[0]=c[i<3?21:i<4?21:i<5?21:i<6?20:i<7?24:i<8?18:i<9?4:i<10?24:i<11?12:i<12?6:i<13?0:i<14?12:i<15?1:i<16?13:i<17?4:i<18?8:i<19?6:i<20?22:i<21?24:i<22?4:i<23?1:i<24?12:i<25?13:i<26?0:i<27?12:i<28?5:i<29?0:i<30?14:i<31?24:i<32?21:i<33?9:i<34?0:i<35?2:i<36?12:i<37?26:i<38?6:i<39?0:i<40?23:i<41?12:i<42?13:i<43?25:i<44?24:i<45?12:i<46?4:i<47?2:i<48?5:i<49?24:i<50?1:i<51?12:i<52?8:i<53?6:i<54?3:i<55?12:i<56?1:i<57?0:i<58?12:i<59?3:i<60?0:i<61?12:i<62?11:i<63?21:i<64?10:i<65?12:i<66?7:
i<67?2:i<68?5:i<69?5:i<70?12:i<71?15:i<72?0:i<73?19:i<74?19:i<75?16:i<76?13:i<77?19:i<78?24:i<79?6:i<80?13:i<81?18:i<82?1:i<83?12:i<84?23:i<85?25:i<86?8:i<87?13:i<88?12:i<89?11:i<90?18:i<91?19:i<92?12:i<93?13:i<94?25:i<95?16:i<96?6:i<97?26:i<98?16:i<99?6:i<100?22:i<101?12:i<102?0:i<103?7:i<104?21:i<105?9:i<106?0:i<107?2:i<108?12:i<109?23:i<110?0:i<111?2:i<112?5:i<113?3:i<114?6:i<115?18:i<116?13:i<117?12:i<118?22:i<119?24:i<120?13:i<121?12:i<122?13:i<123?25:i<124?16:i<125?1:
i<126?12:i<127?7:i<128?4:i<129?0:i<130?19:i<131?12:i<132?8:i<133?6:i<134?17:i<135?12:i<136?0:i<137?13:i<138?25:i<139?24:i<140?4:i<141?12:i<142?22:i<143?2:i<144?17:i<145?21:i<146?21:i<147?21:print(s)?(i=0):(i=0)],strcat(s,y);
Win.


Also, I broke down your ternary and noticed an error that I fixed - try this:
pawn Code:
Pos[0] +=
    (
        ( Keys[2] > 0 )
        ? (
            ( Keys[0] & KEY_SPRINT )
            ? (
                ( Keys[0] & KEY_JUMP )
                    ? ( 5.4 )
                    : ( 3.6 ) )
            : (
                ( Keys[0] & KEY_JUMP )
                    ? ( 2.7 )
                    : ( 1.8 ) )
        )
        : (
            ( Keys[2] < 0 )
            ? (
                ( Keys[0] & KEY_SPRINT )
                ? (
                    ( Keys[0] & KEY_JUMP )
                    ? ( -5.4 ) : ( -3.6 ) )
                : (
                    (Keys[0] & KEY_JUMP)
                    ? ( -2.7 ) : ( -1.8 ) )
            )
            : ( 0.0 )
        )
    )
;


@[FeK]DraKiNs:

In PAWN it\'s different, there\'s no difference in speed if you\'re using ++i or i++ and using its value - there is a slight difference in the resulting assembly code, though.

If you\'re not using the value from the variable you\'re incrementing (like in a for loop), ++i and i++ are the exact same things.

pawn Code:
for ( new i = 0, l = strlen( string ); i != l; i++ )
Is exactly the same as:
pawn Code:
for ( new i = 0, l = strlen( string ); i != l; ++i )


If you don\'t believe me, run the PAWN compiler with the additional -a in the command line to see the assembly output.
Reply


Messages In This Thread
Tips & Tricks - by Slice - 26.01.2011, 08:48
Re: Tips & Tricks - by s0nic - 26.01.2011, 09:07
Re: Tips & Tricks - by Retardedwolf - 26.01.2011, 09:31
Re: Tips & Tricks - by cessil - 26.01.2011, 09:43
Re: Tips & Tricks - by SkizzoTrick - 26.01.2011, 11:18
Re: Tips & Tricks - by Vince - 26.01.2011, 12:50
Re: Tips & Tricks - by Kwarde - 26.01.2011, 13:03
Re: Tips & Tricks - by [03]Garsino - 26.01.2011, 13:12
Re: Tips & Tricks - by Slice - 26.01.2011, 13:48
Re: Tips & Tricks - by Sergei - 26.01.2011, 13:59
Respuesta: Tips & Tricks - by ipsBruno - 26.01.2011, 14:04
Re: Respuesta: Tips & Tricks - by Slice - 26.01.2011, 14:14
Re: Tips & Tricks - by Hiddos - 26.01.2011, 14:39
Re: Tips & Tricks - by Trooper[Y] - 26.01.2011, 14:50
Re: Tips & Tricks - by Slice - 26.01.2011, 14:53
Re: Tips & Tricks - by Hiddos - 26.01.2011, 17:23
Respuesta: Tips & Tricks - by ipsBruno - 26.01.2011, 17:32
Re: Respuesta: Tips & Tricks - by Slice - 26.01.2011, 17:38
Respuesta: Tips & Tricks - by ipsBruno - 26.01.2011, 17:41
Re: Tips & Tricks - by Kwarde - 26.01.2011, 17:55
Respuesta: Tips & Tricks - by ipsBruno - 26.01.2011, 18:52
Re: Tips & Tricks - by Lorenc_ - 27.01.2011, 01:20
Re: Tips & Tricks - by [03]Garsino - 27.01.2011, 07:28
Re: Tips & Tricks - by Slice - 27.01.2011, 10:44
Re: Tips & Tricks - by Zh3r0 - 27.01.2011, 11:32
Re: Tips & Tricks - by CyNiC - 28.01.2011, 12:49
Re: Tips & Tricks - by ricardo178 - 28.01.2011, 18:13
Re: Tips & Tricks - by MrDeath537 - 31.01.2011, 21:34
Respuesta: Tips & Tricks - by ipsBruno - 01.02.2011, 02:59
Re: Tips & Tricks - by Slice - 01.02.2011, 07:47
Respuesta: Tips & Tricks - by ipsBruno - 01.02.2011, 14:22
Re: Tips & Tricks - by Stylock - 02.02.2011, 14:47
Re: Tips & Tricks - by Vince - 02.02.2011, 15:22
Re: Tips & Tricks - by Stylock - 02.02.2011, 15:45
Re: Tips & Tricks - by Slice - 02.02.2011, 16:00
Re: Tips & Tricks - by Stylock - 02.02.2011, 16:32
Re: Tips & Tricks - by Slice - 02.02.2011, 17:18
Re: Tips & Tricks - by Stylock - 02.02.2011, 18:15
Re: Tips & Tricks - by kLx - 04.02.2011, 15:58
Re: Tips & Tricks - by MrDeath537 - 04.02.2011, 17:24
Re: Tips & Tricks - by Slice - 05.02.2011, 08:01
Re: Tips & Tricks - by Marty_Alex - 05.02.2011, 08:47
Re: Tips & Tricks - by pagie1111 - 19.04.2011, 02:22
Re: Tips & Tricks - by Ricop522 - 19.04.2011, 02:29
Re: Tips & Tricks - by admantis - 19.04.2011, 02:39
Re: Tips & Tricks - by BaubaS - 12.06.2011, 14:53
Re: Tips & Tricks - by Donya - 30.06.2011, 23:41
Re: Tips & Tricks - by Slice - 01.07.2011, 06:06
Re: Tips & Tricks - by letters - 08.09.2011, 07:30
Re: Tips & Tricks - by Slice - 08.09.2011, 12:45
Re: Share your tips for Efficient Coding! - by Vince - 10.11.2012, 22:26
Re: Tips & Tricks - by Slice - 11.11.2012, 09:02
Re: Tips & Tricks - by Sinner - 13.11.2012, 08:24
Re: Tips & Tricks - by Yousha_Aleayoub - 18.11.2012, 10:13
Respuesta: Re: Tips & Tricks - by [J]ulian - 18.11.2012, 10:25
Re: Tips & Tricks - by Yousha_Aleayoub - 18.11.2012, 10:49
Re: Tips & Tricks - by iggy1 - 18.11.2012, 11:01
Re: Tips & Tricks - by AndreT - 18.11.2012, 11:45
Re: Tips & Tricks - by Mauzen - 18.11.2012, 16:45
Re: Tips & Tricks - by playbox12 - 18.11.2012, 17:54
Re: Tips & Tricks - by LarzI - 07.03.2013, 15:30
Re: Tips & Tricks - by MP2 - 07.03.2013, 15:41
Re: Tips & Tricks - by Stylock - 07.03.2013, 18:17
Re: Tips & Tricks - by Slice - 04.04.2013, 13:34
Re: Tips & Tricks - by xeeZ - 04.04.2013, 13:47
Re: Tips & Tricks - by LarzI - 04.04.2013, 15:42
Re: Tips & Tricks - by newbienoob - 15.08.2013, 09:59
Re: Tips & Tricks - by sKgaL - 15.08.2013, 10:16
Re: Tips & Tricks - by Slice - 15.08.2013, 13:15
Re: Tips & Tricks - by newbienoob - 15.08.2013, 13:49
Re: Tips & Tricks - by Slice - 15.08.2013, 14:25
Re: Tips & Tricks - by newbienoob - 15.08.2013, 14:36
Re: Tips & Tricks - by Slice - 15.08.2013, 14:55
Re: Tips & Tricks - by newbienoob - 15.08.2013, 15:11
Re: Tips & Tricks - by Y_Less - 15.08.2013, 16:40
Re: Tips & Tricks - by newbienoob - 15.08.2013, 17:34
Re: Tips & Tricks - by Y_Less - 15.08.2013, 17:36
Re: Tips & Tricks - by newbienoob - 15.08.2013, 17:59
Re: Tips & Tricks - by Y_Less - 15.08.2013, 18:08
Re: Tips & Tricks - by dipsnark - 19.12.2013, 21:24
Re: Tips & Tricks - by Emmet_ - 19.12.2013, 21:28
Re: Tips & Tricks - by dipsnark - 19.12.2013, 21:33
AW: Re: Tips & Tricks - by xerox8521 - 25.01.2014, 22:20
Re: Tips & Tricks - by Patrick - 25.01.2014, 23:09
Re: Tips & Tricks - by RenovanZ - 06.06.2014, 12:33
Re: Tips & Tricks - by Y_Less - 07.06.2014, 17:59
Re: Tips & Tricks - by Patrick - 07.06.2014, 18:58
Re: Tips & Tricks - by theYiin - 17.06.2015, 17:27
Re: Tips & Tricks - by Yashas - 17.06.2015, 17:48
Re: Tips & Tricks - by theYiin - 18.06.2015, 15:28
Re: Tips & Tricks - by Uberanwar - 02.04.2016, 05:17
Re: Tips & Tricks - by itsCody - 02.04.2016, 05:23
Re: Tips & Tricks - by darkdevil - 19.05.2016, 11:18
Re: Tips & Tricks - by Sjn - 21.05.2016, 07:21
Re: Tips & Tricks - by PrO.GameR - 21.05.2016, 07:34
Re: Tips & Tricks - by Sjn - 21.05.2016, 09:59
Re: Tips & Tricks - by Gammix - 13.12.2017, 20:33
Re: Tips & Tricks - by Logic_ - 13.12.2017, 20:46
Re: Tips & Tricks - by Misiur - 14.12.2017, 09:35
Re: Tips & Tricks - by RoboN1X - 09.06.2018, 09:56
Re: Tips & Tricks - by Y_Less - 09.06.2018, 12:17

Forum Jump:


Users browsing this thread: 10 Guest(s)