• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

how to complete this code?

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi all, i am new. i tried to make this


here is my scrip, i can complete the middle part. this (\_/) part. can anyone help me???
 
Bartender
Posts: 10780
71
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

riris wijaya wrote:The rest is all spacing, the trickiest part.


It may look it, but actually it isnt (BTW - excellent analysis, you'd get an 'A' from me; I wish more newbies showed the same application).

If you look at your patterns closely, you'll see that they repeat. If I was doing it, I wouldn't worry too much about spaces on the right (so, you print extra spaces on a line; who cares?) it may help you to see how to put your "shapes" together.

For me, there are 6 basic shapes:
1. Hex top (see line 0).
2. Left top and right top (line 1, but two distinct shapes that may need to be used separately).
3. Left edge and right edge (line 3, but again, two distinct shapes that may need to be used separately; and needed only once, from the looks of it).
4. A "cup" (the teacup without a handle, used everywhere else).
The rest is all leading spaces.

See if that helps any.

Good luck.

Winston

[Edit] Looking at it again, there are other ways of looking at the pattern, but I'd get what you have working first, then look for alternatives.
 
Marshal
Posts: 80059
410
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
. . . and welcome to the Ranch
 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic