#
# Copyright 2011 The Open Source Research Group,
#                University of Erlangen-Nürnberg
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

--------------------------------------------------------------------------------

"\n" * n "Hallo"

n
0 -> <Hallo>
1 -> <Hallo>

2 -> <BR Hallo>            1
3 -> <BR><Hallo>           2
4 -> <BR><BR Hallo>        3
5 -> <BR><BR><Hallo>       4
6 -> <BR><BR><BR Hallo>    5
7 -> <BR><BR><BR><Hallo>   6

gap = max(0, n - 1)

<BR> * gap/2 <BR * gap%2 Hallo>

--------------------------------------------------------------------------------

"Hallo" "\n" * n "Hallo"

n
0 -> <HalloHallo>
1 -> <Hallo Hallo>
2 -> <Hallo><Hallo>

3 -> <Hallo><BR Hallo>           1
4 -> <Hallo><BR><Hallo>          2
5 -> <Hallo><BR><BR Hallo>       3
6 -> <Hallo><BR><BR><Hallo>      4
7 -> <Hallo><BR><BR><BR Hallo>   5

gap = max(0, n - 2)

<Hallo><BR> * gap/2 <BR * gap%2 Hallo>

--------------------------------------------------------------------------------

"Hallo" "\n" * n "{| ..."

n
0 -> <Hallo{|>
1 -> <Hallo>{|
2 -> <Hallo>{|

3 -> <Hallo><BR>{|           1
4 -> <Hallo><BR>{|           2
5 -> <Hallo><BR><BR>{|       3
6 -> <Hallo><BR><BR>{|       4
7 -> <Hallo><BR><BR><BR>{|   5
8 -> <Hallo><BR><BR><BR>{|   6

gap = max(0, n - 2)

<Hallo> <BR> * (n+1)/2 {|

--------------------------------------------------------------------------------
