# diamond pattern using string manipulation

Page 1 of 1

## 3 Replies - 2959 Views - Last Post: 15 January 2013 - 09:11 AMRate Topic: //<![CDATA[ rating = new ipb.rating( 'topic_rate_', { url: 'http://www.dreamincode.net/forums/index.php?app=forums&module=ajax&section=topics&do=rateTopic&t=307366&amp;s=709bee565264127bf0194e2f97c77a66&md5check=' + ipb.vars['secure_hash'], cur_rating: 0, rated: 0, allow_rate: 0, multi_rate: 1, show_rate_text: true } ); //]]>

### #1 ragefour

Reputation: 0
• Posts: 2
• Joined: 15-January 13

# diamond pattern using string manipulation

Posted 15 January 2013 - 07:27 AM

i can make diamond using this code
```    a = Mid("awesome", 4, 1)
Print Space(20); a
a = Mid("awesome", 3, 3)
Print Space(18); a
a = Mid("awesome", 2, 5)
Print Space(16); a
a = Mid("awesome", 1, 7)
Print Space(14); a
a = Mid("awesome", 2, 5)
Print Space(16); a
a = Mid("awesome", 3, 3)
Print Space(18); a
a = Mid("awesome", 4, 1)
Print Space(20); a

```

I want to make it in a loop, but i can't figure out hot to.
anyone can give me ideas?

Is This A Good Question/Topic? 0

## Replies To: diamond pattern using string manipulation

### #2 modi123_1

• Suitor #2

Reputation: 13953
• Posts: 55,693
• Joined: 12-June 08

## Re: diamond pattern using string manipulation

Posted 15 January 2013 - 07:49 AM

For loop.. do while.. while loop.. they are all pretty standard and straight forward.

### #3 ragefour

Reputation: 0
• Posts: 2
• Joined: 15-January 13

## Re: diamond pattern using string manipulation

Posted 15 January 2013 - 08:28 AM

And yeah i tried that, but i keep on getting wrong outputs.

### #4 modi123_1

• Suitor #2

Reputation: 13953
• Posts: 55,693
• Joined: 12-June 08

## Re: diamond pattern using string manipulation

Posted 15 January 2013 - 09:11 AM

Show us what you tried then... and 'wrong results' -> how?!