lab0spr12 - (Game-theoretic disclaimer To have “perfect...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
CSE 2320 Lab Assignment 0 Goals: Problem solving experience. Finding some smart friends. Requirements: Develop C program(s) to take your next move for the two-person game described below. Input will be two “reasonable” positive integers, n and k . The output will be one of k+1 options: A value chosen from the range 1 . .. k , but not exceeding n . Doesn’t matter . . . opponent has a guaranteed win. Getting Started: 1. In this simple game, there is a pile of n stones. After agreeing on who-goes-first, each player in alternating turns must: Take at least one stone, but no more than k stones, from the pile. The loser is the player left with an empty pile and no option for taking stones.
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: (Game-theoretic disclaimer: To have “perfect information”, the number of stones in the pile is known . . .) 2. Pursuing the following three implementations is encouraged: a. Brute-force, top-down, recursive predicate that indicates whether there is a win in a particular state. b. Fast version of a. that caches (or “memoizes”) known results. c. After spending some time in this “exploratory programming” scenario, you realize that there is a trivial (but perfect) “evaluation function” for this game....
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online