Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cs251_group05
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PUJA RANI
cs251_group05
Commits
28e0c62c
Commit
28e0c62c
authored
Aug 23, 2016
by
TALARI REBECCA BLESSY
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pooja
parents
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
0 deletions
+45
-0
lookup_solve_3.m
lookup_solve_3.m
+45
-0
No files found.
lookup_solve_3.m
0 → 100644
View file @
28e0c62c
function actions = lookup_solve_3(input)
actions = zeros(3,3); #this matrix contains the actions that have been performed on input matrix so far
while(true)
activeAction = zeros(3,3); #this matrix stores the current action
activeAction(2,:) = input(1,:); #these three lines of command are for making the first row zero
input=toggle(input,activeAction,2);
actions = addActions(actions, activeAction);
activeAction = zeros(3,3); #refreshing activeAction to zero matrix
activeAction(3,:) = input(2,:); #these three lines of command are for making the second row zero
input=toggle(input,activeAction,3);
actions = addActions(actions, activeAction);
if(input == zeros(3,3))
break;
endif
activeAction = zeros(3,3); #refreshing activeAction to zero matrix
activeAction = look_up_table(input, activeAction); #this line sees the bottom row pattern in the table and tells which top row buttons to press
input = toggle(input, activeAction, 1);
actions = addActions(actions, activeAction);
endwhile
endfunction
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment