NaMaan
21
Re: Programming Riddles
Ok so I just realized that in C# using pure LINQ we can write one liner to achieve the same results .
Here you go … enjoy 
private static bool IsAnagrams(string one, string two)
{
return one
.ToLower()
.ToCharArray()
.OrderBy(o => o)
.SequenceEqual(
two
.ToLower()
.ToCharArray()
.OrderBy(o => o)
);
}
Hadeel
22
Re: Programming Riddles
I think these for loops will work. One for the upper half and other for the lower half.
for (int i = 1; i < 10; i += 2)
{
for (int j = 0; j < 9 - i / 2; j++)
system.out.print (" ");
for (int j = 0; j < i; j++)
system.out.print ("*");
system.out.print ("
");
}
for (int i = 7; i > 0; i -= 2)
{
for (int j = 0; j < 9 - i / 2; j++)
system.out.print(" ");
for (int j = 0; j < i; j++)
system.out.print("*");
system.out.print("
");
}
I guess this will work. starts with one star and increases 2 *s next line. goes upto 9 *s. and then the same odd number back to finish it.
NaMaan
23
Re: Programming Riddles
This is the output
*
***
*****
*******
*********
*******
*****
***
*
Good job.
us1415
24
Re: Programming Riddles
Here is something in python:
lines = "".join(("*" * y, " " * (w - (y * 2)), "*" * y)) for y in xrange(w / 2, 0, -1)]
print "
".join(lines + lines-2::-1])
********************
********* *********
******** ********
******* *******
****** ******
***** *****
**** ****
*** ***
** **
* *
** **
*** ***
**** ****
***** *****
****** ******
******* *******
******** ********
********* *********
********************
NaMaan
25
Re: Programming Riddles
Great Joel . I never really worked with python so can you please explain the logic you are using . Thanks .
Hadeel
26
Re: Programming Riddles
Yeah I’ve never worked in python too so that was interesting. A little lecture on how and what happened there would be appreciated Joel.
Huma_1
27
Re: Programming Riddles
Here’s mine:
"jurh/dksgdg**‘’
dskjhkjbhdsakjhkjdbasjkbjkasd;kdhs"
sadjhb@jsdab"
kjhds/abajhdsbcm[ewui"rhbjkhdsbjhdsk;abhkehj
dkjs]hbjhbdsjkhbujdkhbjkdhsbdjbj
"jhdsvbhvreughthrj/khdsjhdb>skhsahjasdbj<hdsjhdbvjhdbs
ywuq<ioqoyyrixhgcjsjishdhs"njjdjjdhd
Iz good? 
NaMaan
28
Re: Programming Riddles
Oya you stopped typing with hands again . . . pando production na howay tay
Huma_1
29
Re: Programming Riddles
But it was a code
The ananangram one!