Tic Tac Toe Game [TradeDots]Feeling bored with trading?
Time to inject some fun into your decision-making process with our Tic Tac Toe Indicator!
The Tic Tac Toe game transforms your chart into a competitive playground where trading pairs face off in a classic game of Tic Tac Toe.
HOW TO PLAY
Our Tic Tac Toe game invites you to pit one trading pair against another directly on your chart. Choose the competitors and watch as they battle it out in a traditional grid setup.
Navigate to settings and select your competitor pair.
Choose who kicks off the game.
After the close of each new bar, the algorithm will utilize the closing prices of both symbols. These numbers feed into a random number generator which alternates the turns for placing marks on the grid.
The game progresses until one pair aligns three consecutive symbols and wins, or the board fills up. After that, the game resets every three bars, offering continual engagement during active market hours.
MANUAL PLAYING MODE
Currently, due to PineScript's limitations, a fully interactive manual mode is not supported, as all previous data will be lost with each new user input, preventing the replication of existing game states.
However, users can input a sequence at the start, guiding the placement of symbols throughout the game.
Stay tuned for future updates!
GAME
Daily Chess Puzzles [LuxAlgo]Play Chess Puzzles right on your Chart!
Daily Chess Puzzles brings you a new 1-Move chess puzzle straight to your chart every day.
🔶 USAGE
Submit your answer to see if your solution is correct! For quick access to the settings, Double-Click on the Chess board to open the settings interface.
The current active color (Who's move it is) is represented by the color of the information bar, and the corner board squares.
This game uses long algebraic notation without pieces names for submitting moves.
This method for determining moves is perfect for simplicity and clarity, and is standard for the Universal Chess Interface (UCI).
🔹 How to Notate
Long algebraic notation (without pieces name) is simple to understand. This notation does not use capture symbols or check/checkmate symbols; it uses only the squares involved in the move and any promotion occurring.
{Starting Square}{Ending Square}{Promotion Piece(if needed)}
Locate the starting square and the ending square of the piece being moved, without mentioning the piece itself.
Identify the column letters (a-h) and row numbers (1-8) that align with your desired move.
If a pawn reaches the opposite end of the board the pawn gets promoted, add the letter representing the piece it is promoted to at the end of the move.
Put it all together and you've got your notation!
Piece Notations for Pawn Promotions:
'n' for Knight ('k' is reserved for the King in chess notation)
'b' for Bishop
'r' for Rook
'q' for Queen
Normal Move Example: Moving a piece from e2 to e4 is notated as "e2e4".
Pawn Promotion Example: Promoting a pawn to a queen is notated as "e7e8q".
🔶 DETAILS
Miss a day? Yesterday's puzzle can be re-played, check the box for 'View Yesterday's Puzzle' in the settings.
This indicator makes use of Tooltips! . Hover over a square to see that square's notation.
This script makes use of 5 libraries, each storing 2 years worth of daily chess puzzles amounting to 10 years of unique daily chess puzzles.
"timenow" is used to determine which day it is, so even on a closed ticker or weekend or holiday a new chess puzzle will be displayed.
Users have the option to choose from 5 different board themes.
Chess_Data_5This library supplies a randomized list of 1-Move Chess Puzzles, this is 5/5 in my collection of puzzles on Tradingview.
This library contains 730 chess puzzles, this is enough for 1 unique chess puzzle for 2 years (730/365 = 2)
The Puzzles are sourced from Lichess's open-source database found here -> | database.lichess.org
This data has been reduced to only included 1-Move chess puzzles with a popularity rating of > 70, and condensed for ease of formatting and less characters.
The reduced format of the data in this library reads:
"Puzzle Code, Modified FEN, Moves, Puzzle Rating, Popularity Rating"
Puzzle Code: Lichess Codes Identifying each puzzle, this allows them to be retrieved from their website based on this Code.
Modified FEN: Forsyth-Edwards Notation is the standard notation to describe positions of a chess game. This includes the active move tacked onto the end after the last '/', this simplifies the process to retrieve the active move in PineScript.
Moves: This holds the first move seen by the player in the puzzle (opposite color), and then the correct next move which is Puzzle Solution, that the player is trying to determine.
Puzzle Rating: Difficulty Rating of the Puzzle, Generally speaking | Under 1500 = Beginner | 1500 to 1800 Casual | 1800 to 2100 Intermediate | 2100+ Advanced
Popularity Ranking: This is the popularity ranking calculated by lichess based on their own data of user feedback.
Note: After Reducing the amount of data down to only 1-Move puzzles with a popularity rating of > 70%, there is still around 340k puzzles. (Enough for over 900 Years!)
> Functions [/b
get()
Returns the list of chess puzzle data.
Chess_Data_4This library supplies a randomized list of 1-Move Chess Puzzles, this is 4/5 in my collection of puzzles on Tradingview.
This library contains 730 chess puzzles, this is enough for 1 unique chess puzzle for 2 years (730/365 = 2)
The Puzzles are sourced from Lichess's open-source database found here -> | database.lichess.org
This data has been reduced to only included 1-Move chess puzzles with a popularity rating of > 70, and condensed for ease of formatting and less characters.
The reduced format of the data in this library reads:
"Puzzle Code, Modified FEN, Moves, Puzzle Rating, Popularity Rating"
Puzzle Code: Lichess Codes Identifying each puzzle, this allows them to be retrieved from their website based on this Code.
Modified FEN: Forsyth-Edwards Notation is the standard notation to describe positions of a chess game. This includes the active move tacked onto the end after the last '/', this simplifies the process to retrieve the active move in PineScript.
Moves: This holds the first move seen by the player in the puzzle (opposite color), and then the correct next move which is Puzzle Solution, that the player is trying to determine.
Puzzle Rating: Difficulty Rating of the Puzzle, Generally speaking | Under 1500 = Beginner | 1500 to 1800 Casual | 1800 to 2100 Intermediate | 2100+ Advanced
Popularity Ranking: This is the popularity ranking calculated by lichess based on their own data of user feedback.
Note: After Reducing the amount of data down to only 1-Move puzzles with a popularity rating of > 70%, there is still around 340k puzzles. (Enough for over 900 Years!)
> Functions [/b
get()
Returns the list of chess puzzle data.
Chess_Data_3This library supplies a randomized list of 1-Move Chess Puzzles, this is 3/5 in my collection of puzzles on Tradingview.
This library contains 730 chess puzzles, this is enough for 1 unique chess puzzle for 2 years (730/365 = 2)
The Puzzles are sourced from Lichess's open-source database found here -> | database.lichess.org
This data has been reduced to only included 1-Move chess puzzles with a popularity rating of > 70, and condensed for ease of formatting and less characters.
The reduced format of the data in this library reads:
"Puzzle Code, Modified FEN, Moves, Puzzle Rating, Popularity Rating"
Puzzle Code: Lichess Codes Identifying each puzzle, this allows them to be retrieved from their website based on this Code.
Modified FEN: Forsyth-Edwards Notation is the standard notation to describe positions of a chess game. This includes the active move tacked onto the end after the last '/', this simplifies the process to retrieve the active move in PineScript.
Moves: This holds the first move seen by the player in the puzzle (opposite color), and then the correct next move which is Puzzle Solution, that the player is trying to determine.
Puzzle Rating: Difficulty Rating of the Puzzle, Generally speaking | Under 1500 = Beginner | 1500 to 1800 Casual | 1800 to 2100 Intermediate | 2100+ Advanced
Popularity Ranking: This is the popularity ranking calculated by lichess based on their own data of user feedback.
Note: After Reducing the amount of data down to only 1-Move puzzles with a popularity rating of > 70%, there is still around 340k puzzles. (Enough for over 900 Years!)
> Functions [/b
get()
Returns the list of chess puzzle data.
Chess_Data_2This library supplies a randomized list of 1-Move Chess Puzzles, this is 2/5 in my collection of puzzles on Tradingview.
This library contains 730 chess puzzles, this is enough for 1 unique chess puzzle for 2 years (730/365 = 2)
The Puzzles are sourced from Lichess's open-source database found here -> | database.lichess.org
This data has been reduced to only included 1-Move chess puzzles with a popularity rating of > 70, and condensed for ease of formatting and less characters.
The reduced format of the data in this library reads:
"Puzzle Code, Modified FEN, Moves, Puzzle Rating, Popularity Rating"
Puzzle Code: Lichess Codes Identifying each puzzle, this allows them to be retrieved from their website based on this Code.
Modified FEN: Forsyth-Edwards Notation is the standard notation to describe positions of a chess game. This includes the active move tacked onto the end after the last '/', this simplifies the process to retrieve the active move in PineScript.
Moves: This holds the first move seen by the player in the puzzle (opposite color), and then the correct next move which is Puzzle Solution, that the player is trying to determine.
Puzzle Rating: Difficulty Rating of the Puzzle, Generally speaking | Under 1500 = Beginner | 1500 to 1800 Casual | 1800 to 2100 Intermediate | 2100+ Advanced
Popularity Ranking: This is the popularity ranking calculated by lichess based on their own data of user feedback.
Note: After Reducing the amount of data down to only 1-Move puzzles with a popularity rating of > 70%, there is still around 340k puzzles. (Enough for over 900 Years!)
> Functions [/b
get()
Returns the list of chess puzzle data.
Chess_Data_1This library supplies a randomized list of 1-Move Chess Puzzles, this is 1/5 in my collection of puzzles on Tradingview.
This library contains 730 chess puzzles, this is enough for 1 unique chess puzzle for 2 years (730/365 = 2)
The Puzzles are sourced from Lichess's open-source database found here -> | database.lichess.org
This data has been reduced to only included 1-Move chess puzzles with a popularity rating of > 70, and condensed for ease of formatting and less characters.
The reduced format of the data in this library reads:
"Puzzle Code, Modified FEN, Moves, Puzzle Rating, Popularity Rating"
Puzzle Code: Lichess Codes Identifying each puzzle, this allows them to be retrieved from their website based on this Code.
Modified FEN: Forsyth-Edwards Notation is the standard notation to describe positions of a chess game. This includes the active move tacked onto the end after the last '/', this simplifies the process to retrieve the active move in PineScript.
Moves: This holds the first move seen by the player in the puzzle (opposite color), and then the correct next move which is Puzzle Solution, that the player is trying to determine.
Puzzle Rating: Difficulty Rating of the Puzzle, Generally speaking | Under 1500 = Beginner | 1500 to 1800 Casual | 1800 to 2100 Intermediate | 2100+ Advanced
Popularity Ranking: This is the popularity ranking calculated by lichess based on their own data of user feedback.
Note: After Reducing the amount of data down to only 1-Move puzzles with a popularity rating of > 70%, there is still around 340k puzzles. (Enough for over 900 Years!)
> Functions [/b
get()
Returns the list of chess puzzle data.
Word PuzzleWord Puzzle is a PineScript-based clone of the popular daily puzzle game called "Wordle".
It is not identical, but the general gameplay is the same.
>How It works (The Game)
A secret word (also referred to as the "target word") is randomly selected from a database of 5 Letter words.
The player/user's goal is to guess that word within 6 attempts.
After each guess, the script provides information to the user by color coding the letters of their guess.
Green (Known Letters): These letters are in the exact spot that they occur in the target word.
Yellow (Included Letters): These letters are included in the target word; however, the user does not have them in the correct position.
Gray (Un-used Letters): These letters do not occur anywhere in the target word
>Interface
On each turn the user will input their 5 letter guess into the "Guess #" box and submit it by checking the check-box next to the word.
If the input word is invalid, the script will prompt you. Invalid words are any words not found within the script's valid word list.
After guess 3, hints may be viewed by hovering over the "Need a Hint" box on the display.
If you are unable to guess the word in the given amount of guesses, the 'Game Over' screen will display, and you will be able to view the answer in the same box as the hints.
To start a new game, clear all inputs and insert a different number into the "Puzzle Seed" input, to have the script randomly select a new word.
NOTE: Word selection based on the seed number is deterministic, the same seed number will always have the same puzzle word.
>Additional Information
The script comes equipped with 5 different themes as seen below.
Table size is also selectable.
This indicator makes use of 'tooltips'.
Hover over the boxes on the table for quick reference information or additional information on prompts.
Since the script randomly selects from the ENTIRE valid word list you are bound to come across some obscure words with strange spellings.
Because of this, I have built in a "quick way out".
To end a game without filling out all guesses, submit the answer "Give Up" to skip to the end screen where you can reveal the puzzle's answer.
Afterwards, take a second to look up the definition! Ever heard of a xylyl?!
The code is fully notated. Most of the script involves string management, but there are still some neat tricks in here as well.
Enjoy!
Word_Puzzle_Data_R2ZLibrary "Word_Puzzle_Data_R2Z"
This Library consists of functions for returning arrays of words starting with R through Z.
By splitting the data through multiple libraries, I can import more tokens into my final compiled script, so having this data separately is extremely helpful.
This library is the the container 1/3 for my database of 5 Letter words uses in my "Word Puzzle" Game.
The List was Obtained from this master list| gist.github.com
The list was also filtered for profanity.
If there were more than 999 words under 1 first letter, then I have made the array for the 1 letter into 2. 'letter1' & 'letter2', these are used for the letters "P, B, & S".
All words are lowercase
r_ary()
- Returns an array of words starting with "R"
s1_ary()
- Returns an array of words starting with "S"
s2_ary()
- Returns an array of words starting with "S"
t_ary()
- Returns an array of words starting with "T"
u_ary()
- Returns an array of words starting with "U"
v_ary()
- Returns an array of words starting with "V"
w_ary()
- Returns an array of words starting with "W"
x_ary()
- Returns an array of words starting with "X"
y_ary()
- Returns an array of words starting with "Y"
z_ary()
- Returns an array of words starting with "Z"
Word_Puzzle_Data_I2QLibrary "Word_Puzzle_Data_I2Q"
This Library consists of functions for returning arrays of words starting with I through Q.
By splitting the data through multiple libraries, I can import more tokens into my final compiled script, so having this data separately is extremely helpful.
This library is the the container 1/3 for my database of 5 Letter words uses in my "Word Puzzle" Game.
The List was Obtained from this master list| gist.github.com
The list was also filtered for profanity.
If there were more than 999 words under 1 first letter, then I have made the array for the 1 letter into 2. 'letter1' & 'letter2', these are used for the letters "P, B, & S".
All words are lowercase
i_ary()
- Returns an array of words starting with "I"
j_ary()
- Returns an array of words starting with "J"
k_ary()
- Returns an array of words starting with "K"
l_ary()
- Returns an array of words starting with "L"
m_ary()
- Returns an array of words starting with "M"
n_ary()
- Returns an array of words starting with "N"
o_ary()
- Returns an array of words starting with "O"
p1_ary()
- Returns an array of words starting with "P"
p2_ary()
- Returns an array of words starting with "P"
q_ary()
- Returns an array of words starting with "Q"
Word_Puzzle_Data_A2HLibrary "Word_Puzzle_Data_A2H"
This Library consists of functions for returning arrays of words starting with A through H.
By splitting the data through multiple libraries, I can import more tokens into my final compiled script, so having this data separately is extremely helpful.
This library is the the container 1/3 for my database of 5 Letter words uses in my "Word Puzzle" Game.
The List was Obtained from this master list| gist.github.com
The list was also filtered for profanity.
If there were more than 999 words under 1 first letter, then I have made the array for the 1 letter into 2. 'letter1' & 'letter2', these are used for the letters "P, B, & S".
All words are lowercase
a_ary()
- Returns an array of words starting with "'A"
b1_ary()
- Returns an array of words starting with "B"
b2_ary()
- Returns an array of words starting with "B"
c_ary()
- Returns an array of words starting with "C"
d_ary()
- Returns an array of words starting with "D"
e_ary()
- Returns an array of words starting with "E"
f_ary()
- Returns an array of words starting with "F"
g_ary()
- Returns an array of words starting with "G"
h_ary()
- Returns an array of words starting with "H"
3D BowlingIntroducing the "3D Bowling Game" – a fun and interactive demo scene project in Pine Script, powered by a custom 3D engine! This bowling game showcases the potential of Pine Script for developing engaging and immersive experiences, even within the confines of a trading platform.
To play the game, you'll first be prompted to choose where you want to throw the ball. Next, you'll be asked to draw a line indicating the direction you want the ball to go. Sit back and enjoy as the game takes care of the rest!
The source code features various sections, including:
Types and helper functions to manipulate vectors, matrices, and angles
Routines for calculating cross products, dot products, and vector normalization
Transformation matrices for rotation and scaling
Functions for perspective transformation, mesh transformations, and face normal calculations
Culling and shading algorithms to provide a more realistic visual experience
The project's source code is an excellent starting point for anyone interested in exploring the capabilities of Pine Script beyond the typical trading indicators and strategies. The 3D Bowling Game demonstrates the flexibility of Pine Script and its potential for creating interactive experiences in a seemingly unconventional environment.
So, what are you waiting for? Dive into the source code, tweak it to your liking, or build upon it to create your own interactive 3D experiences. Enjoy the game, and happy coding!
With light. I will say there is an issue with the fact that you cant draw as may linefills as you can lines.
Gamification IndicatorDo you want your charts to look like a video game? Look no further! Would you rather be an alien racing through a lava tube, a surfer with great white sharks, an airplane flying through the clouds, or some other custom emoji setup of your choice? Traders can choose their own custom player emoji, trend indicator, obstacle emoji, and celestial emoji. This indicator is just for fun and is not intended to be used when making trading decisions. Enjoy!
This indicator also contains a live sun/moon emoji that should accurately reflect day/night and can give information about the current moon phases.
Shoutout to @citlacom for the public Moon Ephemeris and calculations. Building this indicator was a useful & fun introduction to financial astrology in Pinescript.
Tic Tac Toe (For Fun)Hello All,
I think all of you know the game "Tic Tac Toe" :) This time I tried to make this game, and also I tried to share an example to develop a game script in Pine. Just for fun ;)
Tic Tac Toe Game Rules:
1. The game is played on a grid that's 3 squares by 3 squares.
2. You are "O", the computer is X. Players take turns putting their marks in empty squares.
3. if a player makes 3 of her marks in a row (up, down, across, or diagonally) the he is the winner.
4. When all 9 squares are full, the game is over (draw)
So, how to play the game?
- The player/you can play "O", meaning your mark is "O", so Xs for the script. please note that: The script plays with ONLY X
- There is naming for all squears, A1, A2, A3, B1, B2, B3, C1, C2, C3. you will see all these squares in the options.
- also You can set who will play first => "Human" or "Computer"
if it's your turn to move then you will see "You Move" text, as seen in the following screenshot. for example you want to put "O" to "A1" then using options set A1 as O
How the script play?
it uses MinMax algorithm with constant depth = 4. And yes we don't have option to make recursive functions in Pine at the moment so I made four functions for each depth. this idea can be used in your scripts if you need such an algorithm. if you have no idea about MinMax algorithm you can find a lot of articles on the net :)
The script plays its move automatically if its turn to play. you will just need to set the option that computer played (A1, C3, etc)
if it's computer turn to play then it calculates and show the move it wants to play like "My Move : B3 <= X" then using options you need to set B3 as X
Also it checks if the board is valid or not:
I have tested it but if you see any bug let me know please
Enjoy!
[RS]predict player directionExperimental:
adapted from classical game movement prediction algo and how a crude recursive error classifier can be applied..