Showing posts with label technical. Show all posts
Showing posts with label technical. Show all posts

Friday, January 27, 2023

Shorter solution for Robozzle puzzle no 132 - Split

I wonder a shorter solution for Robozzle puzzle number 132, "Split."

Puzzle is shown below. I have solved it but I'm wondering shorter solution for this and there many exist.

Basically, the rocket has to collect stars.

robozzle puzzle 132 "split" blank

You give certain commands to the rocket and it obeys them. The less command, the better. Commands for this puzzle are shown below.

Commands are displayed on bottom right corner. From top to down they are: go straight, turn left, turn right; execute F1 function, execute F2 function; execute this command no matter what the colour of cell is, execute this command in red cell and execute this command in green cell.

Each time it starts with F1 function. If you don't call F2 function in F1 then it will not execute commands in F2.

robozzle "split" with commands

Let me show you how to play this game in another easy puzzle.

robozzle stairs blank

This puzzle is called "Stairs." You can see the commands and given function on the bottom right corner again. They are blank. If I click on Go! nothing happens because there are no commands given in function.

Now, let's fill in the function with some necessary commands.

Robozzle Stairs with commands but no iteration or recursion

You can see where robot stays. It hasn't collected all the stars. Function was called but it was executed just once. Why? Because there is no iteration (or recursion) or repetition of commands.

Remember we need to collect all the stars, so let's call F1 function again at the end of commands so that it iterates (or recurses) or repeats itself.

stairs completed

The rocket has collected all the stars because F1 was called again at the end so that it repeatedly goes beginning when it finishes executing all the commands. At the bottom you can see what the next steps are such as turn left, go, turn right and F1. This was completed in 5 commands (or steps).

Now, hoping that you understood the fundamentals of this puzzle let me show you my longer solution for Robozzle puzzle number 132 - "Stairs". It contains 11 commands (or steps).

Split long solution

I screenshot it during the execution of commands so that you can see the upcoming steps (or commands) on bottom command line. I directly called F2 because F1 was very short. In F2 I turned 180 degree back, stepped forward, turned 180 degree back again, and stepped forward twice. I repeated these steps as long as the cells were blue. After blue cells I put turn right on green and go straight on any colour.

Basically, I stepped back once and stepped forward twice. Repeated this action (or recalled F2) as long as the rocket was in blue cells. Since there were a lot of blue cells, the F2 called itself again and again postponing the commands (or steps) I entered after F2 there: turn right on green and go straight on any colour. As far as I know this is called "stacks" (or "stacking") in programming. You can see them piled up on the command line at the bottom of the image. When the rocket arrives at the green cell it gives up calling F2 and executes the stack or piled steps after F2: it turns right on the green cell and goes straight. It ignores turn right on green afterwards. Why? Because there are no green cells except the corner.

My solution contains 11 commands (or steps). I'm looking for a shorter solution for this Robozzle "Split" puzzle: http://www.robozzle.com/js/play.aspx?puzzle=132.

There exist 7 command (or 7 step) solution.

Thanks for your time and efforts beforehand!

 I asked this question Puzzling Stack Exchange website: https://puzzling.stackexchange.com/questions/119505/shorter-solution-for-robozzle-puzzle-no-132-split

Tuesday, August 13, 2019

Trying to install Arch Linux in Virtual Machine on Windows 10

First trial, 12th August 2019. Kurban Bayram here in Turkey.

When I first started installing Arch Linux through virtual machine, the first parts were going smooth. However, I couldn't complete it, so I have deleted that VM, started another one. I wrote # cfdisk code and selected dos from the drop-down menu. After that, I did /dev/sda1 as a bootable primary partition, /dev/sda2 as a swap and /dev/sda3 as an extended partitions. Then I entered # mkfs.ext4 /dev/sda1 , it was good; but, # mkfs.ext4 /dev/sda3 gave a problem. It showed
/dev/sda3 contains 'DOS/MBR boot sector' data
Proceed anyway? (y, N) y
mkfs.ext4: inode_size (128) * inodes_count (0) too big for a
                  filesystem with 0 blocks, specify higher inode_ratio (-i)
                  or lower inode count (-N).

After that, I learned the problem by writing # lsblk , it showed 1 KB for /dev/sda3 . I added Linux partition under /dev/sda3 , and that was /dev/sda5 . After that, I could easily enter # mkfs.ext4 /dev/sda5 thing and which worked well, at least for now.

Secong trial, 13th August 2019. Tomorrow is Super Cup 2019, it will be played between Chelsea and Liverpool in Beşiktaş BJK Vodafone Park stadium in Istanbul, Turkey :)
My wish is "You will never walk alone" :) but as Jose Mourinho I have to support Chelsea, as well. So, I support both of them.

Let's get to the business, I have installed Arch Linux on my Virtual Machine. Now, I'm wondering if I can share files between the host Windows 10 OS and guest Arch Linux on Virtual Machine. After looking many things I think I will use Samba file sharing software to share files between the host and guest.
For now, as a post-installation process, I'm trying to install some programs on the Arch Linux in VM, but it seems that I don't have root privileges as a user. So I looked that up, first I wrote # su command and then I entered root password to become a root, after I wrote # usermod -aG wheel,anothergrouphere,yetanother,youcanseparatethemwithcomma,butnotspace usernamehere and then I was added to the wheel group, which I think grants the root privileges to my user. To check that you can write # groups usernamehere and it will show which groups are that user in. Enter # visudo and then uncomment %wheel ALL = (ALL) ALL to give root privileges to the wheel group. Reboot. Then I did as my user # sudo pacman -S emacs to download and install emacs.

Sunday, June 10, 2018

My Browser(they are very very slow) Benchmark tests(kinda) 2018

I have had many problems with Mozilla Firefox. I'm tired of Firefox browser, it is very slow despite the claims that it is very fast. I run multiple different tests

during benchmark test, drowsy, slow firesucks(firefox)

on my different browsers and I want to share them with you. You will decide which browser is the fastest.
My Operating System is Windows 10 64 bit.

Microsoft Edge 17 web basemark score:

MS Edge 17 Jetstream score:
MS Edge 17 Speedometer score:

It is too difficult to MS Edge 17 to handle the ARES-6 test:
Finally MS Edge 17 finished its ARES-6 test:


MS Edge 17 MotionMark score:



Google Chrome 67 web basemark score:

Google Chrome 67 Jetstream score:
Google Chrome 67 Speedometer score:


Google Chrome 67 ARES-6 score:

Google Chrome 67 MotionMark score:



Mozilla Firefox 60 Web basemark score:

Mozilla Firefox 60 Jetstream score:
Mozilla Firefox 60 Speedometer score:

Mozilla Firefox 60 ARES-6 score:


Mozilla Fire(sucks)fox 60 totally stuck when I run MotionMark test on it:
Fire(sux)fox stuck again:
Finally, Mozilla Firefox 60 managed to finish MotionMark test:




Opera 53 Web basemark score:


Opera 53 Jetsream score:
Opera 53 Speedometer score:

Opera 53 ARES-6 score:


Opera 53 MotionMark score:


After all those tests, I don't know which browser is faster, but I do know which is the slowest. I think, Mozilla Firefox is the slowest of all browsers listed here. I used Firefox for last 6-8 years, but over the time Firefox turned into firesucks. It was faster long time ago, but it is very slow now. I don't want to use MS Edge or Google Chrome. I thought of using Chromium, which is kind-of open source version of Google Chrome, but it turns out that Chromium isn't present at the moment for Windows OS. I may use Vivaldi browser, but the lack of commonly shareable bookmarks makes that idea difficult. I wish I had a site where I can store my bookmarks and I could switch between the browsers whenever I wanted. Thanks.

Edit on 10 June 2018, at 21:17 Istanbul time:
Vivaldi 1.96 Web basemark score:

Vivaldi 1.96 jetstream score:

Vivaldi 1.96 Speedometer score:

Vivaldi browser 1.96 ARES-6 score:


Vivaldi browser 1.96 MotionMark score:





I think Google Chrome is faster than other browsers, at least benchmark results point out that, I guess.


Metrics MS Edge Chrome Firefox Opera Vivaldi
Web Basemark 180.11 307.89 48.23 363.03 272.94
JetStream(big good) 138.64 105.27 148.01 108.41 146.18
Speedometer(runs/min) 23.3 84.0 29.5 46.6 65.5
ARES-6(ms) 127.25 32.17 111.25 33.96 50.93
MotionMark 245.92 265.42 176.25 181.02 231.99
Overall Bad The Best The Worst Good Good

This test was run on 10 June 2018 at PC with Intel 3.50 GHz Processor, 8 GB RAM and Win 10 Pro 64-bit.