Skip to content
CSE 3504 Project 1
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
README.md
part1.rkt

README.md

Random-Walks-Project


CSE 3504 Project 1

Julie Pham and Tony Pham

Part 1

Simulate a self-avoiding random walk in a finite lattice of 100x100, where the starting point (0,0) is exactly in the middle of the lattice. The simulation stop when the walker is trapped. A trap occurs when at any point in the path, there is no option available for the next step as all available directions have been visited before or out of the borders of the lattice.

Main Idea
  1. Generate the 4 coordinates that surround the current one.
  2. Write filter function which calls built-in filter(lambda, next-positions)
  3. Pick a random coordinate from the filtered coordinates using built-in random function.
  4. In main recursive function, keep track of the number of steps taken.
Random Walk API

gen-coords curr-coord

You can’t perform that action at this time.