GithubHelp home page GithubHelp logo

assemblylingo's Introduction

AssemblyLingo

The classic guessing game Lingo, written in MIPS assembly language as part of a CS course assignment. If, for some reason, you actually want to run this, get a decent MIPS assembler. I use MARS, a simulated assembler packaged to run on JVM that does a nice job.

Written June 2016, uploaded September 2016 (AIM)

An in-depth functionality description, for anyone brave or bored enough to dive in...

Structure:

  • Words are stored as both upper-case and lower-case word-aligned ASCII strings
  • Welcome message and instruction ("the word to guess is: ") are printed
  • Random number generator seeded by current time; random number generated between 0 and 9, multiplied by 16 to index one of the 10 words
  • First character of the chosen word displayed; a small loop prints four underscores
  • Each guess is stored in a 6-byte .space field
  • Outermost loop (LOOP) loops through guesses and checks each guess, as described below:
  • Inner loop (CHECK) first checks each character with the character in the chosen word at the same index (offset by 8 to access lowercase version for comparison); if the two are identical, a "right-character-right-place" (RCRP) counter is incremented, a "right-character-right-place" message displayed, and the next character is checked.
  • If character "held" by "CHECK" is not found to be in right place, an inner loop (EACH) then compares the character against each other character in the chosen word (except the character at the same index). If any other character is equal to the current one, a "right-character-wrong-place" message is displayed and EACH is broken, allowing CHECK to increment to the next character.
  • If the RCRP counter is found to be greater than 4 by LOOP, then the game is ended and a "win" message displayed. If the LOOP counter is found to be greater than 4, the game is ended and a "losing" message is displayed.
  • Players are given the option to play again by entering "yes", or may exit by entering "no".

-6/26/2016

assemblylingo's People

Contributors

pitchaim avatar

Watchers

 avatar  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.