Browse Search Popular Register Upload Rules User list Login:
Search:
4 wins with winnercheck

Image:
screenshot of the scene

Author: DrBalk

Group: Collaborations

Filesize: 190.56 kB

Date added: 2017-01-22

Rating: 6.1

Downloads: 233

Views: 231

Comments: 3

Ratings: 3

Times favored: 0

Made with: Algodoo v2.1.0

Tags:
thyme,
probe,
sonde

Scene tag

Training in Thyme-script-langugage: 4-wins with automatical detection for the winner.</b>
The idea for the 4-wins comes from XRAY, the idea to do
the check-if-won-by-spawned-probes comes from FRA32, thanks to both of you!

Something about the logic inside:

A laser at the entrance of the grid changes the variable _inside to true, it is the presumption for the check of who is the winner.
If a collision of an object with another object happens, which hast a color value with red=0.9, then a scan is performed. For this scan tiny circles are spawned with collisiongroups B,C,D,E, wich are positioned along the horizontal, vertical and diagonal lines. On collision of these they chec the colorvalue of previous ones, and add 1 to a counter, if these values are the same. If they are not the same ( red follows yellow or yellow follows red ) the counter is reset to 0.
After one collision of a chip inside the grid, the variable _inside is set to false, to prevent multi-collions, as only one scan per chip should be done.
In the violet box the winnercolor will be displayed. Below of that box you can reset the last winner.


Thyme-Übung: <b>"Vier-Gewinnt mit automatischer Gewinnerkontrolle"</b>
Der Laser am Eingang des Rasters verleiht der hineinkommenden Kugel den Variablenwert _inside=true, der als Voraussetzung dafür gilt, dass ein "Gewinnercheck" durchgeführt wird.
Wenn eine Kollsion der Kugel (Kollisionsgruppen A bis E) mit einem Objekt, das den rot-Farbwert von 0.9 besitzt, geschieht, wird ein Scan-Vorgang ausgelöst. Dazu werden kleine Kugeln mit Kollisionsgruppe B, bzw. C, bzw. D, bzw. E erzeugt, die in ihrer Position entlang einer horizontalen, vertkalen, diagonalen Linie entlang mit pos positioniert werden, wobei sie bei ihren möglichen Kollisionen keine Bewegungsauswirkung auf die anderen und auch nicht auf sich selbst haben. Sie stecken dann als sehr dünne Schemen "in" den jeweiligen Kreisen, mit denen sie kollidieren. Bei ihren Kollisionen vergleichen sie die Farbwerte mit vorherigen Farbwerten und zählen einen Zähler bei Übereinstimmung hoch. Bei einem "Loch" wird die Zählvariable wieder auf 0 gesetzt.
_inside wird false gesetzt, nachdem ausgelöst wurde, um Mehrfachauslösungen zu vermeiden. Im Lilafarbenen Kasten rechts neben dem Spielplan wird der Gewinner angezeigt. Im braunen Kasten unterhalb davon kann man den "letzten Gewinner" resetten um eine weitere 4-er Reihe mit einem neuen Gewinner zu ermöglichen.
Please log in to rate this scene
edit
Similar scenes
Title: Z-Probe
Rating: 6.25
Filesize: 6.95 kB
Downloads: 439
Comments: 1
Ratings: 2
Date added: 2009/12/28 06:17:27
Made with: Phunlet
Rating: rated 6.3
download
Title: probe 2.5.3
Rating: 6.3
Filesize: 66.76 kB
Downloads: 904
Comments: 4
Ratings: 4
Date added: 2009/10/19 04:06:31
Made with: Phun
Rating: rated 6.3
download
Title: K-Probe-LE Demo
Rating: 6.1111
Filesize: 21.69 kB
Downloads: 675
Comments: 1
Ratings: 3
Date added: 2009/10/22 22:14:31
Made with: Algodoo before v1.8.5
Rating: rated 6.1
download
Title: 0 Gravity Probe
Rating: 5
Filesize: 429.31 kB
Downloads: 1156
Comments: 0
Ratings: 1
Date added: 2022/07/07 22:05:14
Made with: Algodoo v2.1.0
Rating: rated 5
download
Title: probe thing
Rating: 5
Filesize: 104.5 kB
Downloads: 414
Comments: 5
Ratings: 4
Date added: 2009/10/25 01:23:46
Made with: Phun
Rating: rated 5
download
Title: K-Probe Laser Edition
Rating: 8.0526
Filesize: 19.49 kB
Downloads: 2236
Comments: 19
Ratings: 13
Date added: 2009/10/22 22:12:01
Made with: Algodoo before v1.8.5
Rating: rated 8.1
download
Nice work. Your method of checking for a winner works very fast.:tup:
Last edited at 2017/01/22 21:58:59 by s_noonan
I completely agree with what s_noonan said. It's a bit unusual, but it works very well!
Thanks! :blush: As its written in the description, thanks again to you, Xray, for the nice idea of 4-wins and the design of the grid!

I have learned a lot by the probe-checking-method, and i will use the same method when i will implement chemical reactions in algodoo. My prevous attempts with lasers required too many rays and calculation-time, the collision-trick will bing here the required efficiency-amplification, which will make reactions really fast and fluid even on a lowpower-computersystem.

From FRA32 i leaned much in thyme, specially about local variables and functions, thanks to him too again!

Also i appreciate your feedback, it enhances my motivation to go on;)
:tup: best regards! :tup:
Last edited at 2017/01/23 20:22:09 by DrBalk