Bounce on Trampolines

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

Coming from the left, you step on a series of trampolines which bounce you left or right depending on their orientation (> or <). The first time you bounce you get launched 1 square, the second time 2 squares, and so on. Since the number of squares you bounce increases every time you hit a trampoline, you will eventually either get launched off the left or right edge. Print 0 if left, 1 if right.

Example (using |.| to denote current position):

>><><<<

Turn 1: |>|><><<<
Turn 2: >|>|<><<<
Turn 3: >><|>|<<<
Turn 4: >><><<|<|
Turn 5: >>|<|><<<
Bounce off left edge -> 0

Example 2:

>><<>>>

Turn 1: |>|><<>>>
Turn 2: >|>|<<>>>
Turn 3: >><|<|>>>
Turn 4: |>|><<>>>
Turn 5: >><<|>|>>
Bounce off right edge -> 1

Options

exec is denied

rejudge feature is enabled

now post-mortem time, all source codes will be revealed

Sample input:_

<>><<
><<<>
>><<>
<><>>
>>>>>
><<><
>>>><
><>>>
>><><
><<<>
>>>>>>
><><>>
><<>>>
><>>><
>><>>>
><>>><
>>>>>>
>><><<
>>><>>
>>>>>>
><<>><<
><<>>>>
>>><<>>
>><>>>>
>>>>><>
>>><<>>
>>><><<
>>>><>>
>>>>><>
>>>><>>
>><>><>>
><>><><>
><><><>>
>>><<<><
><<><>>>
>>>>>>>>
>>><>>><
>>>>>><>
>><<>><>
>>>>>>>>
>><>><><>
><<>><<>>
>>><>>>>>
><<<>>>>>
<>><>>>>>
>>>><>>>>
><<>><<><
><>>><><<
>>>><>>>>
>>><>>>><
><>>>>>>>>
<>>><><><>
><>>><><<>
>><>>>>>><
>><>>>>>>>
><>>>><><>
>><<>><><<
>>>>>><>>>
><><><>>>>
><<><<>>><
>>><>>>><><
>>>><<<>><>
>><>>><><<<
>>>>><>><<>
<>>><<<<<<<
>><>>>><><<
>><>><>><<>
>>>>>>><>>>
><<<>>>><<<
>>><<<>>>>>
>>>>><<>>><<
>><>>><>><<<
><<<>>>>>>>>
><><<>>>>>>>
><><>>>>>><<
<>><>><>><><
>><>>><>>>><
>>><>>><><<<
>>>>>><<>>><
>>>>>>><<>>>
><<>><>>>>>>>
<>>><><<><><>
<<>>>>>><><<<
>><>>>>>>>><>
<><<<<>><><>>
>>>>>><<>>><<
>>>>><<><><><
>>>>>><><>>>>
>><><><<<<<<>
>>>>><><<>><>
>><<<<<>>>><><
><<>>><>><>><>
>><>>>>><>>>><
>>>>>>>><>><<>
><>><>>>><<<<>
>><<>>>>>>><<<
<><>><>>>>><<>
>>><>><><>>><>
>>><>>>>>>>><>
>><>>>>>>>>>><

Sample output:

0
0
1
0
1
0
1
0
1
0
1
0
0
0
1
0
1
1
1
1
0
0
0
1
1
0
1
1
1
1
1
0
0
0
0
1
1
1
1
1
1
0
1
0
0
1
0
0
1
1
0
0
0
1
1
0
0
1
0
0
1
1
0
1
0
1
1
1
0
0
1
0
0
0
0
0
0
0
1
1
0
0
0
1
0
1
1
1
0
1
0
0
1
1
0
1
0
1
1
1

Sample input:_

>>>><
>>>><
>>><>
>>><<
><><<
>>>><
>><><
><>>>
><>>>
>>><>
>>>><>
>><>>>
><<>>>
><>>><
>>><>>
>><>>>
><><><
<>>>>>
>>>>>>
>><><>
><>>><>
>>><>><
>>>>>>>
>>>>>>>
><>>>>>
><<><<>
>>>><>>
<<>>>>>
><>>>><
>>>>>>>
>>><>>><
<>>>>>><
><>>>><>
><<>>>>>
>>>>>>><
><><<>><
>>>>>><<
><><><<<
>><>>>>>
><<>>>>>
>><>>><>>
<><>><>><
>>>><>>><
><>><>>>>
>>>><><><
>><<<>><>
>>><<>><<
><>>><<>>
>><>>>><>
><<<<>>>>
>><<><>>>>
>>><><<><>
<>>>>>>>>>
><<<>>>>><
>>>>>><>>>
>>><>><<>>
>>>>><<<><
><>>>>><>>
<>>>><>><>
>>>><><<><
><<<>><><><
<>><>><>>><
>>><><><<<>
><><<><>><>
><>>>>>>>><
><>><>><>><
>>>>>>><><>
><>>>>><>>>
>>><><<><>>
>>><<><>>><
>><>>>><><>>
><<>>><>>><>
>><>>>>>>><>
><>><<><>><<
>>>>><<<><<>
><<<><><>>>>
<<><>><<<<>>
><>>>>>><<>>
>><>>>>>><><
>>>><<>>>>>>
<><><><>><<><
>>><><<><<><<
>>><<<><<><><
>><<<><><>>>>
>>><>>>><>><<
>>><>>><>>>><
>><>>>>><><>>
><>><>>><>>>>
<>>>><>><>><<
>>><><>>>>><>
>>>>>><>>>>>><
<<<>><>>><><>>
><>><><>><>>>>
<>>>><>><<><>>
>>>>>>><>><>>>
>>><><>>><<>><
>><><<<><<<><>
><<>>>>>><><<<
><>>>><<<>><>>
><>>><<>><><><

Sample output:

1
1
1
0
0
1
1
0
0
1
1
1
0
0
1
1
0
0
1
1
0
1
1
1
0
0
1
0
0
1
1
0
0
0
1
0
1
0
1
0
0
0
1
0
1
0
0
0
1
0
1
1
0
0
1
1
1
0
0
1
0
0
0
0
0
0
1
0
1
0
1
0
1
0
1
0
0
0
1
1
0
0
0
0
1
1
1
0
0
1
0
0
0
0
1
0
0
0
0
0

Sample input:_

>>>><
>>>>>
>>>><
>>><<
>><>>
>>>><
>>>>>
>>><<
>><<<
>>>>>
>>><>>
><>>>>
>>>><>
>>>>><
><<<>>
><>>><
>>><><
<>>>><
>><><>
<>><<>
><><>>>
><>>>><
><>>><<
>><>><>
>>>>>>>
>>>><>>
><>>><<
>><>>>>
<>>><<>
<><>>>>
>>>>>>>>
>>>>><>>
>>>><<>>
><><>>>>
>>>>><>>
>>><<<<<
><>>>><>
><<>>><>
>>>><<>>
><<>>>>>
>>>>>>><<
><<<>><>>
><>>>>>><
>>><<>>><
>><>>><>>
>>>><<>>>
>><<<>><>
>>><<><<>
<<<><<<><
>>>>>><>>
>><><>>>>>
>>>>>><><>
>>><>><<>>
>><>><<<>>
><>>>>>>>>
>>>>>>>>><
>>>><><>>>
>>>>>>>>>>
<>>>><>>>>
><<><>>>><
><<<>>>>>>>
>><<>>>><<>
>><>><>><><
>>>><><>>>>
><>>>><>>>>
><>>><<>><>
><>>>><><<>
>><>>>>><><
>>>><>>>><>
>>><>><><<>
>><<<><<>><>
><<<<<><>><>
>><>>>><><><
>>>><>><><<>
>>><><><><>>
>><>>><<>>>>
>>>><>><<<<>
><>><<>>><>>
>><><<><>>><
><<<>><>><<>
><>>>>>>><<>>
>><>><>>>>><<
><<<>><>>>>><
>>>>>>>>><>>>
>>>><>><>>>>>
>>>><<><<>>>>
>>>>>><<><<>>
>><>>><>><<<>
><>>>><><<<<>
>><><>><>>><<
>>>><<><<<>>>>
>>><>>><><>>>>
>><<><><<><>>>
>>>><<>>>><<>>
>>>>>>>>>>><<>
>><>>>>>><>>><
><>>>><>>><<><
>>>>>><><>>>>>
>><<>>>>>><<<>
>><<>>>><>><<>

Sample output:

1
1
1
0
1
1
1
0
0
1
1
0
1
1
0
0
1
0
1
0
0
0
0
1
1
1
0
1
0
0
1
1
1
0
1
0
0
0
1
0
1
0
0
0
0
1
0
0
0
1
1
1
1
0
0
1
1
1
0
0
0
0
0
1
0
0
0
1
1
0
0
0
1
1
0
0
1
0
1
0
0
1
0
1
1
1
1
0
0
1
1
0
1
0
1
1
0
1
1
1

Ranking

Ruby _

RankUserSizeTimeDateStatistics
1rotary-o530.05292020/11/19 02:01:170B / 22B / 27B
2mitchs530.03902020/11/19 04:04:120B / 25B / 23B
3mitchs (rotary-o)520.06342020/11/19 17:28:160B / 23B / 25B

Ruby2 _

RankUserSizeTimeDateStatistics
1mitchs550.17682020/11/19 04:04:450B / 25B / 24B
2rotary-o560.17902020/11/19 02:00:060B / 21B / 31B

Perl _

RankUserSizeTimeDateStatistics
1tails590.04452020/11/06 10:56:090B / 10B / 49B

Python _

RankUserSizeTimeDateStatistics
1xnor780.12962020/11/08 16:02:120B / 42B / 35B
2mitchs780.13092020/11/18 19:20:000B / 42B / 35B
3mitchs (alt)780.12842020/11/19 04:14:510B / 43B / 33B
4clock810.17522020/11/06 23:52:210B / 44B / 36B
5lynn810.09232020/11/11 22:40:130B / 43B / 30B
6Hendrik830.09102020/11/07 19:24:120B / 47B / 29B
7Dingledooper850.09052020/11/05 17:17:300B / 47B / 31B
8hallvabo850.08332020/11/06 21:47:220B / 46B / 33B
9mitchs (Hendrik)770.12802020/11/19 14:33:030B / 42B / 34B

Python3 _

RankUserSizeTimeDateStatistics
1Erik the Outgolfer830.14732020/11/10 04:15:590B / 44B / 32B
2mypetlion870.17392020/11/13 02:13:460B / 47B / 30B

Haskell _

RankUserSizeTimeDateStatistics
1lynn930.05322020/11/12 01:39:420B / ?B / ?B

sed _

RankUserSizeTimeDateStatistics
1tails600.04322020/11/06 10:39:080B / 4B / 55B

Bash (builtins) _

RankUserSizeTimeDateStatistics
1tails630.11442020/11/18 11:53:320B / 24B / 32B
2tails620.12632020/11/20 09:31:540B / 23B / 32B
3McBusLuck630.11632020/11/20 05:35:570B / 22B / 33B

Brainfuck _

RankUserSizeTimeDateStatistics
1mitchs2220.05692020/11/19 13:55:160B / 0B / 222B
2mitchs1820.05672020/11/20 13:45:060B / 0B / 182B

GolfScript _

RankUserSizeTimeDateStatistics
1tails340.12952020/11/06 09:18:270B / 12B / 22B

gs2 _

RankUserSizeTimeDateStatistics
1whio200.36712020/11/18 09:58:558B / 7B / 4B
2tails200.47252020/11/18 10:54:277B / 7B / 5B

Scala _

RankUserSizeTimeDateStatistics
1rotary-o838.02522020/11/08 18:52:050B / 39B / 44B
2Hendrik886.94402020/11/10 01:46:370B / 50B / 35B

Language Ranking_

RankLangUserSizeScore
1gs2whio2010000
2GolfScripttails345882
3Rubymitchs (rotary-o)523846
4Ruby2mitchs553636
5Perltails593389
6sedtails603333
7Bash (builtins)tails623225
8Pythonmitchs (Hendrik)772597
9Scalarotary-o832409
10Python3Erik the Outgolfer832409
11Haskelllynn932150
12Brainfuckmitchs1821098

return to the top page