Title
Oatmeal
Go Home
Category
Description
The latest entries posted on Oatmeal
Address
Phone Number
+1 609-831-2326 (US) | Message me
Site Icon
Oatmeal
Tags
More From This Site
Page Views
0
Share
Update Time
2022-05-07 07:23:52

"I love Oatmeal"

www.eli.li VS www.gqak.com

2022-05-07 07:23:52

Eli Mellen [email protected] Mastodon, dog.estate I'm much like Lyft, but for Moomintroll. Pronouns: he him his Oatmeal A digital pillow fort An unexpected visitor came to the tree in our neighbor’s yard today. May 1, 2022 Permalink In reply to: ~karlen, "no one will ever read this but..." ~dozens recently introduced me to this series where blog posts that are at least a year old and feature the phrase “no one will ever read this but” are read allowed…and…it is remarkable. April 29, 2022 Permalink Signs of spring March 13, 2022 Permalink Birch poly pore. March 13, 2022 Permalink Card game of hidden information and structured communication This is a game of hidden information, structured communication and cooperation. To play you will need a standard deck of playing cards. The game is a modified version of Hanabi which is played with a custom deck of cards and tokens.How to playRemove aces and 2s from the deck. Place aces in a pile, face up. These are the information tokens, a form of in-game currency.Place the 2s in a line at the center of the play space. All cards will be played on top of the 2s.Shuffle the remaining cards. Deal each player (up-to 5 players) 5 cards, face down.Once everyone has cards, lift cards. A player cannot ever look at their own hand! Players hold their cards so that all other players can see them, but so they cannot see their own cards.Players now go around the circle, building ascending piles of cards by suit, starting from 2 working up.During a turn a player can take 1 of 3 actions:Take an ace (information token) and use it to tell another player something about their handA player may only reveal information about suit or number. E.g., they can indicate that another player has 2 spades or may indicate that a player has 3 3s.After revealing information the ace is discarded and is unusable until it is reactivated.Discard a card from their own hand, reactivating a previously discarded ace for another player to use.Play a card onto the play piles.A player must always have 5 cards in their hand. After playing a card, or discarding a card, a player draws another card from the remainder of the deck.Cards that have been discarded to reactive an ace cannot be played and are removed from the game space.If the draw pile is empty, continue playing until either everyone runs out of cards, or no moves can be made. Play is over when no moves can be made.The game has a soft win-state, where you determine by how much the group won by how many piles they successfully create, 2 - king. February 28, 2022 Permalink From where to what? February 21, 2022 Permalink What is an addressing mode? In a recent post I referenced addressing modes. But what the heck are they!?Setting the stageThe instruction register holds the program instruction that is currently being run.A fixed number of bits within the instruction register represent the operation, e.g. “op. code” — examples of these instructions include things like add, subtract, load, and store. We can imagine the instruction register like this:There’s a fixed number of bits allocated to the op. code (the 6 left-most boxes), and then a fixed number of bits that hold the operand/s being operated on (remaining 10 boxes). An operand could be a value, a CPU register, or a memory address. This set of fixed bits is referred to as the “address field.”The number of bits allocated to the address field determines the amount of memory that can be addressed. The number of bits allocated to the op. codes determines how expressive the op. codes can be (or at least how many of them there can be).Addressing modes provide different ways to use the addressable memory.In my diagram, 2 bits of the operation code are used to determine the addressing mode. The addressing mode tells the processor how the bits in the address field should be interpreted.For example… LDA #80 LDA $80These similar looking instructions are pretty different.# tells us that the number following is a literal value.$ tells us that the number following references a memory address.So, LDA #80 loads the literal decimal value 80 into the A register and LDA $80 loads the value located at memory address $80 into the A register.#80 is known as immediate mode because we are directly, or immediately, loading a value, while $80 is known as absolute, or zero page, mode.What about a literal hex value?BOOM! LDA #$80This loads the literal hex value $80 (e.g. 128) into the A register.Other resourcesCheck this out, from 6502.org for more info on addressing modes.One of my favorite ways that I’ve seen things at least adjacent to addressing modes implemented is through the use of runes. Day 1 of compdanzas’ uxn tutorial includes info on this. January 31, 2022 Permalink January 30, 2022 Permalink Notes on 6502 Assembly The NES runs a very slightly modified 6502 processor. What follows are some very introductory, and not at all exhaustive notes on 6502 Assembly, or ASM.If you find this at all interesting, Easy 6502 is a really great introductory primer on 6502 Assembly that lets you get your hands dirty right from a web browser.NumbersNumbers prefixed with one of the following:$ are hexadecimal format# are literal numbersAny other number without either of these prefixes refers to a memory location.So, LDA #$01Loads the hex value $01 into register A.Registers and flagsThere are 3 primary registers,AXYA is usually called the accumulator.Each register holds a single byteSP is the stack pointer, a register that is decremented every time a byte is pushed onto the stack and incremented whenever a byte is popped off the stack.PC is the program counter. PC is how the processor keeps track of where in the currently running program it is.Processor flagsEach flag is 1 bit, so all 7 flags can live in a single byteMore info on registers and flags.InstructionsIn 6502 Assembly instructions are like words in Forth, or functions in a higher order programming language. Every instruction takes 0 or 1 arguments.An example of some instructions, LDA #$c0 ; Load the hex value $c0 into the A register TAX ; Transfer the value in the A register to X INX ; Increment the value in the X register ADC #$c4 ; Add the hex value $c4 to the A register BRK ; Break - we're doneFor a full list of 6502 ASM instructions see,http://www.6502.org/tutorials/6502opcodes.html6502 ASM has a handful of branching instructions — they almost all rely on flags to determine what branch to follow.Addressing modesThe 6502 has 65536 bytes of available memory. These bytes are typically described using the HEX range $0000 - $ffff.When the 6502 refers to addressing modes, it really means “What is the source of the data used in this instruction?”The different modes are,Absolute: $c000With absolute addressing, the full memory location is used as the argument to the instruction.Zero page: $c0All instructions that support absolute addressing (with the exception of the jump instructions) also have the option to take a single-byte address. This type of addressing is called “zero page” - only the first page (the first 256 bytes) of memory is accessible. This is faster, as only one byte needs to be looked up, and takes up less space in the assembled code as well.Zero page,X: $c0,XIn this mode, a zero page address is given, and then the value of the X register is added.Zero page,Y: $c0,YThis is the equivalent of zero page,X, but can only be used with LDX and STX.Absolute,X and absolute,Y: $c000,X and $c000,YThese are the absolute addressing versions of zero page,X and zero page,Y.Immediate: #$c0Immediate addressing doesn’t strictly deal with memory addresses - this is the mode where actual values are used. For example, LDX #$01 loads the value $01 into the X register. This is very different to the zero page instruction LDX $01 that loads the value at memory location $01 into the X register.Relative: $c0 (or label)Relative addressing is used for branching instructions. These instructions take a single byte, which is used as an offset from the following instruction.ImplicitSome instructions don’t deal with memory locations, for example, INX - increment the X register. These have implicit addressing because the argument is implied by the instruction.Indirect: ($c000)Indirect addressing uses an absolute address to look up another address. The first address gives the least significant byte of the address, and the following byte gives the most significant byte.Indexed indirect: ($c0,X)This one’s kinda weird. It’s like a cross between zero page,X and indirect. Basically, you take the zero page address, add the value of the X register to it, then use that to look up a two-byte address.Indirect indexed: ($c0),YIndirect indexed is like indexed indirect, but instead of adding the X register to the address before de-referencing, the zero page address is de-referenced, and the Y register is added to the resulting address.For more on the different modes of addressing,http://www.emulator101.com/6502-addressing-modes.htmlThe stackThe current depth of the stack is measured by the stack pointer, a special register. The stack lives in memory between $0100 and $01ff. The stack pointer is initially $ff, which points to memory location $01ff. When a byte is pushed onto the stack, the stack pointer becomes $fe, or memory location $01fe, and so on.JumpingJumping is like branching with two main differences:First, jumps are not conditionally executedSecond, they take a two-byte absolute addressFor small programs, this second detail isn’t important, as you’ll be using labels, and the assembler works out the correct memory location from the label. For larger programs though, jumping is the only way to move from one section of the code to another.Other ResourcesBecause these are but the barest of minimum notes, here are some more resources for continued reference.http://www.6502.orghttps://nerdy-nights.nes.science/https://patater.com/gbaguy/nesasm.htmhttps://wiki.nesdev.com/w/index.php/Nesdev_Wikihttps://shiru.untergrund.net/articles/programming_nes_games_in_c.htmhttps://famicom.party/bookhttps://wiki.xxiivv.com/site/assembly.htmlhttps://www.tinybrain.fans/assembly-6502.htmlhttps://archive.org/details/6502_Assembly_Language_Subroutines/page/5/mode/2uphttps://www.assemblytutorial.comhttps://www.chibiakumas.com/6502/#Lesson1https://www.youtube.com/watch?v=lsvSZamCCBMhttps://www.middle-engine.com/blog/posts/2020/06/23/programming-the-nes-the-6502-in-detail January 27, 2022 Permalink Notes on Big O Notation Imagine we have 2 implementations of the same function. How do we know which one is best? This is what Big O helps with! Big O notation is a little bit like the Richter scale for code performance.Write a function that calculates the sum of all numbers from 1 up to (and including) n.function addUpToV1(n) { let total = 0; for (let i = 1; i O(n^2)Smaller terms don’t matter! O(n+10) -> O(n), O(n^2+5n+8) -> O(n^2)Arithmetic operations are constantVariable assignment is constantAccessing elements in an array (by index) or object (by key) is constantIn a loop the complexity is determined by the length of the loop multiplied by the the complexity of whatever is happening inside of the loop// O(n), as n grows our runtime growsfunction logAtLeast5(n) { for (var i = 1; i