function [final] = self_change(action) #function forming the correspondence shown in the lookup table
	final = zeros(1,3);
	A = [1,1,0;1,1,1;0,1,1];  #conversion matrix for the mapping
	final = mod(action*A,2);
endfunction
#the conversion using the lookup table can be conveniently done using matrix multiplication , in particular , multiplying the last row with A
# gives the top row buttons to be pressed.