Coder Social home page Coder Social logo

andrewjdawson2016 / catan-board-generator Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 25.74 MB

Personal project made with brother. I wrote the backend logic for generating boards and my brother wrote the front-end for rendering the board. The interesting problem here was how to make boards evenly distributed (fair) but still random.

Swift 12.39% Objective-C 87.59% Ruby 0.02%

catan-board-generator's Introduction

Overview

The project was to make a board generator for Catan. The game of Catan starts with a different board every time. Making fair boards that are random can be a little tricky so we made an app to help out.

Team Members

My brother and I wrote the app. All the commits are done by him because I did not have a Mac at the time, so I wrote all my code on his computer. My brother wrote all the logic for rendering and drawing the board. I wrote all the logic for generating a fair and random board.

Challenges

The interesting challenge is how to make the board evenly distributed, so that not too many of the same resource types are grouped together but the board is still random. Additionally, all fair boards must have red numbers not touching. In order to do this I generate a "perfect" board, and then perform two random swaps. By perfect I mean none of the same two resource types touch each other, and no red numbers touch each other. This is done via recursive backtracking (while shuffling throughout to keep it random). Then I perform two swaps of tiles so that some random clustering is possible.

Learning

Through this experience I learned Swift, how to write an iOS app and I solved an interesting algorithmic problem.

catan-board-generator's People

Contributors

derekhdawson avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.