暫存器指令 - 拼圖
By Brianna
at 2020-10-30T15:56
at 2020-10-30T15:56
Table of Contents
puzzleUp風味題 Vol.18
等待真puzzleUp出題中
【暫存器指令】
你有一個CPU
具有兩個暫存器R1,R2,初始值為1,2
該CPU有三種指令:
op A: 令R1的值為R1+R2,同時令R2的值為R1-R2(取絕對值)
op B: 若R1的值為偶數,則令其為R1/2,否則,令其為R1*3+1
op C: 將R1與R2的值互換
你要用最簡短的指令使R1成為99
問該指令為?
例:若要使R1成為39,指令為ABACBA
OP R1 R2
1 2
A 3 1
B 10 1
A 11 9
C 9 11
B 28 11
A 39 17
寫了一個模擬器,歡迎大家使用
https://buffalobill.idv.tw/Public/Misc/registerOp/
感覺只要調整指令跟暫存器數目
題目可以千變萬化~
--
等待真puzzleUp出題中
【暫存器指令】
你有一個CPU
具有兩個暫存器R1,R2,初始值為1,2
該CPU有三種指令:
op A: 令R1的值為R1+R2,同時令R2的值為R1-R2(取絕對值)
op B: 若R1的值為偶數,則令其為R1/2,否則,令其為R1*3+1
op C: 將R1與R2的值互換
你要用最簡短的指令使R1成為99
問該指令為?
例:若要使R1成為39,指令為ABACBA
OP R1 R2
1 2
A 3 1
B 10 1
A 11 9
C 9 11
B 28 11
A 39 17
寫了一個模擬器,歡迎大家使用
https://buffalobill.idv.tw/Public/Misc/registerOp/
感覺只要調整指令跟暫存器數目
題目可以千變萬化~
--
Tags:
拼圖
All Comments
By Callum
at 2020-11-01T01:45
at 2020-11-01T01:45
By Aaliyah
at 2020-11-02T11:34
at 2020-11-02T11:34
By David
at 2020-11-03T21:23
at 2020-11-03T21:23
By Suhail Hany
at 2020-11-05T07:12
at 2020-11-05T07:12
By Barb Cronin
at 2020-11-06T17:01
at 2020-11-06T17:01
By Belly
at 2020-11-08T02:50
at 2020-11-08T02:50
By Emily
at 2020-11-09T12:40
at 2020-11-09T12:40
By Xanthe
at 2020-11-10T22:29
at 2020-11-10T22:29
By Xanthe
at 2020-11-12T08:18
at 2020-11-12T08:18
By Suhail Hany
at 2020-11-13T18:07
at 2020-11-13T18:07
By Rae
at 2020-11-15T03:56
at 2020-11-15T03:56
Related Posts
偏序著色II
By David
at 2020-10-29T09:33
at 2020-10-29T09:33
Puzzle up 11/4 起跑
By Regina
at 2020-10-29T08:35
at 2020-10-29T08:35
偏序著色
By Susan
at 2020-10-28T09:27
at 2020-10-28T09:27
Sudoku - Adjacent
By Margaret
at 2020-10-28T09:11
at 2020-10-28T09:11
三階幻方
By Skylar DavisLinda
at 2020-10-26T15:46
at 2020-10-26T15:46