Stagger Encode FIXED

Submit

Your name:
File:
Open code-statistics:

Language is selected by the extension of the file. See the list of supported languages to know the extension of your language.

Problem

Encode each line of input by putting the first character at the start of the line, the second character at the end of the line, and each consecutive character alternating between the front and the back of the line, working inwards.

eg.
Red Random
RdRnomda e

Options

exec is denied

no deadline, the server will not save your submission

Sample input:_

Code golf
From Wikipedia, the free encyclopedia
Jump to: navigation, search
An example round of code golf running on 4clojure.com, showing the problem expressed as a series of unit tests, special requirements for the round's problem, and a results graph (the "league") with a personal score.

Code golf is a type of recreational computer programming competition in which participants strive to achieve the shortest possible code that implements a certain algorithm. Such tournaments may also be named with the programming language used (for example Perl golf).
Contents

    1 History
    2 Etymology
    3 Languages designed specifically for golfing
    4 Types of code golf
    5 Tournaments by language
    6 See also
    7 External links
    8 References

History

Whilst the term was apparently first used in 1999 with Perl,[1] and later popularised through the use of Perl to write a program that performed RSA encryption,[2] similar informal competition was known to have been popular with earlier APL hackers and probably others. Today the term has grown to be applied to a wide variety of languages.
Etymology

The term is derived from the similarity of its scoring system with that of conventional golf - ie: participants seek to achieve the lowest possible score, rather than the highest as is the standard in most sports' scoring systems.
Languages designed specifically for golfing

Several new languages have been created specifically with code golfing in mind. The most well-known examples are Golfscript and Flogscript, both stack-based Turing-complete languages which provide powerful constructs for concisely expressing ideas in code.
Types of code golf

Some code golf questions, such as those posed on general programming sites, may not require implementation in a specific programming language. However, this is limits the style of problems that it is possible for the problem designers to pose (for example, by limiting the use of certain language features). In addition, the creation of such 'open' questions has resulted in the design of code golf specific programming language dialects such as REBMU (a dialect of REBOL). Both online and live competitions may also include time limits.
Tournaments by language

    A+, Ada, Arc, Asymptote, Awk, Bash, BASIC, bc, Befunge, Brainfuck, C, C#, C++, Clojure, COBOL, Common Lisp, Curry, Cyan, D, dc, DOS, Erlang, FerNANDo, fish, FlogScript, Forth, Fortran, GNU Assembler, Go, GolfScript, goruby, Grass, Groovy, Haskell, Io, J, Java, Javascript, JVM, Kite, Lazy-K, GNU LilyPond, LMNtal, Logo, Lua, GNU m4, Maxima, Mind, Minus, Nemerle, Objective-C, Pascal, Pefunge, Perl, Perl 6, PHP, Postscript, Prolog, Python, QCL, R, REBOL, Ruby, Scala, Scheme, sed, Smalltalk, Tcl, Universal Lambda, Unlambda, VHDL, vi, wake, Whirl, Whitespace, x86, Xtal, Z80, zsh
        Ongoing
            Anarchy Golf (online)[3]
    Clojure
        Ongoing
            4clojure.com (online)[4]
    K
        Ongoing
            Kona code golf (online)
    PHP
        Ongoing
            phpGolf (online)
    Perl
        Historical
            2000, July: Perl Golf Apocalypse at Perl Conference 4.0, Monterey California.
    Perl, PHP, Ruby and Python
        Ongoing
            CodeGolf (online)
    Vim
        Ongoing
            VimGolf

See also

    Perl pastimes

External links

    StackOverflow.com: Questions tagged with 'code-golf'
    CodeGolf.StackExchange.com: Questions and answers on programming puzzles and code golf

References

    ^ Greg Bacon (1999-05-28). "Re: Incrementing a value in a slice". comp.lang.perl.misc. (Web link). Retrieved 2011-07-12.
    ^ Back, Adam. "RSA in 5 lines of perl". Retrieved 2011-01-10.
    ^ "Anarchy Golf".
    ^ "4clojure League". Retrieved 2011-07-24. "While the primary purpose of 4clojure.com is to teach Clojure "by doing", you may also choose to compete for the shortest solution. This is affectionately known as code golf: the lower your score the better, get it? If you choose to participate, we'll score your correct solutions based on the number of non-whitespace characters (and some more metrics in the future). We'll also provide a chart showing how you stack up compared to everyone else on the site."

Sample output:

Cd oflgeo
Fo iiei,tefe nylpdaieocceer h adpkWmr
Jm o aiain erhcas,otgvn:tpu
A xml on fcd ofrnigo couecm hwn h rbe xrse sasre fui et,seilrqieet o h on' rbe,adarslsgah(h lau" ihaproa cr.eoslnse  tw)ege"et pr tue  n mlopsduretrfsnmrue acp ssttn osie  adsepemlopetgios,o.rjl4n nnu lgeo odurepaen

Cd ofi  yeo erainlcmue rgamn optto nwihpriiat tiet civ h hretpsil oeta mlmnsacranagrtm uhtunmnsmyas enmdwt h rgamn agaeue freapePr of.)lgle lmx o(ds gunlgimropethi ea bol a tearo cS.hiol ite  teepith dcebso stoseteehao vrssnpcta ch iniiemcgimroprtpo aotecrf ptas lgeo
Cnetsnto

  1Hsoyrti   
  2Eyooyglmt   
  3Lnugsdsge pcfclyfrglignfo o laiiesdnie eaga   
  4Tpso oeglfo dcf ey   
  5Tunmnsb agaegunly tearo   
  6Seasol e   
  7Etra iksnllnex   
  8Rfrnesceee   

Hsoyrti

Wis h emwsaprnl is sdi 99wt el[]adltrpplrsdtruhteueo elt rt  rga htpromdRAecyto,2 iia nomlcmeiinwskont aebe oua iherirALhcesadpoal tes oa h emhsgont eapidt  ievreyo agae.sgunlf tia dwao elp bo wr a rtetydT.rhoybbr n rka P ela twrlppne vho wn a ottpo arfirlms][niprn S erfe atmropaeiwo rPf s h goh eiauo ea n 1,rPhi 91n eutrfyteap a rtettlh
Eyooyglmt

Tetr sdrvdfo h iiaiyo t crn ytmwt hto ovninlgl  e atcpnsse oaheetelws osbesoe ahrta h ihs si h tnadi otsot'soigsses.mty nrc srp smn rdasets ateghetnh etr,rc lispteo h vic tke taiirp:i-fo aotencf athi essgiossif trlmsetmr eie ime h
Lnugsdsge pcfclyfrglignfo o laiiesdnie eaga

Svrlnwlnugshv encetdseiial ihcd ofn nmn.Tems elkoneape r ofcitadFosrp,bt tc-ae uigcmlt agae hc rvd oeflcntut o ocsl xrsigiesi oe.dcn ad nsepeyeincrfscrso urwpeiophiwsgunleepo-nrTdsbkasho ticgl n prslGeaslmx wn-lwto h di igilgeo twylcfcp ear ebea eaga e aee
Tpso oeglfo dcf ey

Sm oegl usin,sc stoepsdo eea rgamn ie,myntrqieipeetto naseii rgamn agae oee,ti slmt h tl fpolm hti spsil o h rbe einr ops freape ylmtn h s fcranlnug etrs.I diin h raino uh'pn usin a eutdi h eino oegl pcfcpormiglnug ilcssc sRBU( ilc fRBL.Bt nieadlv opttosmyas nld ielmt.sii mteuciol a niiemcei n nloho )OE oteada ME ahu teadeaga nmagr iiesfo dcf gsdetn elsrshsoteq'eo csf otecet,otdan )euafeaga ite oeuetgiii b,lmx o(eo tsegsdmlopetrfebso it atsebr oeysetsii ish rvwH.gunlgimropcfcp  inianmlm rue o a stsgimroplrngn eo sh ahu soteqfo dceo
Tunmnsb agaegunly tearo

  A,Aa r,Aypoe w,Bs,BSC c eug,Banuk ,C,C+ ljr,CBL omnLs,Cry yn ,d,DS rag eNNo ih lgcit ot,Frrn N sebe,G,GlSrp,grb,Gas roy akl,I,J aa aacit V,Kt,Lz-,GULlPn,LNa,Lg,La N 4 aia id iu,Nmre betv-,Psa,Pfne el el6 H,Pssrp,Poo,Pto,QL ,RBL uy cl,Shm,sd mltl,Tl nvra aba naba HL i ae hr,Wiepc,x6 tl 8,zhs 0Z,aX,8 easth liW,kw,v,DV,dmlU,dmLlseiU,c kalaS,e eec aaS,bR,OE R,C nhy glr ticto PP, rP,rP,gue lca CeicjO,lee snM,nM,mxM,mUG,u oo ltM doyi N Kya ei MJ,prsvJ,vJ, o lesH,voG,sr yuo ticfo o rlmsAUG,ato hrF,prSoF,sf,DArF,nlE,O c D,aC,ru pi omC,OO euoC,+ # C,cfir enfB,b,IA ha kA,ttms cA,d +  
    Ogignon    
      AacyGl oln)3][ein(fo hrn      
  Couerjl  
    Ogignon    
      4ljr.o oln)4][ein(mceuoc      
  K  
    Ogignon    
      Kn oegl oln)ein(fo dcao      
  PPH  
    Ogignon    
      ppof(nie)nlo lGh      
  Prle  
    Hsoialcrti    
      20,Jl:Pr ofAoays tPr ofrne40 otryClfri.anoia eenM,. ceenCle aeplcp lGle yu 00      
  Pr,PP uyadPtonhy n bR,H le  
    Ogignon    
      CdGl oln)ein(foeo      
  Vmi  
    Ogignon    
      VmoflGi      

Seasol e

  Pr atmseisple  

Etra iksnllnex

  Sakvrlwcm usin agdwt cd-of'lgeo'hi egtsoteQ:o.ofeOct  
  CdGl.tcEcag.o:Qetosadaseso rgamn uze n oeglfo dcdaslzpgimropn rwn n nisu mcenhxkaSfoeo  

Rfrnesceee

  ^Ge ao 19-52) R:Iceetn  au nasie.cm.agpr.ic Wbln) eree 010-2.17-12dvitR.ki e(.smle.nlpo "cl  ielvaginmrn e".8-099(ncBgr   
  ^Bc,Aa."S n5lnso el.Rtivd21-11.0-010 eere "rpf ei  iAR md ka   
  ^"nrh of."lGycaA   
  ^"coueLau" eree 010-4 Wietepiayproeo couecmi otahCoue"ydig,yumyas hoet opt o h hretslto.Ti safcintl nw scd of h oe orsoetebte,gti?I o hoet atcpt,w'lsoeyu orc ouin ae ntenme fnnwiepc hrces(n oemr erc nteftr) el lopoieacatsoighwyusaku oprdt vroees ntest."ei h oel nyeeo eamcp ct o o nwh rh  dvr sal'W.euu h isitmeo msda rtaaceasth-o orbu h odsbsotlstercro rc le eaiirpo socuyf t e rte h rc uyrwlet:lgeo anokyeaotef ish niuo stosetrfeemco socol a o "no b rjl ce ts o.rjl4f spu rmr h lh".27-12dvitR.ege rjl4   

Sample input:_

Remember when you ran away and I got on my knees and begged you not to
leave because I'd go berserk?? Well...
You left me anyhow and then the days got worse and worse and now you see
I've gone completely out of my mind.. And..

They're coming to take me away, ha-haaa!!
They're coming to take me away, ho-ho, hee-hee, ha-haaa
To the funny farm. Where life is beautiful all the time and I'll be
happy to see those nice young men in their clean white coats and they're
coming to take me away, ha-haaa!!!!!

You thought it was a joke and so you laughed, you laughed when I had said
that loosing you would make me flip my lid.. RIGHT???
I know you laughed, I heard you laugh, you laughed you laughed and
laughed and then you left, but now you know I'm utterly mad... And..

They're coming to take me away, ha-haaa,
They're coming to take me away, ho-ho, hee-hee, ha-haaa.
To the happy home. With trees and flowers and chirping birds and basket
weavers who sit and smile and twiddle their thumbs and toes and they're
coming to take me away, ha-haaa!!!

I cooked your food, I cleaned your house, and this is how you pay me back
for all my kind unselfish loving deeds.. Huh??
Well you just wait, they'll find you yet and when they do they'll put you
in the ASPCA, you mangy mutt!!! And...

They're coming to take me away, ha-haaa.
They're coming to take me away, ho-ho, hee-hee, ha-haaa.
To the funny farm, where life is beautiful all the time and I'll be happy
to see those nice young men in their clean white coats and they're coming
to take me away, ha-haaa!!!
To the happy home, with trees and flowers and chirping birds and basket
weavers who sit and smile and twiddle their thumbs and toes and they're
coming to take me away, ha-haa!!!
To the funny farm, where life is beautiful all the time... (fade out)

Hey, buddy!
Yes officer..
You a head?
No, but I'm catching up, ha ha ha.... 

Sample output:

Rmme hnyurnaa n  o nm ne n egdyuntto o o egbdaseky otgIdayw a o ewrbee
laebcueIdg esr? el...lW?kerbo ' sae ve
Yulf eayo n hntedy o os n os n o o eesuywndaerwdaerwtgsa h etdawhn mte o
Iv oecmltl u fm id.Ad..n .nmy otoyeepo nge'

Te'ecmn otk eaa,h-aa!!aha yw mea tgio ryh
Te'ecmn otk eaa,h-o e-e,h-aaaha eheh,ho yw mea tgio ryh
T h un am hr iei euiu l h ieadIl ebl' n mtetlalftabs fleeW.rfynfeto
hpyt e hs ieyugmni hi la ht ot n hyre'etdasaceiwnecretn e no cneoteso pa
cmn otk eaa,h-aa!!!!!aha yw mea tgio

Yutogti a  oeads o age,yuluhdwe  a adisdhInh ega o dhuluyo n kjaswt huh o
ta osn o ol aem lpm i. IH???TGR.dly ife kmduwuygiolth
Iko o age,Ihadyuluh o age o age ndadhuluydhuluy,ga o re  dhuluywn 
luhdadte o et u o o nwImutrymd. n..dA..a let ' okuywntb,fluynh n ega

Te'ecmn otk eaa,h-aa,aha yw mea tgio ryh
Te'ecmn otk eaa,h-o e-e,h-aa.aha eheh,ho yw mea tgio ryh
T h ap oe ihtesadfoesadcipn id n aktesbdasrbgirh n rwl n er tW.mhypheto
waeswostadsieadtidetertub n osadte'eryh n etdasmh ih ldw n lm n i h rve
cmn otk eaa,h-aa!!!aha yw mea tgio

Icoe orfo,Icendyu os,adti shwyupym akcbe a o o ish n euhro eal  do uydko 
fralm iduslihlvn ed. u??hH.sedgio sfen nky l o
Wl o utwi,te'lfn o e n hnte ote'lptyuo u lyh dyh ewdatyuydi lyh ta sjuyle
i h SC,yumnymt!!Ad...n !tu ga o APAetn

Te'ecmn otk eaa,h-aa.aha yw mea tgio ryh
Te'ecmn otk eaa,h-o e-e,h-aa.aha eheh,ho yw mea tgio ryh
T h un am hr iei euiu l h ieadIl ehpypa bl' n mtetlalftabs fleew,rfynfeto
t e hs ieyugmni hi la ht ot n hyr oignmce'etdasaceiwnecretn e no cneoteso
t aem wy aha!!!aa-h,aae kto
T h ap oe ihtesadfoesadcipn id n aktesbdasrbgirh n rwl n er tw,mhypheto
waeswostadsieadtidetertub n osadte'eryh n etdasmh ih ldw n lm n i h rve
cmn otk eaa,h-a!!!aha yw mea tgio
T h un am hr iei euiu l h ie. fd u)toea(..mtetlalftabs fleew,rfynfeto

Hy ud!ydb,e
Ysofcr..eif e
Yuaha?de  o
N,btImcthn p ah a.. ..ha h,ugica ' u o

Ranking

Ruby _

RankUserSizeTimeDateStatistics
1mitchs440.03162019/02/05 10:23:100B / 20B / 22B
2llhuii440.03122019/02/08 20:35:200B / ?B / ?B
3leonid480.03522012/08/03 11:15:150B / 21B / 24B
4yvl480.03242012/08/21 04:28:320B / 16B / 29B
5clock490.05422012/08/03 11:29:010B / 22B / 23B
6shinh940.05222012/08/03 10:34:340B / 32B / 53B

Ruby2 _

RankUserSizeTimeDateStatistics
1rotary-o450.22002023/01/04 22:14:090B / 20B / 21B
2llhuii460.19362019/02/04 16:13:220B / 23B / 21B
3mitchs460.10562019/02/05 10:25:020B / 24B / 20B

Perl _

RankUserSizeTimeDateStatistics
1tails320.04032012/08/05 17:55:410B / 16B / 14B
2llhuii320.02272019/02/01 20:33:560B / 16B / 14B
3test1360.02662012/08/03 02:55:250B / ?B / ?B

Python _

RankUserSizeTimeDateStatistics
1twobit430.03472012/08/03 02:48:210B / ?B / ?B
2clock430.05572012/08/03 05:50:080B / 24B / 18B
3leonid430.05322012/08/03 06:07:420B / 24B / 18B
4hallvabo430.03852012/08/04 00:26:120B / 24B / 18B
5llhuii430.06982015/01/11 23:14:180B / 24B / 18B
6mitchs430.06122015/04/24 00:31:400B / 24B / 18B
7Hendrik480.04282012/12/02 07:00:050B / 26B / 20B

Python3 _

RankUserSizeTimeDateStatistics
1llhuii410.21172015/01/11 23:14:370B / 21B / 19B
2mitchs410.19742015/04/24 00:33:140B / 21B / 19B
3mypetlion450.12352017/11/11 05:32:310B / 23B / 21B

Pike _

RankUserSizeTimeDateStatistics
1clock820.16072015/03/11 00:11:290B / 48B / 32B

Arc _

RankUserSizeTimeDateStatistics
1clock612.14572012/10/20 11:49:400B / 38B / 20B

Io _

RankUserSizeTimeDateStatistics
1clock730.13722015/02/21 15:52:370B / 62B / 8B
2pooq950.15532012/12/01 19:11:520B / 83B / 7B

JavaScript _

RankUserSizeTimeDateStatistics
10mg660.04032012/08/05 11:41:560B / 35B / 31B
2nn660.06192012/08/06 02:14:300B / 35B / 31B
3Hendrik710.11492012/12/04 18:11:280B / 42B / 27B

Lua _

RankUserSizeTimeDateStatistics
1twobit670.02472012/08/03 02:52:260B / 36B / 30B
2clock670.02382012/08/03 05:56:090B / 36B / 30B

Tcl _

RankUserSizeTimeDateStatistics
1clock680.04792019/01/30 23:15:580B / 41B / 16B

SNOBOL _

RankUserSizeTimeDateStatistics
1clock1030.08172013/02/04 10:27:260B / 43B / 35B

REXX _

RankUserSizeTimeDateStatistics
1clock880.05562012/11/14 18:50:450B / 56B / 20B

Smalltalk _

RankUserSizeTimeDateStatistics
1clock700.06702013/01/07 10:30:400B / 44B / 24B

J _

RankUserSizeTimeDateStatistics
1I., S.310.06152012/08/20 21:58:220B / 12B / 19B
2pooq550.05242012/10/07 15:04:410B / 16B / 38B

K _

RankUserSizeTimeDateStatistics
1twobit200.00852012/08/03 03:06:290B / 6B / 14B

Jelly _

RankUserSizeTimeDateStatistics
1Erik the Outgolfer80.54722021/04/14 03:12:106B / 2B / 0B

C _

RankUserSizeTimeDateStatistics
1llhuii770.02482019/02/08 21:26:400B / ?B / ?B
2tails810.02462019/02/08 15:21:000B / 40B / 41B
3david_werecat1020.02142012/08/03 00:18:230B / 55B / 46B

Haskell _

RankUserSizeTimeDateStatistics
1int-e520.02632015/01/11 16:35:260B / 33B / 19B
2henkma520.03902015/01/31 20:18:210B / 33B / 19B
3Hendrik560.04402012/12/04 18:10:430B / 33B / 19B
4cojna560.02892014/03/21 04:20:060B / 33B / 19B

C# _

RankUserSizeTimeDateStatistics
1Hendrik1580.15292013/12/19 22:49:030B / 105B / 48B

REBOL _

RankUserSizeTimeDateStatistics
1clock610.11412012/08/03 05:51:440B / 46B / 7B

AWK _

RankUserSizeTimeDateStatistics
1llhuii500.02612015/01/11 22:58:490B / 21B / 27B
2nn570.02572012/11/18 22:45:590B / 28B / 26B

sed _

RankUserSizeTimeDateStatistics
1tails380.20322012/08/04 23:04:090B / 6B / 29B
2mitchs380.14602018/09/23 14:46:100B / 6B / 29B
3nn430.13492012/08/04 00:47:340B / 11B / 29B
4clock430.14292012/08/06 02:34:460B / 11B / 29B

jq _

RankUserSizeTimeDateStatistics
1clock560.05582015/02/11 04:36:190B / 28B / 27B

Bash (builtins) _

RankUserSizeTimeDateStatistics
1tails650.99152019/02/01 14:48:300B / 32B / 23B

wake _

RankUserSizeTimeDateStatistics
1clock530.08722012/10/07 14:02:010B / 7B / 41B

xgawk _

RankUserSizeTimeDateStatistics
1llhuii500.03912015/01/11 22:59:180B / 21B / 27B

R _

RankUserSizeTimeDateStatistics
1clock740.36352012/10/15 14:52:510B / 42B / 29B

Brainfuck _

RankUserSizeTimeDateStatistics
1mitchs760.03682015/11/27 07:16:570B / 0B / 76B

GolfScript _

RankUserSizeTimeDateStatistics
1twobit130.09572012/08/03 02:46:590B / 4B / 9B
2clock130.12002012/08/03 05:50:460B / 4B / 9B
3leonid130.09452012/08/03 13:04:230B / 4B / 9B
4tails130.11222012/08/05 17:52:000B / 4B / 9B
5mitchs130.08822015/04/24 00:50:340B / 4B / 9B

gs2 _

RankUserSizeTimeDateStatistics
1clock60.19292015/04/24 00:23:421B / 3B / 1B
2mitchs60.18432015/04/24 00:28:251B / 3B / 1B
3tails60.14462019/02/01 13:50:001B / 3B / 1B

Nibbles _

RankUserSizeTimeDateStatistics
1tails50.02852022/03/03 21:02:033B / 2B / 0B

FlogScript _

RankUserSizeTimeDateStatistics
1clock120.22862012/08/03 06:08:230B / 6B / 6B

Burlesque _

RankUserSizeTimeDateStatistics
1clock160.25482019/09/21 12:38:230B / 8B / 8B

z80 _

RankUserSizeTimeDateStatistics
1tails232.20302019/02/07 14:41:4919B / 3B / 0B
2*yuko*241.50132012/08/03 16:08:0420B / 1B / 1B

Vim _

RankUserSizeTimeDateStatistics
1clock510.87922013/02/02 18:08:170B / 25B / 24B

goruby _

RankUserSizeTimeDateStatistics
1mitchs320.07182015/12/04 13:26:200B / 12B / 18B

Groovy _

RankUserSizeTimeDateStatistics
1nn692.48432012/08/12 00:17:470B / 46B / 22B
2clock702.05042012/08/12 01:38:470B / 45B / 25B

Scala _

RankUserSizeTimeDateStatistics
1rotary-o605.39902023/01/04 00:42:360B / 37B / 23B
2clock644.70812019/12/18 22:22:250B / 42B / 20B

Language Ranking_

RankLangUserSizeScore
1Nibblestails510000
2gs2clock68333
3JellyErik the Outgolfer86250
4FlogScriptclock124166
5GolfScripttwobit133846
6Burlesqueclock163125
7Ktwobit202500
8z80tails232173
9JI., S.311612
10Perltails321562
11gorubymitchs321562
12sedtails381315
13Python3llhuii411219
14Pythontwobit431162
15Rubymitchs441136
16Ruby2rotary-o451111
17AWKllhuii501000
18xgawkllhuii501000
19Vimclock51980
20Haskellint-e52961
21wakeclock53943
22jqclock56892
23Scalarotary-o60833
24REBOLclock61819
25Arcclock61819
26Bash (builtins)tails65769
27JavaScript0mg66757
28Luatwobit67746
29Tclclock68735
30Groovynn69724
31Smalltalkclock70714
32Ioclock73684
33Rclock74675
34Brainfuckmitchs76657
35Cllhuii77649
36Pikeclock82609
37REXXclock88568
38SNOBOLclock103485
39C#Hendrik158316

return to the top page