Last active
October 27, 2016 20:28
-
-
Save thomaschandler/b7daccbd8d64982cb8a25c7c3feaf6ac to your computer and use it in GitHub Desktop.
Revisions
-
thomaschandler revised this gist
Oct 27, 2016 . 1 changed file with 24 additions and 24 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -13,42 +13,42 @@ For the bar, you develop a "ticket validation system" that can be used with the 1. Ticket_counter = 10. No other tickets have been received. |Bit|7|6|5|4|3|2|1|0| |---|---|---|---|---|---|---|---|---| |Ticket Number|3|4|5|6|7|8|9|10| |Used?|0|0|0|0|0|0|0|1| 2. Ticket 9 presented. It is accepted, and the field is marked. |Bit|7|6|5|4|3|2|1|0| |---|---|---|---|---|---|---|---|---| |Ticket Number|3|4|5|6|7|8|9|10| |Used?|0|0|0|0|0|0|1|1| 3. Ticket 9 presented again, but it is rejected. |Bit|7|6|5|4|3|2|1|0| |---|---|---|---|---|---|---|---|---| |Ticket Number|3|4|5|6|7|8|9|10| |Used?|0|0|0|0|0|0|1|1| 4. Ticket 3 presented, it is accepted. |Bit|7|6|5|4|3|2|1|0| |---|---|---|---|---|---|---|---|---| |Ticket Number|3|4|5|6|7|8|9|10| |Used?|1|0|0|0|0|0|1|1| 5. Ticket 7 presented, it is accepted. |Bit|7|6|5|4|3|2|1|0| |---|---|---|---|---|---|---|---|---| |Ticket Number|3|4|5|6|7|8|9|10| |Used?|1|0|0|0|1|0|1|1| 6. Ticket 11 is accepted. The bit field is shifted, and ticket 11 is marked as received. |Bit|7|6|5|4|3|2|1|0| |---|---|---|---|---|---|---|---|---| |Ticket Number|4|5|6|7|8|9|10|11| |Used?|0|0|0|1|0|1|1|1| -
thomaschandler revised this gist
Oct 27, 2016 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,7 +7,10 @@ For the bar, you develop a "ticket validation system" that can be used with the 1. A ticket with the same number cannot be used twice 2. A ticket with a value that is too small cannot be used (ex. you took tickets that your friend gave you from another other night and attempt to use them) ------ 1. Ticket_counter = 10. No other tickets have been received. |Bit|7|6|5|4|3|2|1|0| -
thomaschandler revised this gist
Oct 27, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,7 +7,7 @@ For the bar, you develop a "ticket validation system" that can be used with the 1. A ticket with the same number cannot be used twice 2. A ticket with a value that is too small cannot be used (ex. you took tickets that your friend gave you from another other night and attempt to use them) ------ 1. Ticket_counter = 10. No other tickets have been received. |Bit|7|6|5|4|3|2|1|0| -
thomaschandler revised this gist
Oct 27, 2016 . 1 changed file with 1 addition and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,8 +7,7 @@ For the bar, you develop a "ticket validation system" that can be used with the 1. A ticket with the same number cannot be used twice 2. A ticket with a value that is too small cannot be used (ex. you took tickets that your friend gave you from another other night and attempt to use them) ====== 1. Ticket_counter = 10. No other tickets have been received. |Bit|7|6|5|4|3|2|1|0| -
thomaschandler revised this gist
Oct 27, 2016 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,6 +8,7 @@ For the bar, you develop a "ticket validation system" that can be used with the 2. A ticket with a value that is too small cannot be used (ex. you took tickets that your friend gave you from another other night and attempt to use them) 1. Ticket_counter = 10. No other tickets have been received. |Bit|7|6|5|4|3|2|1|0| -
thomaschandler revised this gist
Oct 27, 2016 . 1 changed file with 13 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,44 +2,50 @@ You are a developer and you are getting calls from a bar looking for help. Each The bar staff have been complaining about the difficulty of keeping track of all the tickets during a night, so you have been asked to come up with a solution. For the bar, you develop a "ticket validation system" that can be used with the terminals located at the bar in order to prevent guests from re-using tickets. This ticket validation window ensures the following: 1. A ticket with the same number cannot be used twice 2. A ticket with a value that is too small cannot be used (ex. you took tickets that your friend gave you from another other night and attempt to use them) 1. Ticket_counter = 10. No other tickets have been received. |Bit|7|6|5|4|3|2|1|0| |---|---|---|---|---|---|---|---|---| |Ticket Number|3|4|5|6|7|8|9|10| |Used?|0|0|0|0|0|0|0|1| 2. Ticket 9 presented. It is accepted, and the field is marked. |Bit|7|6|5|4|3|2|1|0| |---|---|---|---|---|---|---|---|---| |Ticket Number|3|4|5|6|7|8|9|10| |Used?|0|0|0|0|0|0|1|1| 3. Ticket 9 presented again, but it is rejected. |Bit|7|6|5|4|3|2|1|0| |---|---|---|---|---|---|---|---|---| |Ticket Number|3|4|5|6|7|8|9|10| |Used?|0|0|0|0|0|0|1|1| 4. Ticket 3 presented, it is accepted. |Bit|7|6|5|4|3|2|1|0| |---|---|---|---|---|---|---|---|---| |Ticket Number|3|4|5|6|7|8|9|10| |Used?|1|0|0|0|0|0|1|1| 5. Ticket 7 presented, it is accepted. |Bit|7|6|5|4|3|2|1|0| |---|---|---|---|---|---|---|---|---| |Ticket Number|3|4|5|6|7|8|9|10| |Used?|1|0|0|0|1|0|1|1| 6. Ticket 11 is accepted. The bit field is shifted, and ticket 11 is marked as received. |Bit|7|6|5|4|3|2|1|0| |---|---|---|---|---|---|---|---|---| |Ticket Number|4|5|6|7|8|9|10|11| |Used?|0|0|0|1|0|1|1|1| -
thomaschandler revised this gist
Oct 27, 2016 . 1 changed file with 10 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,13 @@ You are a developer and you are getting calls from a bar looking for help. Each night, the bar charges a cover, and in exchange guests are given a series of numbered drink tickets that can be used to exchange for drinks. The bar staff have been complaining about the difficulty of keeping track of all the tickets during a night, so you have been asked to come up with a solution. For the bar, you develop a "ticket validation window" that can be used with the terminals located at the bar in order to prevent guests from re-using tickets. This ticket validation window ensures the following: 1. A ticket with the same number cannot be used twice 2. A ticket with a value that is too small cannot be used (ex. you took tickets that your friend gave you from another other night and attempt to use them) 1. Ticket_counter = 10. No other tickets have been received. |Ticket Number|3|4|5|6|7|8|9|10| -
thomaschandler renamed this gist
Oct 27, 2016 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
thomaschandler created this gist
Oct 27, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,35 @@ 1. Ticket_counter = 10. No other tickets have been received. |Ticket Number|3|4|5|6|7|8|9|10| |---|---|---|---|---|---|---|---|---| |Used?|0|0|0|0|0|0|0|1| 2. Ticket 9 presented. It is accepted, and the field is marked. |Ticket Number|3|4|5|6|7|8|9|10| |---|---|---|---|---|---|---|---|---| |Used?|0|0|0|0|0|0|1|1| 3. Ticket 9 presented again, but it is rejected. |Ticket Number|3|4|5|6|7|8|9|10| |---|---|---|---|---|---|---|---|---| |Used?|0|0|0|0|0|0|1|1| 4. Ticket 3 presented, it is accepted. |Ticket Number|3|4|5|6|7|8|9|10| |---|---|---|---|---|---|---|---|---| |Used?|1|0|0|0|0|0|1|1| 5. Ticket 7 presented, it is accepted. |Ticket Number|3|4|5|6|7|8|9|10| |---|---|---|---|---|---|---|---|---| |Used?|1|0|0|0|1|0|1|1| 6. Ticket 11 is accepted. The bit field is shifted, and ticket 11 is marked as received. |Ticket Number|4|5|6|7|8|9|10|11| |---|---|---|---|---|---|---|---|---| |Used?|0|0|0|1|0|1|1|1|