What are some logic based riddles you like?

What are some logic based riddles you like?

>Write a program that prints the numbers from 1 to 100. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz”.

99.5% of CS can't solve it.

for i in range(1, 101): print('FizzBuzz'[i*i%3*4:8--i**4%5] or i)

Not a riddle

I could have programmed that when I was seven

Yes but could you have done it with my dick in your mouth?

Bump

Enough with this CS is easy meme. If it's so easy then why are programmers paid 100K starting?

They're not

Bump

hot af

...

...

July 14th?

July 16.
If it was July 14 then how would Bernard have figured out the month?

The gettier problem. Apparently nobody has yet to solve it in epistemology just yet.

its $71,500 starting with the hopes of getting $102,000. All values are averages

*123
13 2*
*23 1
2 13*
123*

The thought that there is anyone who could get this wrong makes me reee.

for x in range(1,101):print(x%3==0)*"Fizz"+(x%5==0)*"Buzz"or x

The majority of people can't even give you an answer

Also check'd

Why would a farmer help a wolf cross a river? I mean I get the sheep and the sheep food but why the wolf?

>Talking about CS replies with an image of an EE.

Normal places start at
40k , sjw places start higher and you move up based on skill

The Einstein Puzzle:
FACTS:
1. There are 5 houses in 5 different colours.
2. In each house lives a person with a different nationality.
3. These 5 owners drink a certain beverage, smoke a certain brand of cigarette and keep a certain pet.
4. No owners have the same pet, brand of cigaratte, or drink.

CLUES:
1. The Brit lives in a red house
2. The Swede keeps a dog
3. The Dane drinks tea
4. The green house is on the left of the white house.
5. The green house owner drinks coffee.
6. The person who smokes Pall Mall keeps birds.
7. The owner of the yellow house smokes Dunhill.
8. The man living in the house right in the center drinks milk
9. The Norwegian lives in the first house.
10. The man who smokes Blend lives next to the one who keeps cats
11. The man who keeps horses lives next to the man who smokes Dunhill
12. The owner who smokes Camel drinks beer
13. The German smokes Marlborough.
14. The Norwegian lives next to the blue house
15. The man who smokes Blend has a neighbour who drinks water.

The question is, who keeps the fish?

(Protip: There're two right answers)

>Mike penis
Sick nazi idolatry /b/ro

N = 100
for n in range(1,N+1):
____if n % 15 == 0:
________print("Fizz Buzz")
____elif n % 3 == 0:
________print("Fizz")
____elif n % 5 == 0:
________print("Buzz")
____else:
________print(n)

nobody owns the fish

That's just a glorified sudoku

kek

the ages of three children is pretty good, it usually takes 3 beers for people to solve it correctly

Imagine you're in a boat. If you grab a rock from your boat and throw it into the water does the water level rise, stay or fall? What if you threw a balloon? What if you threw water?


Another less logical puzzle:
Write a program that prints its own code.
(it's cheating if the program reads the code directly from its own file to print it)

What does "first" mean?

Quines are lame, IOCCC is much better if you want to test your "clever" tricks.

>there's two right answers
Dropped

triggered lefty detected

Houses are in order 1 2 3 4 5. So The Norwegian lives in house number 1, the occupant of house number 3 drinks milk, etc.
I hadn't thought of it like that, but you're right.

In this puzzle, every person either always tells the truth, or always lies. Those who drink plain tea or milky coffee always tell the truth, while those who drink milky tea or plain coffee always lie. Also remember that if X is false and Y is true:
"X and Y" is a false statement.
"X or Y" is a true statement.

Now that the set-up is done, you run a cafe. One day, three men walk in and approach your counter to order their favoured hot drinks. They make the following statements:
A: I drink Coffee and B drinks Milk.
B: I drink no milk and C drinks Tea.
C: I drink Coffee and A drinks no milk.
You try to solve this problem to no avail, until one of your baristas exclaims that he has solved it! You ask him how he did it, and he sheepishly admits that he recognises one of the three men, and remembered his preferred drink. He offers to share the information he started with, but you smile and tell him he needn't bother. You already know what to serve all three men.

What do the three men drink?

A:tea with milk
B:tea
C:tea with milk