Welcome to MSDN Blogs Sign in | Join | Help

Browse by Tags

All Tags » Quiz   (RSS)

Quiz: can you count how many combinations ...

Here's a combinatorics quiz: If you have 2 ordered lists (lengths N, M), how many ways can they be interleaved into a single list while still preserving the partial ordering from the original lists? So if the lists were: List 1: A,B List 2: X,Y The following
Posted by jmstall | 10 Comments
Filed under: , ,

RTS Battle simulation with IronPython

I used Python to simulate Age of Empires archer battles. I wanted to be able to answer questions like: If 12 archers attack 10 archers, what will the margin of victory be? If two armies of the same size attack each other, how do different strategies affect
Posted by jmstall | 7 Comments
Filed under: , ,

Attachment(s): sim3.py

"This statement is false"

Saying phrases like "This statement is false" does mean you've found some fatal flaw in logic itself and it does not make you sound smart. It makes you sound like somebody who doesn't know the difference between syntax and semantics. The real issue...
Posted by jmstall | 11 Comments
Filed under:

Trivia about the [Conditional] attribute

The System.Diagnostics.Conditional attribute has been on blog-todo list for a while, and I'm finally getting around to it. For the quiz-loving folks, here you go: Quiz : First, some lingo: I'll say a Conditional Function is a function with a Conditional
Posted by jmstall | 0 Comments
Filed under:

Quiz: What runs before Main()?

Quiz: What managed code runs before managed Main() in your program startup path? Answers : I note "managed code", because obviously the CLR startup code gets executed, as does other native startup code. 1) The common answer is static constructors referenced
Posted by jmstall | 5 Comments

Answer to Number puzzle

Here are answers + commentary to the number puzzle I posted yesterday, which was, fill in the digits: ABC + DEF GHI OR prove it's impossible. I originally moderated the answers but have now gone back and published them all. My conclusion is that the folks
Posted by jmstall | 4 Comments
Filed under: ,

Number puzzle

Here's a little number puzzle quiz. Fill in the digits: ABC + DEF GHI Where each letter represents a unique digit between 1 and 9, such that all digits are used exactly once. OR (and this is where it gets interesting...) prove that it's impossible to
Posted by jmstall | 15 Comments
Filed under: ,

"Why are you picking off the olives?"

Somebody asked me this at lunch. I had gotten a pizza with olives, and was picking off the olives. I figured that would make a cute good interview question. So consider it a pop-quiz: why would somebody order a pizza with olives and then pick off the
Posted by jmstall | 4 Comments
Filed under: ,

Viewing types with Reflection-Only

It's natural for a tool to use Reflection-Only loading to load an assembly and view the types in it. For example, I used this in my pdb2xml tool. However, I missed an important detail that I wanted to warn you about after getting it wrong myself. Consider
Posted by jmstall | 5 Comments
Filed under: ,

Pop quiz: Who wins in finally vs. return?:

Question 1) What's the return value from this C# function: static int Test() { int val = 1; try { return val; } finally { val = 2; } } Question 2) What about this (using a static instead of local) static int s_val; static int Test() { s_val = 1; try {
Posted by jmstall | 8 Comments
Filed under:
 
Page view tracker