Harem

If you have some randomness to share that you can't post elsewhere, this is the place to do it.
Kogorou
User avatar

*drinking beer and playing guitar*

Posts: 1094

Contact:

Re: Harem

Postby Kogorou » January 3rd, 2011, 8:29 pm

Who said I counted ?

[spoiler]
package test;


public class Tester {
static int count = 0;

/**
* @param args
*/
public static void main(String[] args) {
Boolean[] fw = new Boolean[100];
for (int i = 0; i < fw.length; i++) {
fw[i]=false;
}
prog(fw);
int menge = 0;
for (int i = 0; i < fw.length; i++) {
if(fw[i]==true){
System.out.println((i+1)+" forwarded");
menge++;
}

}
System.out.println(menge);
}

private static void prog(Boolean[] fw) {
count++;
System.out.println("prog "+count+":");
for (int i = (count-1); i < fw.length; i = (i + count)) {

if (fw[i] == false) {
fw[i] = true;
System.out.println("false to true "+(i+1));
} else if (fw[i] == true) {
fw[i] = false;
System.out.println("true to false "+(i+1));
}
}
System.out.println("---------");
if (count == 100) {
return;
} else {
prog(fw);
}


}
}

[/spoiler]

That really called for recursion :P
Akonyl
Community Hero
User avatar
Posts: 4118

Re: Harem

Postby Akonyl » January 3rd, 2011, 8:35 pm

writing a program to solve it isn't really "solving" it either imo :P

though I will admit to having done so to find riddle solutions :V
Kogorou
User avatar

*drinking beer and playing guitar*

Posts: 1094

Contact:

Re: Harem

Postby Kogorou » January 3rd, 2011, 8:40 pm

Of course it is.
Do you really think I spend more than a minute to do that.
The problem is:
a. It's late at night.
b. I lack logic late at night (i have to train again)

But I solve all problems that way :P
Callid
User avatar

Ratio vincit omnia.

Posts: 1229

Re: Harem

Postby Callid » January 3rd, 2011, 9:27 pm

Just a small hint how it should be done:

Basically the programs represent factors. Each number has an even number of factors, as they form a pair to create that number (e.g. 1x12; 2x6; 3x4), so they're all closed. The only exceptions are squares, as in this case, the pair consists of the same number twice (e.g. 1x25; 5x5). However, as every number only changes each port once, every square number remains open at the end. Therefore, they are 1; 4; 9 etc.
If  ;), :D, ;D, ::), :P, :-X, :o or >:D are attached, that paragraph may not be 100% serious. Seriously.
This link provides further information.


STOP ACTA
Outside the EU, too! :x

<image is a work in progress>
Disclaimer: This cartoon was drawn by Andreas Fecke.
Callid Conia Pact - Petitions - Archive
Akonyl
Community Hero
User avatar
Posts: 4118

Re: Harem

Postby Akonyl » January 3rd, 2011, 11:05 pm

Kogorou wrote:Of course it is.
Do you really think I spend more than a minute to do that.
The problem is:
a. It's late at night.
b. I lack logic late at night (i have to train again)

But I solve all problems that way :P

I'll be honest: First time I saw this riddle, I wrote a program for it too. :P

but writing a program to brute force a problem and answering "why" are different things, as you demonstrated with asking people why they thought their answers for your riddles were correct. Had I just said "a clock" to #2 and then said "iunno" when asked to explain myself, I doubt you would have counted that as solved either. :P
ShiraKiryuu
User avatar
Posts: 3044

Re: Harem

Postby ShiraKiryuu » January 4th, 2011, 1:53 am

O.o
Image
Image
nomemory
User avatar

huh?

Posts: 811

Re: Harem

Postby nomemory » January 4th, 2011, 3:27 am

A new harem has been made? Should I list it? If so and I miss the answer here, please PM me.
my dA account
Image
"Sick of tea?! That's like being sick of breathing!" - Iroh (Avatar - The Last Airbender)
Callid
User avatar

Ratio vincit omnia.

Posts: 1229

Re: Harem

Postby Callid » January 4th, 2011, 7:50 am

Akonyl wrote:
Kogorou wrote:Of course it is.
Do you really think I spend more than a minute to do that.
The problem is:
a. It's late at night.
b. I lack logic late at night (i have to train again)

But I solve all problems that way :P

I'll be honest: First time I saw this riddle, I wrote a program for it too. :P

but writing a program to brute force a problem and answering "why" are different things, as you demonstrated with asking people why they thought their answers for your riddles were correct. Had I just said "a clock" to #2 and then said "iunno" when asked to explain myself, I doubt you would have counted that as solved either. :P
o.O

When I was first confronted with that problem (well, actually with the door problem, but that's only a different setting), it took me 20 seconds to solve :P
And I know someone who needed three :-X
If  ;), :D, ;D, ::), :P, :-X, :o or >:D are attached, that paragraph may not be 100% serious. Seriously.
This link provides further information.


STOP ACTA
Outside the EU, too! :x

<image is a work in progress>
Disclaimer: This cartoon was drawn by Andreas Fecke.
Callid Conia Pact - Petitions - Archive
Edogawa4869
User avatar

GUESS WHO, MAAAAAAAAAAAAAAAAAAAAAAAAAAAN

Posts: 128

Re: Harem

Postby Edogawa4869 » January 4th, 2011, 1:16 pm

Ok, 2 things:

1. What's this about another harem?

2. I think that I've solved the riddle to enter into said third harem. :P
Yugi Moto wrote:Oh, shipping is where you take two characters from a T.V. show, who aren't romantically involved in any shape or form, and then you force them to become a lesbian couple by drawing vivid and gratuitous fan art of them for about six months, before you move on to some other show. Lather, rinse, repeat.
Akonyl
Community Hero
User avatar
Posts: 4118

Re: Harem

Postby Akonyl » January 4th, 2011, 1:30 pm

Edogawa4869 wrote:Ok, 2 things:

1. What's this about another harem?

2. I think that I've solved the riddle to enter into said third harem. :P

1) I don't think anyone's actually in the harem, so it'll really just be YouxKogorou

2) Do you want to be paired with Kogorou? What would Kain say :V
ShiraKiryuu
User avatar
Posts: 3044

Re: Harem

Postby ShiraKiryuu » January 4th, 2011, 1:31 pm

I see that Eric has the hots for Kogorou.
Image
Image
Edogawa4869
User avatar

GUESS WHO, MAAAAAAAAAAAAAAAAAAAAAAAAAAAN

Posts: 128

Re: Harem

Postby Edogawa4869 » January 4th, 2011, 1:32 pm

Akonyl wrote:
Edogawa4869 wrote:Ok, 2 things:

1. What's this about another harem?

2. I think that I've solved the riddle to enter into said third harem. :P

1) I don't think anyone's actually in the harem, so it'll really just be YouxKogorou

2) Do you want to be paired with Kogorou? What would Kain say :V

1. *shrugs*

2. Nothing would happen. ::)  I wouldn't let it. :P Besides, hopefully it's just more riddles. :-\

ShiraKiryuu wrote:I see that Eric has the hots for Kogorou.

::)
Yugi Moto wrote:Oh, shipping is where you take two characters from a T.V. show, who aren't romantically involved in any shape or form, and then you force them to become a lesbian couple by drawing vivid and gratuitous fan art of them for about six months, before you move on to some other show. Lather, rinse, repeat.
Akonyl
Community Hero
User avatar
Posts: 4118

Re: Harem

Postby Akonyl » January 4th, 2011, 1:34 pm

Edogawa4869 wrote:2. Nothing would happen. ::)  I wouldn't let it. :P Besides, hopefully it's just more riddles. :-\

there are other ways to get riddles, you know. :P
KainTheVampire
User avatar

*the Devil disguised as a mad vampire* >:D

Posts: 986

Contact:

Re: Harem

Postby KainTheVampire » January 4th, 2011, 1:34 pm

ShiraKiryuu wrote:I see that Eric has the hots for Kogorou.

What?! I'm going to kill him! >___<
Image
Conclusion: "This area is full of crap" and "It's a nasty place!"

Vylash
User avatar
Posts: 3757

Contact:

Re: Harem

Postby Vylash » January 4th, 2011, 1:35 pm

KainTheVampire wrote:
ShiraKiryuu wrote:I see that Eric has the hots for Kogorou.

What?! I'm going to kill him! >___<
Did you not read his reply? :V
Image

Return to “Off-Topic”

Who is online

Users browsing this forum: Max1996 and 3 guests