![]() ![]() Introduce a new jump label, but is only useful for very short jumps Notation using $ is just a shorthand so that you don't have to So, if we skip 4 bytes we end up at `cp '/'` instruction. Instruction takes 2 bytes, xor takes 1 byte and ret takes also 1 byte. Let's assume you know that when assembled jr The next instruction, `jr nz,$+4` is a conditional jump,īut where does it go? The $+4 expression means current address ($) So, that tests if we've got character '-' in If flag z was not set, we just continue with next instruction, which Skipped one character of input if that character was a space. On the next line, `jr z,readBall` will jump back to the start ofįunction readBall only if the flag z is set. The value in a is equal to the value given in the cp instruction. ![]() We are interested in z flag, which will be set when Instruction, `ld a,(de)` reads one byte from memory where de pointsĪnd puts that byte into register a. Now lets move 16 lines down, to the `readBall` function. From that address on, each letter is stored One line of input at a fixed location in memory, so that's where weĬan read it from. The monitor routines that are in ROM will always place Some more info on how it works: The first line, `ld de,11a9h` points the register pair de into the The program prints output on the next line and returns. Go into monitor, run it using G1200 command and put the input on the input line right after the G1200 command. Your challenge today is to determine a bowling score from a score sheet. It is typically rendered as a slash on scoresheets in place of the second pin count for a frame. A player achieving a spare is awarded ten points, plus a bonus of whatever is scored with the next ball (only the first ball is counted). In this way, the points scored for the two balls after the strike are counted twice.Ī "spare" is awarded when no pins are left standing after the second ball of a frame i.e., a player uses both balls of a frame to clear all ten pins. When all ten pins are knocked down with the first ball of a frame (called a strike and typically rendered as an "X" on a scoresheet), a player is awarded ten points, plus a bonus of whatever is scored with the next two balls. Strikes and spares affect the next balls in different ways. In addition to a gutter ball (which is 0 pins), you have strikes and spares as well as 1 to 9 pins being knocked down. The tenth frame may be composed of up to three rolls: the bonus roll(s) following a strike or spare in the tenth (sometimes referred to as the eleventh and twelfth frames) are fill ball(s) used only to calculate the score of the mark rolled in the tenth.īowing scoring is a bit tricky (which is why this is an intermediate challenge). The bowler is allowed 10 frames in which to knock down pins, with frames one (1) through nine (9) being composed of up to two rolls. ![]() In most frames (see below about the tenth frame) you get two attempts per "frame" before the remaining pins are cleared. The game of bowling is pretty simple: you have ten pins arranged in a triangle, and you roll a ball down a slick alley towards them and try and knock as many down as possible. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |