🙄Разминка для ума!
Треугольник Серпинского, интересная фигура которую построить достаточно просто.
Алгоритм такой:
1. создаём любые 3 точки на плоскости
2. из этих точек случайно выбираем любую, как начальную
3. случайно выбираем любую точку из этих же трёх точек как цель
4. перемещаемся в сторону цели на половину расстояния
5. повторяем бесконечно с пункта 3
Если сделать достаточно много итераций то вырисовывается интересная фигура. Треугольник, в который вписаны более мелкие треугольники. Это самый настоящий фрактал!
Я собрал пример построения такой фигуры на базе Qt.
🌎 Код можно посмотреть здесь.
С помощью paintEvent я рисую точки по озвученному алгоритму. Каждые 10 секунд либо по клику на виджете строится следующий треугольник.
Особенности примера:
🔸 Атрибут Qt.WA_OpaquePaintEvent позволяет сохранить то, что было нарисовано в прошлой итерации. Таким образом мы видим постепенное наполнение точек а не мелькающую одну точку.
🔸QTimer позволяет создавать отложенные вызовы один раз или с повторением через интервал.
🔸QColor.fromHsv() позволяет создать рандомный но предсказуемый цвет с помощью HSV схемы. Не слишком светлый и не слишком тёмный но всегда с разный. Рандомизации подвергается только смещение по цветовому кругу (Hue), яркость (Value) и насыщенность (Saturation) можно контролировать отдельно в своих пределах или оставить статичными. Обычный рандом цвета по RGB не даёт такой предсказуемый результат.
🔸 Каждый новый цикл с новым треугольником предварительно затемняет предыдущие через этот вызов
painter.fillRect(rec, QColor(0, 0, 0, 100))
То есть полупрозрачный цвет. Таким образом, чем старше треугольник, тем он темней.
Если сделать виджет фулскрин, то у нас получится некий ScreenSaver)))
🔸 Да, я знаю, что рисование в Qt не самый лучший способ сделать этот пример) Скорее всего самый НЕподходящий. Попробуйте сделать тоже самое но другими средствами.
#qt#source#tricks
The long-awaited listing of the token from Fanton Fantasy
🟨 We would like to remind you that #FTON is a utility token of the Fanton Fantasy project, necessary for playing in their tournaments. Token holders will be able to participate in betting and ⛏ farming, receive in-game bonuses, and also have the exclusive right to purchase NFT cards of the project.
↗️ The listing of $FTON will take place on October 1 at 13:00 UTC (16:00 Moscow time) on three CEX exchanges at once: Kucoin, Gate.io , MEXC. In our 🪙#TON network, the pool will appear at 13:15 UTC and unfortunately only on 1 DEX exchange – Ston.FI. At the same time, the team itself states that they are working with other sites on the token listing, so we are waiting for announcements.
➖After listing, life is just beginning, and we will begin to systematically increase the utility for $FTON, both for Fanton Fantasy players and ordinary cryptans!
The team also reminded us that Notcoin and Tonstarter are among their key partners:
➖Over the past 1.5 years, we in the Fanton team have held many calls with the creators of the best platform for social campaigns — Community, as well as Notcoin, which blew up TON and Telegram in early 2024.
➖Since then, we have been calling the guys weekly, maintaining a connection on the topic of launchpads and launching ⚽️ $FTON, received expertise and connections, and are finally close to launching our utility token.
Fanton | News | Chat | ChainGPT
Fanton EN: New Legendary NFTs and Staking 2.0
#NFT#FTON
Fanton EN presents the new Staking 2.0, featuring a convenient chart and distinguished Legendary NFTs, including players like Batrakov and Osipenko. The first round of NFT distributions for FTON stakeholders will start tomorrow. Participants can exchange injured NFTs through support.
Source: link
@tonlines
⚡️Fanton EN: Launch of Staking 2.0
#Fanton#FTON#NFT
Fanton EN channel has announced the launch of Staking 2.0 in the game, offering lucrative opportunities for players. By staking $FTON tokens, participants can earn rewards surpassing the token’s value and receive additional NFTs. Important deadline: Stake before April 19 to secure your NFT before the 25th RPL round.
Source: link
@tonlines
⚡️Fanton EN: Launch of Staking 2.0 with NFTs and Tournaments
#FANTON#NFT#FTON
Fanton EN introduces Staking 2.0, featuring NFTs, tournaments, and appealing bonuses. Participants can stake FTON in four different pools, each offering unique rewards like NFT cards, tournament entry, and up to 10% APY. The update includes guaranteed RPL NFTs and the opportunity to join exclusive pools with limited slots.
Source: link
@tonlines
⚡️Fanton EN: May Leaderboard Kicks Off with New Rewards
#FTON#NFT#RPL
Fanton EN has announced the results for April with $FTON and NFT card distributions to players. The May Leaderboard requires participants to earn at least 50 trophies to share a 1 million $FTON prize pool. Top players will also receive Rare RPL cards, selected based on rank.
Source: link
@tonlines
🏷 Start of presale from Fanton
🟡Placement will take place on August 7th at 11:00 UTC on the Magic Square platform
🟡Presale price – $0.023 (5% discount to the IDO price)
🟡Total raised amount – $150,000
🏆 We want to remind you that $FTON is a utility token for the Fanton Fantasy game, necessary for playing in project's tournaments. Token owners will be able to participate in staking and ⛏ farming, receive in-game bonuses, and also have exclusive right to purchase NFT cards of the project.
The first part of FCFS/Whitelist Round:
🟨Create an account on Magic Square and go through KYC
🟨Use wallet which completed the Zealy campaign
🟨Click "Join Whitelist"
Second part of the ProRata Round will begin on August 8th at 11:00 UTC.
📊 Allocation will depend on thr amount you contributed in relation to other participants. Trading with other users (until TGE) will appear on Magic Square OTC marketplace. More information in detailed guide - link here.
#fanton#magicsquare#fton