Sputnik Music Forums

Sputnik Music Forums (http://www.sputnikmusic.com/forums/index.php)
-   History (http://www.sputnikmusic.com/forums/forumdisplay.php?f=136)
-   -   Casual Compendium (http://www.sputnikmusic.com/forums/showthread.php?t=268077)

bassi3 05-17-2005 03:15 PM

Honestly, I don't think the code you just gave me will come through a compiler... ;)

But he probably used something like this:

i=0;
j=word.length-1;
flag = false;
do {
if (word.charAt(i) == word.charAt(j)) {
flag = true;
}
else {
flag = false;
break;
}
i++;
j--;
}
while (i<=j);
if (flag) {
palindrome found...
}
else {
palindrome not found...
}


This way the code will be like 40-45% faster, but it's harder to write...
Again, check the API for correct syntaxis/methods...

Chrs!

Ronald

kilian 05-17-2005 03:18 PM

[QUOTE=neal_672]:wave:[/QUOTE]

:wave:
How are things?

bassi3 05-17-2005 03:19 PM

[QUOTE=kili]Not really :lol:
Just like.. not knowing a thing :p

What's up everyone?[/QUOTE]

Doin fine... thanx... you? I got better, after being sick the last few days, so I went to school 2day... Played loads, and wrote some new songs... So everything seems to be going quite allright...

neal_672 05-17-2005 03:22 PM

Not too shabby apart from the whole exams thing, how about you?

kilian 05-17-2005 03:22 PM

Oh just relaxing.. I have exams coming up :smoke:
Finishing havo this year.. van 5 vwo naar 5 havo, maar dat is een lang verhaal. Hou het maar op luiheid.

I am not playing a lot of bass lately, but if you are near dordrecht.. come and check my band out in the Highschool Music Competition Finale :)

bassi3 05-17-2005 03:27 PM

Vertel... wanneer, waar (Bibelot??), hoe laat, hoe duur, etc...
(BTW... [email]r_mansveld@hotmail.com[/email] (alleen MSN) is misschien handiger...)

PaulSimonon 05-17-2005 03:43 PM

Huh?

Spaceman Spiff 05-17-2005 03:47 PM

Hooray!!!
I took the code, made the necessary changes, and it works!

Hooray!!!
Thank ya kind sire!

bassi3 05-17-2005 03:52 PM

[QUOTE=PaulSimonon]Huh?[/QUOTE]

Yeah sorry, was a little Dutch 'entre nous'... (To speak with rush...:))

bassi3 05-17-2005 03:53 PM

[QUOTE=Spaceman Spiff]Hooray!!!
I took the code, made the necessary changes, and it works!

Hooray!!!
Thank ya kind sire![/QUOTE]

That would be $25.- than please... ;)

No, you're welcome... sbeen a pleasure...

Spaceman Spiff 05-17-2005 03:55 PM

What does the
flag = false
and
flag = true

mean?

kilian 05-17-2005 03:56 PM

[QUOTE=bassi3]Yeah sorry, was a little Dutch 'entre nous'... (To speak with rush...:))[/QUOTE]

It was!
And it was about the dutch school system and a gig that I have to play nearby :thumb: So nothing to worry about =)

No secret poŽn sites/bass improvements were told :naughty:

bassi3 05-17-2005 04:07 PM

[QUOTE=Spaceman Spiff]What does the
flag = false
and
flag = true

mean?[/QUOTE]

flag is just variable to hold the state of the palindrome.
Because were checking character by character, instread of the complete word, we need a way to remember whether the chars we checked so far were part of a palindrome. That's what flag is used for.

We initially say that flag is false, because we assume there ain't a palindrome, till the opposite is proven. Then we will check both the first and the last letter, when these are the same, we have a palindrome SO FAR. So, we have to change the flag to true.
The flag will stay true, till either the end of the do..while loop, or till a non-matching char is found, in which case the flag will be set to false. Then the break-statement is called, to break us out of the do...while loop, cause the word won't be a palindrome NEway...

All we have to do in the end, is check the flag-state, to know whether we dealt with a palindrome or not...

That's it.

bassi3 05-17-2005 04:19 PM

[QUOTE=Spaceman Spiff]What does the
flag = false
and
flag = true

mean?[/QUOTE]

flag is just variable to hold the state of the palindrome.
Because were checking character by character, instread of the complete word, we need a way to remember whether the chars we checked so far were part of a palindrome. That's what flag is used for.

We initially say that flag is false, because we assume there ain't a palindrome, till the opposite is proven. Then we will check both the first and the last letter, when these are the same, we have a palindrome SO FAR. So, we have to change the flag to true.
The flag will stay true, till either the end of the do..while loop, or till a non-matching char is found, in which case the flag will be set to false. Then the break-statement is called, to break us out of the do...while loop, cause the word won't be a palindrome NEway...

All we have to do in the end, is check the flag-state, to know whether we dealt with a palindrome or not...

That's it.

bassi3 05-17-2005 04:26 PM

[QUOTE=kili]No secret poŽn sites were told :naughty:[/QUOTE]

Yeah, like we would discuss po(r)n-sites... :amaze: :naughty: :p


/edit: with that i mean NEbody discussing that with [U]me[/U]

pukeboy66 05-17-2005 04:55 PM

[QUOTE=kili]wang chung?

Tell me.. wtf is that :lol:[/QUOTE]

honestly i have no idea

but come on.........wang-chung that just screams bad a$$

ScorpSath 05-17-2005 04:55 PM

So Ct, who hears is hungry?

pukeboy66 05-17-2005 04:58 PM

[QUOTE=ScorpSath]So Ct, who hears is hungry?[/QUOTE]
*raises hand*

bassi3 05-17-2005 05:11 PM

Peoples, I'm off, i have to get the train to school in like 7 hours, and i still need to get some sleep...

So Kili, sorry, but our Dutch influence is upon your shoulders for now...


Cheers, and c y'all 2morrow!

BTW. left shoe, thnx! There are some terrific songs made by those bands!

pukeboy66 05-17-2005 05:27 PM

[QUOTE=bassi3]Peoples, I'm off, i have to get the train to school in like 7 hours, and i still need to get some sleep...

So Kili, sorry, but our Dutch influence is upon your shoulders for now...


Cheers, and c y'all 2morrow!

BTW. left shoe, thnx! There are some terrific songs made by those bands![/QUOTE]
:wave:

Radiobass81 05-17-2005 05:33 PM

Hey.

Jamie 05-17-2005 05:36 PM

Im off to bed now, ive got my ICT exam tomorrow! yey...

Farewell




(I emailed that video of the real bad singer singing slipknot to Ebaums world :lol: )

kilian 05-17-2005 05:37 PM

[QUOTE=bassi3]So Kili, sorry, but our Dutch influence is upon your shoulders for now...
[/QUOTE]

I am also out of here :D
So the Dutch people are leaving.. Don't make a mess of the place ;)


:wave:

pukeboy66 05-17-2005 05:41 PM

[QUOTE=kili]I am also out of here :D
So the Dutch people are leaving.. Don't make a mess of the place ;)


:wave:[/QUOTE]

so long kili and remember.........wang-chung

Spaceman Spiff 05-17-2005 06:43 PM

Would anyone happen to have an mp3 of School Days they'd be willing to send me/upload somewhere for downloading?

PaulSimonon 05-17-2005 06:57 PM

So... Guess who just bought tickets to the Stones tour?

Spaceman Spiff 05-17-2005 07:01 PM

Meh.
I'm not a big enough fan to go see them live.

Radiobass81 05-17-2005 07:01 PM

^^ Nice.

They are even coming here!

e p 05-17-2005 07:03 PM

[QUOTE=Spaceman Spiff]Would anyone happen to have an mp3 of School Days they'd be willing to send me/upload somewhere for downloading?[/QUOTE]

[URL=http://s25.yousendit.com/d.aspx?id=3Q073AMQ8CCXC31P9D8X88C6W5]yes[/URL]

Spaceman Spiff 05-17-2005 07:06 PM

Why thank you, thank you very much.


All times are GMT -6. The time now is 12:00 AM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.