400 to 40

Well, next year is my 40th Birthday, November 6th to be exact. That also happens to be exactly 400 days from today!

So, I’m going to make the most of the next 400 days and make them some of the best days of my life!

I’ve always had ideas and plans to do things, but I haven’t followed through with them. So, the next 400 days, I’m going to do as much as I can. I’ll be social about it, sharing with my family and friends, and readers here (if there are any).

I’ve got music to create, things to make and fun to be had.

And this is the big one. I’m planning on getting myself in to shape. In the last 6 months or so, I’ve started to lose a little weight, to the point a number of people have passed comments. From from today, I’m actively trying.

I’m not going to extremes, like skydiving. But there are projects, experiences or places which I haven’t created, seen or done. If I don’t do it now, I feel like I’ll just never do it. So I’m going to ‘Nike it’… Just Do It!

Day 401 – Starting Early – Vegetable Garden

Tomorrow is 400. I’ll explain the countdown tomorrow..

I went to see “The House with a Clock in Its Walls” with the family, in-law’s and sister-in-law and co.  The movie was enjoyable, probably a watch only once movie for me though.

The wife made a call when we got back to the car to a nursery that wasn’t too far away to see if any Venus Fly Traps were in stock.  Their first delivery was yesterday! We were told a couple of weeks ago that they can’t be imported, and as there are very few growers, they are hard to get.  We were also told that nurseries get their first delivery around October.  As they were in stock, we headed past there to pick up a couple.

While we were there, they had a 5 for $10 deal on some vegetable plants, so we picked up a couple of strawberry plants, a couple of cocktail tomato plants and a yellow cherry tomato plant.  I had planned on planting the vegetable garden next week on my week off, but as we were there and they were on sale, we started early.

When we got home, we checked the soil in the vegetable garden, mixed it, watered it, then planted the new plants we just bought.  After looking at the garden, it looked a little bare, so we headed to Bunnings and picked up some more plants. We picked up up some Celery, ‘CuteCumber’, Zucchini and a combination Lettuce plant. And a packet of Kale seeds.

The wife picked up some herbs (and another succulent as well).

Fingers crossed the garden grows strong!

 

Minesweeper in PHP

Whilst my Sudoku solver is up to a basic level, I just need to implement so more logic to reduce possible values, I started to think about the game Minesweeper.  I’ve played it since it was in the Microsoft Entertainment Pack 1, which was installed in to Windows 3.

Minesweeper is another grid based game, the player has to find all the mines which are hidden.  The basic game is an 8×8 grid with 10 mines. The first reveal is never a mine, but will show either a blank grid or a number. If it’s a number, it means in the 8 surrounding cells, there are that many mines. If it’s blank, all the blocks around will be revealed until a number is shown, indicating there is a mine in a surrounding cell.  If you think a cell is a mine, you can mark so it can’t be clicked.

The game is over when the number of remaining cells are the same as the number of mines, whether they are marked or not.

I actually started to think about this while I was trying to work out better ways to handle the logic in the Sudoku solver.  I was thinking, how are the minesweeper grids generated. I read one site where it say when the grid is presented, on the first click, if it’s a mine, the mine is moved to another cell and the grid is recalculated. I started to think the other way around. Generate the grid AFTER the first click, eliminating that cell as a possible mine.  So it would be a case of creating an array with all the cell references, remove the click cell, randomise the remaining references and then trimming the array to the number of bombs.  So that’s where I started.

I started coding and was able to quickly generate the grid, values and the numbers to indicate the number of mines surrounding a cell.  I did have to think of a better way to identify the numbers on the grid, mainly because of the function to reveal blank cells could go out of the region by using a 2 digit identification number.  So the grid numbers are identified by 4 digits, starting from 1010.  This method might not have been the best, but it worked for me.

I had a rough idea how I wanted to handle what happens when a blank cell is clicked, but that’s what took me the most time. Given that the surrounding cells have to be checked, then those have to be checked as well if they are blank.

The code is commented and I’ve tried using variable names that make things obvious. I’ve still used the similar classes as Sudoku. An input handler and a grid generator.  It’s a basic interface, but the core game mechanics are there.

When you run it, you get to choose difficulty or specify a custom sized grid:

Then when you start the game, you are submitting values from a form over and over again.

Until the game is lost

Or won

Below is the code. I’ve tried to factor as best I could without going too far.  Let me know if you have any suggestions.

index.php

<?php  
// Minesweeper in PHP by Daniel Porter - thisismywww.com 
// Version 1.0 - 28 Sept 2018
?>
<html>
  <head>
    <title>Minesweeper</title>
  </head>
  <body>
    <h1>Minesweeper</h1>
    <?php
      $output = "";
      include('input_handler.php');
      include('grid_gen.php');
      $grid_gen->generate();
    ?>
  </body>
</html>

input_handler.php

<?php
// Minesweeper in PHP by Daniel Porter - thisismywww.com
// Version 1.0 - 28 Sept 2018

// class to handle input
class data_handler{
  public $mode = "";          // Specifies game mode - new/start/game/game_won/game_over
  public $grid_reference = array();   // Array of all grid references
  public $cell_values = array();    // Values in each cell, only for display
  public $mine_cells = array();    // Array of cells with mines in them
  public $visible_cells = array();  // Array of grid_references which are 'visible' 
  public $marked_cells = array();    // Array of grid_references which are 'marked'
  public $difficulty = "easy";      // Difficulty for grid: easy, medium, hard, custom
  public $num_rows;          // Number of rows in grid
  public $num_cols;          // Number of columns in grid
  public $num_mines;          // Number of mines in grid
  public $submitted_block;      // Block which is submitted each click
  public $mark_toggle;        // Variable if marked is checked
  
  function __construct(){
    // Mode = config  Config is submitted
    // Mode = game     Game is being played
      // If no cells are posted, generate grid and then play with submitted cell
      // If cells are posted, set variables and play game
    // Mode = new    Nothing is posted
      
    if(isset($_POST['mode'])){
      $this->mode=$_POST['mode']; 
      if($this->mode == "game"){
        $this->submitted_block = $_POST['submitted_block'];
        $this->num_rows = $_POST['num_rows'];
        $this->num_cols = $_POST['num_cols'];
                $this->num_mines = $_POST['num_mines'];
        
        if(!isset($_POST['cell_values'])){
        $this->grid_reference = unserialize($_POST['grid_reference']);
        $this->generate_values();
        $this->play_game();
        }else{
          $this->grid_reference = unserialize($_POST['grid_reference']);
          $this->cell_values = unserialize($_POST['cell_values']);
          $this->mine_cells = unserialize($_POST['mine_cells']);
          $this->visible_cells = unserialize($_POST['visible_cells']);
          $this->marked_cells = unserialize($_POST['marked_cells']);
          if(isset($_POST['mark_toggle'])){
            $this->mark_toggle = $_POST['mark_toggle'];
          }else{
            $this->mark_toggle = false;
          }
          $this->play_game();
        }
      }
      if($this->mode == "start"){
        $this->generate_grid();
      }
    }else{
      $this->mode="new";
    }
  }

  function generate_grid(){
    // Set the number of rows, columns and mines based on difficulty
    switch ($_POST['difficulty']){
      case "easy":
        $this->num_rows = "8";
        $this->num_cols = "8";
        $this->num_mines = "10";
      break;
      case "medium":
        $this->num_rows = "16";
        $this->num_cols = "16";
        $this->num_mines = "40";
      break;
      case "hard":
        $this->num_rows = "24";
        $this->num_cols = "24";
        $this->num_mines = "99";
      break;
      case "custom":
        $this->num_rows = $_POST['num_rows'];
        $this->num_cols = $_POST['num_cols'];
        $this->num_mines = $_POST['num_mines'];
      break;
    }
    // Generate grid)reference array
    for ($x=10;$x<($this->num_rows+10);$x++){
      for ($y=10;$y<($this->num_cols+10);$y++){
        array_push($this->grid_reference,$x.$y);
      }
    }
  }

  function generate_values(){
    // Generate mine_cells and cell_values - need to know mine_cells before cell values
    // Mine Cells are created by using the grid references, minus clicked cell then trimmed
    $this->mine_cells = $this->grid_reference;
    $key = array_search($this->submitted_block, $this->mine_cells);
    unset($this->mine_cells[$key]);
    shuffle($this->mine_cells);
    $this->mine_cells = array_values(array_slice($this->mine_cells, 0, $this->num_mines));
    
    // Calculate how many mines are surrounding each cell if cell isn't a bomb
    // If none, don't set value
    
    foreach($this->grid_reference as $cell){
      if (!in_array($cell,$this->mine_cells)){
        $cells_to_check = array();
        $cells_to_check = $this->get_surrounding_cells($cell);
        $number = count(array_intersect($cells_to_check,$this->mine_cells));
        if ($number>0){
        $this->cell_values[$cell]=$number;
        }
      }
    }
    // On first round, make the submitted block visible
    $this->process_cell($this->submitted_block);  
  }
  
  function play_game(){
    // If toggle marked is true, run add to visible function then check if game is won
    // otherwise, if the clicked cell 
    // It the submitted isn't marked, run click function based on if it's a mine, number of blank
    
    if ($this->mark_toggle == true){
      $this->process_cell($this->submitted_block);
      $this->is_game_won();
      return;
    }else{
      if (!in_array($this->submitted_block,$this->marked_cells)){
        if (in_array($this->submitted_block,$this->mine_cells)){
          $this->click_mine();
          return;
        }elseif (isset($this->cell_values[$this->submitted_block])){
          $this->click_number();
          return;
        }else{
          $this->click_blank();
          return;
        }
      }
    }
  }

  function click_mine(){
    // If a mine is clicked, it's game over
    $this->game_over();
  }
  
  function click_number(){
    // If a number is clicked, only that cell is made visible
    $this->process_cell($this->submitted_block);
  }

  function click_blank(){
    // When a blank cell is clicked, each surrounding block is made visible.
    // Repeating outwards each time there are blank cells made visible.
    // To reduce number of checks, each time a cell is checked, its in an array
    // so that it's not checked again.
    
    $cells_to_check = $this->get_surrounding_cells($this->submitted_block);  
    $cells_checked = array(); 
    $this->process_cell($this->submitted_block);
    $x=1;
    while ($x>0){
      $x=0;
      foreach ($cells_to_check as $cell){
        $this->process_cell($cell);
        // If the cell is empty and it hasn't been checked we add it to checked cells
        // add the surrounding blank cells to the array to be checked. Increasing x so it will loop again.
         if((!isset($this->cell_values[$cell])) && (!in_array($cell,$cells_checked))){
          array_push($cells_checked,$cell);
          $cells_to_check = array_merge($cells_to_check,$this->get_surrounding_cells($cell));
          array_diff($cells_to_check,array($cell));
          $x++;
        }
      }
    }
  }

  function game_over(){
    // Set all cells visible and set mode to game_over
    $this->visible_cells = $this->grid_reference;
    $this->mode = "game_over";
  }
  
  function get_surrounding_cells($cell){
    // Sloppy, but generates array of all cells surrounding the submitted cell, making sure
    // the values are only those one in the grid reference array.
    // also removes marked cells so it's not included in a cell which is checked.
    $cells_to_check = array();
    array_push($cells_to_check, substr($cell,0,2)-1 .substr($cell,2,2)-1);
    array_push($cells_to_check, substr($cell,0,2)-1 .substr($cell,2,2));
    array_push($cells_to_check, substr($cell,0,2)-1 .substr($cell,2,2)+1);
    array_push($cells_to_check, substr($cell,0,2) .substr($cell,2,2)-1);
    array_push($cells_to_check, substr($cell,0,2) .substr($cell,2,2)+1);
    array_push($cells_to_check, substr($cell,0,2)+1 .substr($cell,2,2)-1);
    array_push($cells_to_check, substr($cell,0,2)+1 .substr($cell,2,2));
    array_push($cells_to_check, substr($cell,0,2)+1 .substr($cell,2,2)+1);
    $cells_to_check = array_intersect($cells_to_check,$this->grid_reference);
    $cells_to_check = array_diff($cells_to_check,$this->marked_cells);    
    return $cells_to_check;
  }

  function process_cell($cell){
    // general function to process mark a submitted cell.
    
    // If the cell needs to be marked, add it to marked, otherwise, if it is marked and mark
    // toggle is on, remove from marked cells
    if(($cell == $this->submitted_block) && ($this->mark_toggle == true) && (!in_array($this->submitted_block,$this->marked_cells))){
      array_push($this->marked_cells,$this->submitted_block);
      return;
    }elseif(($cell == $this->submitted_block) && ($this->mark_toggle == true) && (in_array($this->submitted_block,$this->marked_cells))){
      $key = array_search($this->submitted_block, $this->marked_cells);
      unset($this->marked_cells[$key]);
      return;
    }
    
    // if it's not in the marked cells, make it visible then check if the game is won.
    if (!in_array($cell,$this->marked_cells)){
      array_push($this->visible_cells,$cell);
      $this->visible_cells = array_unique($this->visible_cells);
      $this->is_game_won();
    }
  }
  
  function is_game_won(){
    // check to see if game is won. A simple calculation
    if((isset($_POST)) && ((count($this->grid_reference) - count($this->visible_cells)) == count($this->mine_cells))){
    $this->mode="game_won";
    }
  }
  
}
// instance input_handler class
$data = new data_handler();
?>

grid_gen.php

<?php
// Minesweeper in PHP by Daniel Porter - thisismywww.com
// Version 1.0 -  28 Sept 2018
// class to handle building the content
class grid_gen{
  // devlare variables
  public $table_html = "";
  public $pre_table = "";
  public $post_table = "";
  public $color = array(
    1=>"blue",
    2=>"green",
    3=>"red",
    4=>"purple",
    5=>"brown",
    6=>"pink",
    7=>"yellow",
    8=>"red");
  
  function form_content(){
    global $data;
    // Generate the form content, pre and post Populate the pre and post form data on on the grid, post is just for submit
    
    if (($data->mode == "game") || ($data->mode == "new") || ($data->mode=="start")){
    $this->pre_table.="<form action='index.php' method='post' id='minesweeper'>\n";
    }else{
    $this->post_table.="<a href='.'>New Game</a><br>";  
    }
    
    if ($data->mode == "new"){
      $this->pre_table.="<select name = 'difficulty'>\n";
      $this->pre_table.=" <option value='easy'>Easy</option>\n";
      $this->pre_table.=" <option value='medium'>Medium</option>\n";
      $this->pre_table.=" <option value='hard'>Hard</option>\n";
      $this->pre_table.=" <option value='custom'>Custom</option>\n";
      $this->pre_table.="</select>\n";
      $this->pre_table.="<br>Custom Settings<br>";
      $this->pre_table.="Rows: <select name = 'num_rows'>\n";
        $this->options_builder(50);
      $this->pre_table.="</select>\n";
      $this->pre_table.="Columns: <select name = 'num_cols'>\n";
        $this->options_builder(50);
      $this->pre_table.="</select>\n";
      $this->pre_table.="Mines: <select name = 'num_mines'>\n";
        $this->options_builder(50);
      $this->pre_table.="</select>\n";
      $this->pre_table.="<br><input type='submit' name='mode' value='start'>";
    }

    if ($data->mode == "start" || $data->mode == "game"){
      $this->pre_table.="<input type='hidden' name='grid_reference' value='" . htmlspecialchars(serialize($data->grid_reference)) . "'>\n";
      $this->pre_table.="<input type='hidden' name='num_cols' value='" . $data->num_cols . "'>\n";
      $this->pre_table.="<input type='hidden' name='num_rows' value='" . $data->num_rows . "'>\n";
      $this->pre_table.="<input type='hidden' name='num_mines' value='" . $data->num_mines . "'>\n";
      $this->pre_table.="Mines:". ($data->num_mines-count($data->marked_cells))."<br>\n";
    }

    
    if ($data->mode == "game"){
      $this->pre_table.="<input type='hidden' name='mode' value='game'>";
      $this->pre_table.="<input type='hidden' name='cell_values' value='" . htmlspecialchars(serialize($data->cell_values)) . "'>\n";
      $this->pre_table.="<input type='hidden' name='mine_cells' value='" . htmlspecialchars(serialize($data->mine_cells)) . "'>\n"; 
      $this->pre_table.="<input type='hidden' name='visible_cells' value='" . htmlspecialchars(serialize($data->visible_cells)) . "'>\n"; 
      $this->pre_table.="<input type='hidden' name='marked_cells' value='" . htmlspecialchars(serialize($data->marked_cells)) . "'>\n";
      $this->pre_table.="Toggle Marked <input type='checkbox' name='mark_toggle'";
      if($data->mark_toggle == true){
        $this->pre_table.=" checked='checked'";
      }
      $this->pre_table.=">\n";
    }

    if ($data->mode == "start"){
      $this->pre_table.="<input type='hidden' name='mode' value='game'>";
      $this->pre_table.="Toggle Marked\n";
    }
  
    if ($data->mode != "game_won"){
    $this->post_table.="</form>\n";
    }
    // if the game is over or game has been won, display message
    if ($data->mode == "game_over"){
      $this->pre_table.= "Game Over\n";
    }
    if ($data->mode == "game_won"){
      $this->pre_table.= "Congratulations, you've won!\n";
      
    }
  }
  
  function options_builder($number){
    // function to build options up to number specified
    for ($x=8;$x<=$number;$x++){
      $this->pre_table.=" <option value='$x'>$x</option>\n";
    }
  }
  
  function create_table(){
    // loop to build grid. Only extra element is to mark block as red if block is submitted
    global $data;
    $this->table_html .= "<table border='1'>\n";
      for ($x=10;$x<($data->num_rows+10);$x++){
        $this->table_html .= "<tr>\n";
        for ($y=10;$y<($data->num_cols+10);$y++){
          $block = $x.$y;
          if(($data->mode=="game_over") && ($data->submitted_block == $block)){
          $extra=" bgcolor='red'";
          }else{
          $extra="";
          }
          $this->table_html .= "<td width='18px' height='18px' border='0' align='center'$extra>";
          $this->cell_content($block);
          $this->table_html .= "</td>\n";
        }
        $this->table_html .= "</tr>\n";
      }
      $this->table_html .= "</table>\n";
  }
  
  function cell_content($block){
  // Case is when grid is just created
  // else if the cell is visible, display it's content, otherwise, create form button 
  global $data;
    if ($data->mode == "start"){
      $this->table_html .= "<input type='hidden' name='mode' value='game'><input type='submit' name='submitted_block' value='". $block ."' style='height:18px; width=18px; text-indent:-9999px' />";
    }else{
      if (in_array($block,$data->visible_cells)){
        if (array_key_exists($block,$data->cell_values)){
            $this->color_number($data->cell_values[$block]);
          }else{
            if (in_array($block,$data->mine_cells)){
              $this->table_html .= "<strong>*</strong>";
            }else{
              $this->table_html .= "";
          }
        }
      }else{
        $this->table_html .= "<input type='submit' name='submitted_block' value='". $block ."' style='height:15px; width=15px; text-indent:-9999px";
          if(in_array($block,$data->marked_cells)){
            $this->table_html .= "; background:red";
          }
        $this->table_html .= "'/>";
      }
    }
  }
  
  function color_number($number){
    $this->table_html .= "<font style='color:".$this->color[$number]."'>$number</font>";
  }
  
  
  function generate(){
  // function that builds for and table data as long as mode isn't new.
    global $data;
    $this->form_content();
    echo $this->pre_table;
    if((!isset($data->mode)) || ($data->mode != "new")){
    $this->create_table();
    echo $this->table_html;
    }
    echo $this->post_table;
  }
}
// instance grid_gen class
$grid_gen = new grid_gen();
?>

 

Sudoku Solver v1

So 4 ‘sessions’ and I hit a snag. I then spend the next week working on code which solves most (non extremely difficult) puzzles.

And then I put the code aside.

A few things I learn’t along the way..

  1. It’s great to have a goal, but instead of stepping up to the plate and going for broke, plan a little.
  2. Remember to break it down in to multiple steps and then break those down even more.
  3. By following 2, it’s easier to go back and fix small parts of the code as opposed to rewriting the entirety.

In saying that, I still didn’t fully apply these lessons learned when completing version 1. I just realised them more after I had completed it.

What I’ve got now is code which will allow you to enter a puzzle, then using a few ‘solving’ selections, will start to fill out the form.

If you have read any content from the last 4 posts, especially the ending of the last one, you will see I was questioning the naming scheme of the cells.

I decided to simplify it to [row][column].

The only reason I was thinking of using a ‘subgrid’ in the naming scheme was to generate arrays which had the cells located in a respective ‘subgrid’. In the final version of the code, I hard coded the values in to the array. I applied the thought method of WORM (Write Once, Read Many).  I had issues with where the arrays were being generated because that information was read from more than one function.

The solving method.

Stepping through the puzzle:

  1. Work out all possible values for each cell.  Mark submitted values as solved.
  2. Start at 11 (first cell) and step through each cell, using the check conditions below. Repeat from 11 until either puzzle is solved or no cells after solved in a pass.

What I’m checking in each cell

  1. If only 1 possible value, set as solved value.
  2. If any value is unique in row.
  3. If any value is unique in column.
  4. If any value is unique in subgrid.

After each step I perform a clean up of possible values but removing the value from all cells in the row, column and subgrid.

Applying that logic, most puzzles can be solved.

Solving harder puzzles is where I’m at at the moment. Another step needs to be added when the puzzle isn’t solved and after passing the puzzle, 0 values are solved.

I’ve played a number of puzzles in a Sudoku app I have on my phone and I’ve documented, the best way I can describe it is ‘Worded Logic’ for what I need to check. So far I have this:

  1. Applying to each Row and Column – If 1-3 possible values are ONLY in one row/column of a subgrid, remove values from respective row/column in other subgrids.
  2. Where multiple cells in a row/column/subgrid have same possible numbers, and the count of those possible numbers = the number cells they appear in, remove possible numbers from other cells in that row/column/subgrid

There are additional checks which I need to work out how to word up, but I’ve been able to solve all but one (manually), using the steps above.

Presentation

Currently, as I mentioned above, the solver is just generating a grid to display values/current state of the puzzle, and a basic output ‘Solving [cell] – [how it was solved]’.

Going forward, I’m going to have a ‘solve this’ button, and then an ‘analyse’ which will only solve one number at a time, which a check box to do one full pass.

After starting my solver, I did find one online which does the same thing, but to me, it’s more about working through to the solution.. even if there is already one available..

Sudoku Solver – 4th Session

This is just a stream of thought blog post as I’m coding a Sudoku solving program.  I’m a beginner coder, so the code won’t be the best, but I’m learning as I go.

Click here to see the first post
Click here to see the second post
Click here to see the third post

I’ll post code snippets and then the full code at the bottom of this post.

To me, the logic in solving an “EASY” Sudoku is easy.

  1. Look at all possible values of a cell
  2. If there is only one possible value, that’s the answer
  3. Rinse and repeat until the whole puzzle is solved

Harder puzzles require more working out to eliminate possible values

  1. Look at all possible values of a cell
  2. If there is only one possible value, that’s the answer
  3. Rinse and repeat until no more cells can be solved
  4. Use more advanced methods to remove possible values from cell
  5. Repeat until whole puzzle is solved

In the array I’m going to build from the initial submit, only ‘solved’ values will be present.

As that cell has only one value, the length of that string will be 1. That’s how I’m going to determine a solved cell.

Initially an cell has a length of 0, it’s unsolved, I need to loop though each number, 1-9 to check if it appears in either that row, column or sub-grid. If the doesn’t exist in that check, add it as a possible value. If there is only 1 possible value, the cell is solved, otherwise, I’ll have a string for that cell where the length is >1, meaning unsolved.

Just thinking forward here, I can place an additional check if a cell is solved to remove that value from other cells in the column/row/sub-grid. That will reduce the number of loops going forward.

I can also reduce loops by building a second array of ‘solved cells’ so when stepping through checking cells, solve cells are skipped.

Now, coming back to the cell naming convention I set up.

[Column],[Row],[Cell],[Subgrid]

Logic

The next bit might sound strange, increasing row to check column and increasing column to check row, it it works.

  • Check a column – Set row number to 1 (aka second digit in four digit length), then add 100 to the CelliD
  • Check a row – Set column number to 1 (aka first digit in four digit length), then add 1000 to the CelliD
  • Check a sub-grid box —–

***** at this point I just realised I might be better to change the order the CelliD to being [Cell],[Row],[Column],[Subgrid] or even just identifying each cell as just a [Row],[Column] and have a separate array to hold the cell reference that appears in each Subgrid.

OK, no code this time.. rewrite required..

Sudoku Solver – 1st Session

This is just a stream of thought blog post as I’m coding a Sudoku solving program.  I’m a beginner coder, so the code won’t be the best, but I’m learning as I go.

 

It’s been a while since I’ve worked in PHP and to be truthful, in the past it’s been a lot of copy and paste.

Sudoku has always been a timewaster of mine and I’ve been thinking more and more about writing a solver.

I could write it in python or C++, one language I have no idea about (Python) and the other I’m just starting out.. very slowly.

So.. let me start my thought process.. hopefully it will end with a product that can solve a Sudoku puzzle.

Read more

Over a year since I posted..

A lot has happened, then again, a lot hasn’t happened.

I actually had 2 posts planned when I last posted. they were mostly drafted up.  One was on Pokemon Go (which I started off way too hard and then lost interest in) and a VR vs AR post.

Pokemon Go

I had a love/hate relationship with this game. As soon as it was announced (ie, within an hour), it was installed and I was playing it.  That night we drove around the town and played more until the servers started playing up due to load.

All the ‘Pokestops’ were at the same locations as a lot of the early Ingress portals, so I knew them well.

The next day, I was walking the street playing, then I stopped for a while and just walked. Every second person was looking down at their screen with the application open.

Walking at lunch around the Opera House, it was more like 9 out of every 10 people were playing it.

Then there were the news articles:

Around this time, my parents were in Perth.  They visited Kings Park and were annoyed that all these people were out playing a game, ignoring their surroundings, and subsequently blocking my parents view.

Then a week or so later, there were reports of a park where there were a number of Pokestops clustered. All through the night people were gathered around a kids playground, basically blocking access to kids using the facilities and then leaving it like a pigsty.

I had tweeted at a writer who was a advocate for the game about it, hoping it would prompt her to write about the negative side as well to increase peoples awareness, but the response was less than I expected: “this is a downside of any crowd gathering anywhere for any reason. People just need to be better”.  I agree, but ‘with great power comes great responsibility’, I had hoped that a ‘look after your environment’ post might have been appropriate.

In saying that, the next week, I was playing for my son and my wife was playing. We actually did go for a walk around Bicentennial Park.  Walking amongst the mangroves was pleasant, but also made me aware of, even there, how people are spoiling the environments by littering.

I personally only lasted about a week playing it.  I hit games pretty hard and sometimes have problems knowing when to stop (thank you Rocket League).

VR vs AR

When I was writing the latter post, I was in a situation where I had not tried VR before, not had I tried AR. I actually booked myself in to the Microsoft Store in Sydney to try out VR the day after I started the post.  I was one of the first people to try out the Trials on Tatooine experience which was released a day or two earlier.  The highlight of that experience was (spoiler alert) when R2D2 rolled out of the Millennium Falcon.  I remember getting down low on the ground to get a closer look at him.  People outside could have seen what I was looking at thanks to a tv on the wall.. and would have been able to see the massive smile on my face.

Using VR, the only issue I had was whether or not to wear my glasses under them. Being a year ago, I can’t remember, but I think I did.

I’m yet to experience AR in the ‘Hololense’ sense. The closest I got was inquiring about a weekend preview of the device, however was told (by the same store I tested the VR out in) that it was more aimed at business people who want to use the device. So I’m yet to try them out.

Mixed Reality was announced more recently, and last week I did get the opportunity to try it out.  The Microsoft Store no longer preview the Vive.  I chose to try the Dell over the Acer, purely as there was a nose piece in it which I didn’t think would sit well with my glasses. As I had power-walked there, the lenses started to fog up.  That did clear up overtime and aside from a couple of teething issues (got a BSoD and then the glasses didn’t recognise the area.. a simple ‘step to the right’ fixed that), the experience was pretty cool.  The images were crisp and the experiences I tried were impressive.  I’m looking forward to the next couple of weeks to hear how the SteamVR support plays out.

Other Stuff

Well, I took WAY too long animating a video for a song I released under my ‘Project’.. I thought it turned out pretty good.  The initial idea started just after my last blog post and I finished it up about a year later, with a majority of the work happening over the last month.

The family has acquired a number of tools over the last year as well, which will lead to some wood projects. I have LOTS of ideas and little time.  But more on those later.

Next project, I’m going to write a Sudoku solver.

Indiana Jones – Rebooting the reboot?

There was a post on Reddit last year which was around the time that Indiana Jones 5 was being announced.  At the time, it was confirmed by Frank Marshall that Indy would be played by Harrison Ford again.  And he mentioned that he wouldn’t be doing the “Bond” thing where the character would be played by different actors, even though to date, Indian Jones has actually be played by 10 actors and 7 ‘faces’. Source: http://indianajones.wikia.com/wiki/Indiana_Jones – search for Behind the Scenes.

A couple of days ago, it appears that the story has changed, sort of. Disney’s CEO, Bob Iger, is now saying that after Indy 5, the series is going to be rebooted. I find the way he described the progression of movies amusing: “Right now, we’re focused on a reboot, or a continuum and then a reboot of some sort,”… “Well, we’ll bring [Harrison Ford] back, then we have to figure out what comes next. That’s what I mean. It’s not really a reboot, it’s a boot — a reboot. I don’t know.”

Rebooting the reboot 😀

My response to the Reddit post put forth an idea which would allow the series to go on with Indy not just being replaced (as such), with my idea of how you could introduce a ‘new’ character who could play Indy in a ‘continuum’ type set up, and to reboot the franchise.

Indiana Jones is sitting in a nursing home where he’s reluctantly spending the rest of his days. Marion has passed away and his son, Mutt, rarely visits.

A passionate archaeology student visits him there and after introducing himself, sits down with him to have a chat.

The visitor brings up events of Indy’s past, some which are known and some which Indy had tried to keep secret.

At the end of the conversation the visitor tells Indy how much of an impression which he has left on his life and he wants his legacy to live on. He asks if he can take on his name so that the name Indiana Jones can live on in the field of archaeology.

Indy sits there for a moment before he stands up and walks to the door.  He closes it slowly.  On the back of it hangs his fedora, whip and jacket. He picks up his hat and puts it on his head, taking a final look in the mirror before turning around, taking his hat off and putting it on the students head “So what’s your first adventure Indiana?”

Queue the Indiana Jones theme song.

Or at least something like that.

At least that way, ANYONE could play him.   Yes, it’s someone assuming his name, but it allows for the legend to live, not on a ‘Bond’ way, but in a “Prince Bride” type way with the “Dread Pirate Roberts”.

Think that might work?