CSC 366 Standard Demo Page

The following text was written to the standard output stream when the dotsville_lss.pro program was executed from swi-prolog.

      Welcome to SWI-Prolog (threaded, 64 bits, version 8.2.1)
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software.
Please run ?- license. for legal details.

For online help and background, visit https://www.swi-prolog.org
For built-in help, use ?- help(Topic). or ?- apropos(Word).

?- demos.

>>> beginning of demos



>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> demo:  exists_dot_of_color
          G 
          B 
      R   G 
  Y   R   B 
- - - - - - 
>>> there is a blue dot
>>> there is no purple dot


>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> demo:  exists_dot_of_color_on_table
          G 
          B 
      R   G 
  Y   R   B 
- - - - - - 
>>> there is a blue dot on the table
>>> there is no green dot on the table


>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> demo:  exists_dot_left_of
          G 
          B 
      R   G 
  Y   R   B 
- - - - - - 
>>> there is a red dot to the left of a blue dot
>>> there is not a blue dot to the left of a red dot.


>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> demo:  exists_dot_right_of
          G 
          B 
      R   G 
  Y   R   B 
- - - - - - 
>>> there is a blue dot to the right of a red dot
>>> there is not a red dot to the right of a blue dot.


>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> demo:  list_dots_of_color
          G 
          B 
      R   G 
  Y   R   B 
- - - - - - 
>>> these are the blue dots ...
dot(cell(1,6),color(blue))
dot(cell(3,6),color(blue))
>>> these are the red dots ...
dot(cell(1,4),color(red))
dot(cell(2,4),color(red))
>>> these are the purple dots ...


>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> demo:  list_dots_in_column
          G 
          B 
      R   G 
  Y   R   B 
- - - - - - 
>>> these are the dots in column 1 ...
>>> these are the dots in column 2 ...
dot(cell(1,2),color(yellow))
>>> these are the dots in column 3 ...
>>> these are the dots in column 4 ...
dot(cell(1,4),color(red))
dot(cell(2,4),color(red))
>>> these are the dots in column 5 ...
>>> these are the dots in column 6 ...
dot(cell(1,6),color(blue))
dot(cell(2,6),color(green))
dot(cell(3,6),color(blue))
dot(cell(4,6),color(green))


>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> demo:  add_dot_to_column
          G 
          B 
      R   G 
  Y   R   B 
- - - - - - 
### no room to add a dot to column 6
>>> after adding red and purple dots to columns 2 and 4:  
          G 
      P   B 
  R   R   G 
  Y   R   B 
- - - - - - 


>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> demo:  add_random_dot
          G 
          B 
      R   G 
  Y   R   B 
- - - - - - 
>>> the world after filling columns 1 and 3 with random dots ...
R   O     G 
G   P     B 
Y   P R   G 
Y Y Y R   B 
- - - - - - 


>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> demo:  remove_dot_from_column
          G 
          B 
      R   G 
  Y   R   B 
- - - - - - 
### There is no dot in column 1 to remove.
### There is no dot in column 3 to remove.
### There is no dot in column 5 to remove.
>>> after removing a dot from each nonempty column ...
            
          B 
          G 
      R   B 
- - - - - - 


>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> demo:  count_dots_in_column
          G 
          B 
      R   G 
  Y   R   B 
- - - - - - 
>>> number of dots in column 1:  0
>>> number of dots in column 2:  1
>>> number of dots in column 3:  0
>>> number of dots in column 4:  2
>>> number of dots in column 5:  0
>>> number of dots in column 6:  4


>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> demo:  count_dots
          G 
          B 
      R   G 
  Y   R   B 
- - - - - - 
>>> number of dots in the world:  7


>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> demo:  available_space_count_in_column
          G 
          B 
      R   G 
  Y   R   B 
- - - - - - 
>>> space available in column 1:  4
>>> space available in column 2:  3
>>> space available in column 3:  4
>>> space available in column 4:  2
>>> space available in column 5:  4
>>> space available in column 6:  0


>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> demo:  available_space_count
          G 
          B 
      R   G 
  Y   R   B 
- - - - - - 
>>> number of spaces available in the world:  17


>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> demo:  fill_column
          G 
          B 
      R   G 
  Y   R   B 
- - - - - - 
>>> the world after filling all of the columns:  
B B O Y P G 
B P B B G B 
R O R R R G 
P Y G R B B 
- - - - - - 


>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> demo:  fill_world
          G 
          B 
      R   G 
  Y   R   B 
- - - - - - 
>>> after filling the world:  
Y Y G P G G 
B R B R R B 
Y P P R B G 
Y Y O R O B 
- - - - - - 


>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> demo:  sprinkle_dots
            
            
            
            
- - - - - - 
>>> after sprinkling 12 dots on the empty world:  
R           
G   R       
O R R B     
G P R Y R   
- - - - - - 
>>> after clearning the world:  
            
            
            
            
- - - - - - 
>>> after sprinkling 12 dots on the empty world:  
G         P 
O         P 
O       G O 
Y G   R O P 
- - - - - - 


>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> demo:  is_empty_column
          G 
          B 
      R   G 
  Y   R   B 
- - - - - - 
>>> column 3 is empty 
>>> column 4 is not empty 


>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> demo:  is_full_column
          G 
          B 
      R   G 
  Y   R   B 
- - - - - - 
>>> column 4 is not full 
>>> column 5 is not full 
>>> column 6 is full 


>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> demo:  move_dot_from_column_to_column
          G 
          B 
      R   G 
  Y   R   B 
- - - - - - 
after moving dots from columns 2 to 1, 4 to 2, 6 to 1, and 4 to 6
          R 
G         B 
R         G 
Y         B 
- - - - - - 


>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> demo:  count_the_colored_dots_in_the_column
B Y G G R R 
G B R P O B 
R O G R P G 
Y G G Y B B 
- - - - - - 
>>> number of blue dots in column 1 = 1
>>> number of blue dots in column 2 = 1
>>> number of blue dots in column 3 = 0
>>> number of blue dots in column 4 = 0
>>> number of blue dots in column 5 = 1
>>> number of blue dots in column 6 = 2
B Y G G R R 
G B R P O B 
R O G R P G 
Y G G Y B B 
- - - - - - 
>>> number of purple dots in column 1 = 0
>>> number of purple dots in column 2 = 0
>>> number of purple dots in column 3 = 0
>>> number of purple dots in column 4 = 1
>>> number of purple dots in column 5 = 1
>>> number of purple dots in column 6 = 0

>>> end of demos
true .

?- halt .