<< Back to Off-topic Forum   Search

Posts 1 - 4 of 4   
Snowflakes with Hostile [!]: 2017-12-11 13:33:54

Help
Level 58
Report
HELLO Youtube, Hostile here.
I will write about Google Code-A-Snowflake.

//** snowflake example **//
https://santatracker.google.com/snowflake.html?bg=6&B=c29b6f6-(((p100-r30-)12-f10-)35-r180-(f10-)35-l150-)12-


You can view code by clicking on "Try it yourself".

:: THE BASICS ::

The editor is terrible. It does not allow you for writing long code but it is extremely useful for experimenting. One way of doing so is by using the next functionality. Once your code is *executed*, you will be taken to a fake next page so your progress isn't lost.

You can *slow* the execution of your code by placing halting loops in between each instruction. As an example : (rotate 180, rotate 180)loop100 . This instruction will accomplish totally nothing but slow down your code.

Next-thing-next is the compilation of the code. When you go to a snowflake url link, the code will be compiled in the background. It is like 1000x times faster than the web page. If you write a snowflake, you can directly write code in url once you know how it works.

:: Programming Snowflake ::

The first part of the string is garbage -> "https://santatracker.google.com/snowflake.html?bg=6&B=c29b6f6-"

The second part of the string is where your code is stored like that : -(((p100-r30-)12-f10-)35-r180-(f10-)35-l150-)12-.

Let's analyze the syntaxicality of thing :

* Firstly, each command is seperated by trema -> " - "
* p100 is shape
* r30 is a shortened form of right 30
* l150 is a shortened form of left 30
* f10 means forward
* b10 means backward
* A matching pair of "(" and ")" is your loops and nested loops
* A ")12" means loop 12.

There are 3 shapes : p for pentagon, s for square and t for triangle.
The numbers after the shapes are the size parameter.

c29b6f6 means color + its code. The code is equivalent to the hexadecimal value of the color.
I am not sure if that thing is used in webpages.

The maximum size limit of your program is the longest url that broswer can support. The size is 2047 url characters.
If you enter that exact amount in the URL Google Shortener, it may error.

:: More basics ::

You can modify the color parameter (tested !) with any value you want. If you enter wrong your hex code, like if you missed one of the 6 hex digits, the web page will try to auto-pick from one of its default colors.

You can auto-generate string from your visual program by clicking the play button. It will refresh and make new url for program.
The play button is 1000x times faster for generating your written program.


Parameters :

The forward and backward accept parameter from 10 to 99 inclusive. [10,99]
It is the same for the rotation function. [10,99]

Shapes support size from 20 to 150 inclusive. [20,150]
It is the same for all shapes.

If you pick parameter outside those ranges, it will auto-pick from one its default values.

:: Tips ::

How to fill ?

If you want to make a certain shape it is pretty much impossible.

~------------~

You can however make some textures and stuff. If you do (square20, forward, 90 degree)loop 4, it will generate a fabric texture (or a grid with small holes depending on how you see it).


You can move positions simply by selecting x,y with move commands (example : move forward by Y, rotate 90 and move by X). It is important to know in what position and orientation you will end if you want to do some drawings.


The end stage of a snowflake is always : set turtle on 0,0 upwards, copy whole shape, (turn 30 degrees, paste)repeat 5 times.


:: History ::

Snowflake is directly inspired by the LOGO project. The LOGO project started in the 50s and created the LOGO language. Its aim was educational.

The programmer moves a controller (Turtle) and specifies orientation, movement with his code in the programming language. The turtle moves and can draw things. It is pretty much the same as snowflakes. The LOGO is used sometimes by professionals (not kids or teachers) to generate graphics.

I don't know if it is possible to use LOGO for drunkard walk, ant walk or Conway Game of Life (any of its variants). I don't see why it can't. I believe it is fairly complex language.


Students apparently got their own robot turtles.
It works the same as generating graphics on a computer screen.

[img]https://en.wikipedia.org/wiki/File:Turtle_draw.jpg[/img]
Snowflakes with Hostile [!]: 2017-12-11 14:35:12

Help
Level 58
Report
If you combine forward and backward, you can move by a single pixel. You can use this to do the filling !!!

https://santatracker.google.com/snowflake.html?bg=6&B=s20-f21-b20-s20-f21-b20-s20-f21-b20-s20-f21-b20-s20-f21-b20-s20-f21-b20-s20-f21-b20-s20-f21-b20-s20-f21-b20-s20-f21-b20-s20-f21-b20-s20-f21-b20-s20-f21-b20-s20-f21-b20-s20-f21-b20-s20-f21-b20-s20-f21-b20-s20-


https://santatracker.google.com/snowflake.html?bg=6&B=(f40-)4-f10-(ce53935-s20-f20-b25-cfb8c00-s20-f20-b25-)17-(ce53935-s20-f20-b25-)5-

Snowflake with stripes and filled hexagon in center.

<-------------------------->

50 years of Coding Walkthrough :

Level 4 :

( ( forward-forward-turn right )loop4-rotate left-rotate left)loop 2

The idea is that your move around corners code is huge.
We want to do this at 7 pieces par.

The move corner is essential and there is nothing much we can do about.
Our move corner eats 4 pieces.
If we were to make another function, that is ( forward-forward-turn left )loop4, it will eat other 4 pieces.

We are pretty much forced to re-use the move right corner. To do so, we obviously need a loop to be able to go through it a second time.
We are now left with two pieces. You rotate your guy 180 degrees. You are now in situation where right corner works again !

You can try to optimize by trying to remove 1 rotate => forward-forward ( ( forward-forward-turn right)loop3-rotate left )loop2 .
It comes however at cost of 2 forward. It is impossible to do under-par.

Comment : It took me some to figure this out.

Level 5 :

The solution is pretty much the same as with level 4. The only difference is that you are able to move in any direction after a rotation. You only to rotate once after moving around corner 4 times.

( ( forward-forward-turn right )loop4-rotate left)loop4

Comment : If you figured level 4, you will do this one easy. Otherwise, you will not get par.

Level 6 :

This is actually the first level that I par-ed ( subpar-ed). I did not understand what the intended par solution and I still don't know the solution now.

( ( forward )loop3-rotate right) loop13

It is a very simple program. You will first run into the bottom left corner. And end up in corner of central square.

OXX
XXX
XXX

You are now in advantageous position. You can grab stuff from the edges and go back into another corner of central square. So you can pretty much loop around the whole level like that.

Comment : Easiest level in the game.

<----------------------------

Snowflake and 50 years Coding is all the Google Mini-Games.

Edited 12/11/2017 16:28:49
Snowflakes with Hostile [!]: 2017-12-11 20:51:14


AbsolutelyEthan 
Level 64
Report
Hello youtube
Snowflakes with Hostile [!]: 2017-12-12 15:53:32

Help
Level 58
Report
Level 4 and level 5 can actually be completed with a drunkard algorithm.

-----

I am working on it and post solution shortly. XD


Level 4 :

I inputed the right parameters in my drunkard walk function prototype.

The parameter that work are :

( forward- ( forward-rotate right )loop7 )loop100

Level 5 :

Is pretty much the same drunkard walk algorithm.

Edited 12/12/2017 17:53:38
Posts 1 - 4 of 4