Question regarding buffer and rowlength

I have a question regarding these codes in every test:

board:
	.half 0,0,0,0
	.half 0,0,0,0
	.half 0,0,0,0
	.half 0,2,0,0
la $t0 board
	la $t1 buf
	
	sw $t0 0($t1)
	addiu $t0 $t0 2
	sw $t0 4($t1)
	addiu $t0 $t0 2
	sw $t0 8($t1)
	addiu $t0 $t0 2
	sw $t0 12($t1)

I know that these are supposed to save the starting adresses of each row in the buffer. however each row is in this example 4 halfwords long. This means that each starting adress should have a difference of 8. However it is only added 2 to each entry of the buffer. What am I getting wrong here?

Something else, that would maybe answer the question: are subroutunies supposed to edit only one row or the entire board? if its the first option then plus 2 would be correct and i have to redo the tasks.

Hey, the purpose of these instructions is not to store the starting addresses of each row, but to store the addresses to the numbers of the first row. Thus they start at the base address contained in $t0 and store the addresses of 4 consecutive tiles. To get to the address of the next tile, the address needs to be incremented by two, since as you correctly noticed, the tiles are stored as half words.

The answer to your second question depends on the subroutine. Some subroutines, such as check_victory receive the board, whereas e.g. merge or move_one receive only one column or row. Exactly which ones receive the board and which ones receive a row/column is specified in the project description.