Skip to content

Instantly share code, notes, and snippets.

@Kamikadze4GAME
Last active June 12, 2018 12:11
Show Gist options
  • Save Kamikadze4GAME/1ef6192207c3cdbaf2eec7d44db672af to your computer and use it in GitHub Desktop.
Save Kamikadze4GAME/1ef6192207c3cdbaf2eec7d44db672af to your computer and use it in GitHub Desktop.

1. INPUT

"CARNO"
OO | OC | NO | NC || RESULT
0  | 0  | 0  | 0  || ERROR: not exists
0  | 0  | 0  | 1  || FILLED_IMMEDIATELY
0  | 0  | 1  | 0  || NEW
0  | 0  | 1  | 1  || FILLED in t
0  | 1  | 0  | 0  || ERROR: vanish
0  | 1  | 0  | 1  || NOTHING
0  | 1  | 1  | 0  || ERROR: insurrection
0  | 1  | 1  | 1  || ERROR: insurrection 2
1  | 0  | 0  | 0  || DELETED
1  | 0  | 0  | 1  || FILLED in T
1  | 0  | 1  | 0  || CHECK
1  | 0  | 1  | 1  || FILLED in t
1  | 1  | 0  | 0  || ERROR: vanish
1  | 1  | 0  | 1  || NOTHING
1  | 1  | 1  | 0  || ERROR: insurrection 3
1  | 1  | 1  | 1  || ERROR: insurrection

2. SORT

"CARNO"
OO | OC | NO | NC || RESULT
0  | 0  | 1  | 0  || NEW
0  | 0  | 0  | 1  || FILLED: 0
0  | 0  | 1  | 1  || FILLED: t
1  | 0  | 1  | 1  || FILLED: t
1  | 0  | 0  | 1  || FILLED: T
1  | 0  | 0  | 0  || DELETED
1  | 0  | 1  | 0  || CHECK
0  | 1  | 0  | 1  || NOTHING
1  | 1  | 0  | 1  || NOTHING
1  | 1  | 0  | 0  || ERROR: vanish
0  | 1  | 0  | 0  || ERROR: vanish
0  | 0  | 0  | 0  || ERROR: not exists
1  | 1  | 1  | 0  || ERROR: insurrection 3
1  | 1  | 1  | 1  || ERROR: insurrection
0  | 1  | 1  | 0  || ERROR: insurrection
0  | 1  | 1  | 1  || ERROR: insurrection 2

3. OPTIMIZATIONS (USUAL CASE)

3.1 SIMPLE

  1. vanish (2 in 1)
  2. insurrection (4 in 1)
  3. filled in t (2 in 1)
  4. nothing (2 in 1)
"CARNO"
OO | OC | NO | NC || RESULT
0  | 0  | 1  | 0  || NEW
*  | 0  | 1  | 1  || FILLED: t
0  | 0  | 0  | 1  || FILLED: 0
1  | 0  | 0  | 1  || FILLED: T
1  | 0  | 0  | 0  || DELETED
1  | 0  | 1  | 0  || CHECK
*  | 1  | 0  | 0  || ERROR: vanish
0  | 0  | 0  | 0  || ERROR: not exists
*  | 1  | 1  | *  || ERROR: insurrection
*  | 1  | 0  | 1  || NOTHING

3.2 DEEP

  1. delete not exists
  2. insurrection + vanish + nothing (3 in 1)
  3. filled 0 + t + T (4 in 1)
"PSEUDO"
OO | OC | NO | NC || RESULT
*  | 1  | *  | *  || ERROR (insurrection, vanish, nothing)
*  | 0  | *  | 1  || FILLED (0, t, T)
0  | 0  | 1  | 0  || NEW
1  | 0  | 0  | 0  || DELETED
1  | 0  | 1  | 0  || CHECK

"PSEUDO CODE"
if (OC==1) => ERROR (insurrection, vanish, nothing)
if (NC==1) => FILLED (0, t, T)
if (OO==0) => NEW
if (NO==0) => DELETED
           => CHECK

3.3 ERRORS

Carno:

"CARNO"
OO | OC | NO | NC || RESULT
*  | 1  | 1  | *  || ERROR: resurrection
*  | 1  | 0  | 0  || ERROR: vanish
*  | 1  | 0  | 1  || NOTHING

"PSEUDO CODE"
if(NO==1) => RESURRECTION
if(NC==0) => VANISH
          => NOTHING

3.4 FILLS

"CARNO"
OO | OC | NO | NC || RESULT
*  | 0  | 1  | 1  || FILLED: t
1  | 0  | 0  | 1  || FILLED: T
0  | 0  | 0  | 1  || FILLED: 0

"PSEUDO CODE"
if(NO==1) => FILLED: t
if(OO==1) => FILLED: T
          => FILLED: 0

3.5 RESULT

"PSEUDO CODE"
if (OC==1) => ERROR:
    if (NO==1) => RESURRECTION
    if (NC==0) => VANISH
               => NOTHING
if (NC==1) => FILLED:
    if (NO==1) => t
    if (OO==1) => T
               => 0
if (OO==0) => NEW
if (NO==0) => DELETED
           => CHECK

4. OPTIMIZATIONS WITH DROP DATA

The main idea is that we can determine with accuracy only the conclusion in which at the place of the pass are stars. In other cases, we can not with accuracy state the logical conclusion.

4.1 NO "NEW OPEN"

4.1.1 INPUT

"CARNO"
OO | OC | NO? | NC || RESULT
*  | 1  | *?  | *  || ERROR (RESURRECTION?, VANISH?, NOTHING?)
*  | 0  | *?  | 1  || FILLED (0?, t?, T?)
0  | 0  | 1?  | 0  || NEW?
1  | 0  | 0?  | 0  || DELETED?
1  | 0  | 1?  | 0  || CHECK?

NOTE: We can't check and new, but with some !!возможностью that it was deleted.

4.1.2 ERRORS

"CARNO"
OO | OC | NO? | NC || RESULT
*  | 1  | 1?  | *  || ERROR: resurrection?
*  | 1  | 0?  | 0  || ERROR: vanish?
*  | 1  | 0?  | 1  || NOTHING?

NOTE: We can't exactly determinate type of error or nothing.

4.1.3 FILLS

"CARNO"
OO | OC | NO? | NC || RESULT
*  | 0  | 1?  | 1  || FILLED: t?
1  | 0  | 0?  | 1  || FILLED: T?
0  | 0  | 0?  | 1  || FILLED: 0?

NOTE: We can't exactly determinate type of filled.

4.1.4 RESULT

"PSEUDO CODE"
if (OC==1) => ERROR (RESURRECTION?, VANISH?, NOTHING?)
if (NC==1) => FILLED (0?, t?, T?)
if (OO==0) => NEW?
           => (CHECK || DELETED)?

4.2 NO "NEW CLOSE"

4.2.1 INPUT

"CARNO"
OO | OC | NO | NC? || RESULT
*  | 1  | *  | *?  || ERROR (insurrection, vanish?, nothing?)
*  | 0  | *  | 1?  || FILLED (0, t, T)?
1  | 0  | 0  | 0?  || DELETED?
0  | 0  | 1  | 0?  || NEW
1  | 0  | 1  | 0?  || CHECK

NOTE: We can't fill and delete.

4.2.2 ERRORS

"CARNO"
OO | OC | NO | NC? || RESULT
*  | 1  | 1  | *?  || ERROR: resurrection
*  | 1  | 0  | 0?  || ERROR: vanish?
*  | 1  | 0  | 1?  || NOTHING?

"PSEUDO CODE"
if(NO==1) => RESURRECTION
          => (VANISH || NOTHING) ?

NOTE: We can't exactly determinate vanish or nothing.

4.2.3 FILLS

NOTE: We can't catch fills.

4.2.4 RESULT

"PSEUDO CODE"
if (OC==1) => ERROR:
    if (NO==1) => RESURRECTION
               => (VANISH || NOTHING)?
if (NO==1) => :
    if (OO==0) => NEW
               => CHECK
               => (FILLED || DELETED)?

5. RESULT

5.1 FULL DATA

"PSEUDO CODE"
if (OC==1) => ERROR:
     if(NO==1) => RESURRECTION
if(NC==0) => VANISH
          => NOTHING
if (NC==1) => FILLED:
        if(NO==1) => t
        if(OO==1) => T
                  => 0
if (OO==0) => NEW
if (NO==0) => DELETED
           => CHECK

5.2 NO "NEW OPEN"

"PSEUDO CODE"
if (OC==1) => ERROR (RESURRECTION?, VANISH?, NOTHING?)
if (NC==1) => FILLED (0?, t?, T?)
if (OO==0) => NEW
           => (CHECK || DELETED)?

5.3 NO "NEW CLOSE"

"PSEUDO CODE"
if (OC==1) => ERROR:
        if (NO==1) => RESURRECTION
                   => (VANISH || NOTHING)?
if (NO==1) =>
if (OO==0) => NEW
           => CHECK
           => (FILLED || DELETED)?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment