xxxxxxxxxx
410
let scene = 0
let actualintrobg
let introbg
let secondbg
let thirdbg
let sudokuGrid = [];
let symbols = ["✽", "✿", "✤", "★", "♡", "✄", "☭", "ﷲ" , "ء"];
//let names = ["ﷲ" ," ٱللَّٰهِ","ٱلرَّحِيمِ","ٱلرَّحْمَٰنِ","بِسْمِ"]; //array/list of allah's names
let names = [
"الله",
"الرَّحْمن",
"الرَّحِيم",
"المَلِك",
"الْقُدُّوس",
"السَّلَام",
"المُؤْمِن",
"الْمُهَيْمِن",
"الْعَزِيز",
"الْجَبَّار",
"الْمُتَكَبِّر",
"الْخَالِق",
"الْبَارِئ",
"الْمُصَوِّر",
"اَلْغَفَّار",
"الْقَهَّار",
"الْوَهَّاب",
"الرَّزَّاق",
"الْفَتَّاح",
"الْعَلِيم",
"الْقَابِضُ الْبَاسِطُ",
"الخافض الرَّافِعُ",
"المعز المذل",
"السَّمِيعُ",
"الْبَصِير",
"الْحَكَم",
"العدل",
"اللَّطِيفُ",
"الْخَبِيرُ",
"الْحَلِيمُ",
"الْعَظِيمُ",
"الْغَفُورُ",
"الشَّكُورُ",
"الْعَلِيُّ",
"الْكَبِيرُ",
"الْحَفِيظُ",
"المُقِيت",
"الْحَسِيبُ",
"الجليل",
"الْكَرِيمُ",
"الرَّقِيبُ",
"الْمُجِيبُ",
"الْوَاسِعُ",
"اَلْحَكِيمُ",
"الْوَدُودُ",
"الْمَجِيدُ",
"الباعث",
"الشَّهِيدُ",
"الْحَقُّ",
"الْوَكِيلُ",
"الْقَوِيّ",
"الْمَتِينُ",
"الْوَلِيُّ",
"الْحَمِيدُ",
"الـمُحصِي",
"المبدئ",
"المعيد",
"المُحيي",
"المميت",
"الْحَيُّ",
"الْقَيُّومُ",
"الواجد",
"الماجد",
"الْوَاحِدُ",
"الصَّمَدُ",
"الْقَادِرُ",
"الْمُقْتَدِرُ",
"الْمُقَدِّمُ",
"الْمُؤَخِّرُ",
"الْأَوَّلُ",
"الْآخِرُ",
"الظَّاهِرُ",
"الْبَاطِنُ",
"الوالي",
"الْمُتَعَالِ",
"الْبَرُّ",
"التَّوَّابُ",
"الْمُنْتَقِمُ",
"العَفُو",
"الرَّؤُوفُ",
"مَالِكُ الْمُلْكِ",
"ذُو الْجَلَالِ وَالْإكْرَامِ",
"المقسط",
"الْجَامِعُ",
"الْغَنِيُّ",
"المغني",
"الْمُعْطِي المانع",
"الضار النافع",
"النُّورُ",
"الْهَادِي",
"الْبَدِيعُ",
"الباقي",
"الْوَارِثُ",
"الرشيد",
"الصبور"
];
let explanations = [
"الله: وهو الاسم الأعظم الذي تفرد به الحق سبحانه وخص به نفسه وجعله أول أسمائه، وأضافها كلها إليه فهو علم على ذاته سبحانه. Allah: It is the greatest name that is unique to Allah, the Almighty, and He made it the first of His names, and He added them all to Himself, so it is a name for His Self, the Almighty.",
"الرَّحْمن: كثير الرحمة وهو اسم مقصور على الله عز وجل ولا يجوز أن يقال رحمن لغير الله، وذلك لأن رحمته وسعت كل شيء وهو أرحم الراحمين. Al-Rahman: The Most Merciful, and it is a name limited to Allah, the Almighty, and it is not permissible to say “Rahman” to anyone other than Allah, because His mercy encompasses everything, and He is the Most Merciful of the merciful.",
"الرَّحِيم: هو المنعم أبدا، المتفضل دوما، فرحمته لا تنتهي. Al-Raheem: He is the One who is always generous, always kind, and His mercy is endless.",
"المَلِك: هو الله، ملك الملوك، له الملك، وهو مالك يوم الدين، ومليك الخلق فهو المالك المطلق. Al-Malik: He is Allah, the King of Kings, His is the kingdom, and He is the Owner of the Day of Judgment, and the King of creation, so He is the absolute Owner.",
"الْقُدُّوس: هو الطاهر المنزه عن العيوب والنقائص وعن كل ما تحيط به العقول. Al-Quddus: He is the Pure One, free from faults and shortcomings and from everything that the minds encompass.",
"السَّلَام: هو ناشر السلام بين الأنام وهو الذي سلمت ذاته من النقص والعيب والفناء. Al-Salam: He is the One who spreads peace among mankind, and He is the One whose Self is free from deficiency, defect, and annihilation.",
"المُؤْمِن: هو الذي سلم أوليائه من عذابه، والذي يصدق عباده ما وعدهم. Al-Mu’min: He is the One who saves His friends from His punishment, and He fulfills what He promised His servants.",
"الْمُهَيْمِن: هو الرقيب الحافظ لكل شيء، القائم على خلقه بأعمالهم، وأرزاقهم وآجالهم، والمطلع على خفايا الأمور وخبايا الصدور. Al-Muhaymin: He is the Watcher and Preserver of everything, who is in charge of His creation with their deeds, their provisions and their terms, and who is aware of the hidden matters and the secrets of the hearts.",
"الْعَزِيز: هو المنفرد بالعزة، الظاهر الذي لا يقهر، القوي الممتنع فلا يغلبه شيء وهو غالب كل شيء. Al-Aziz: He is the One who is unique in glory, the Manifest who is not defeated, the Strong and Invincible, so nothing can defeat Him and He is the Victorious over everything.",
"الْجَبَّار: هو الذي تنفذ مشيئته، ولا يخرج أحد عن تقديره، وهو القاهر لخلقه على ما أراد. Al-Jabbaar: He is the One whose will is enforced, and no one goes outside His estimation, and He is the One who subdues His creation as He wills.",
"الْمُتَكَبِّر: هو المتعالي عن صفات الخلق المنفرد بالعظمة والكبرياء. Al-Muttakkabbir: He is the One who is exalted above the attributes of creation, unique in greatness and pride.",
"الْخَالِق: هو الفاطر المبدع لكل شيء، والمقدر له والموجد للأشياء من العدم، فهو خالق كل صانع وصنعته. Al-Khaliq: He is the Initiator and Originator of everything, and the One who determines it and brings things into existence from nothing, so He is the Creator of every maker and his creation.",
"الْبَارِئ: هو الذي خلق الخلق بقدرته لا عن مثال سابق، القادر على إبراز ما قدره إلى الوجود. Al-Bari’: He is the One who created creation with His power and not from a previous example, and is able to bring forth what He has determined into existence.",
"الْمُصَوِّر: هو الذي صور جميع الموجودات، ورتبها فأعطى كل شيء منها صورة خاصة، وهيئة منفردة، يتميز بها على اختلافها وكثرتها. Al-Musawwir: He is the One who formed all existences and arranged them, giving each thing a special image and a unique form, which distinguishes it despite its differences and abundance.",
"الغَفَّارُ: هو الذي يغفر الذنوب مهما عظمت، ويستر العيوب مهما كثرت، وهو الذي لا يؤاخذ بالذنب إن تاب صاحبه. al-Ghaffār: He is the One who forgives sins no matter how great, and covers faults no matter how numerous. He does not hold someone accountable for their sin if they repent.",
"القَهَّارُ: هو الذي قهر الجبابرة بعزته، وقهر الخلق كلهم بالموت. al-Qahhār: He is the One who subdues the tyrants with His might and overwhelms all creation with death.",
"الوَهَّابُ: هو الذي يهب العطاء دون عوض، ويمنح النعم بلا مقابل. al-Wahhāb: He is the One who grants gifts without compensation and bestows blessings without expecting anything in return.",
"الرَّزَّاقُ: هو الذي يرزق العباد ويهيئ أسباب المعيشة لهم، ولا ينفد عطاؤه. ar-Razzāq: He is the One who provides sustenance to His servants and prepares means of living for them, and His giving never diminishes.",
"الفَتَّاحُ: هو الذي يفتح أبواب الرزق والرحمة لمن يشاء، ويفصل بين الحق والباطل. al-Fattāḥ: He is the One who opens the doors of sustenance and mercy for whomever He wills and judges between truth and falsehood.",
"العَلِيمُ: هو الذي أحاط علمه بكل شيء، يعلم السر والعلانية، والماضي والحاضر والمستقبل. al-ʿAlīm: He is the One whose knowledge encompasses everything; He knows the hidden and the apparent, the past, present, and future.",
"القَابِضُ: هو الذي يقبض الرزق أو الأرواح أو الأعمال وفق حكمته. al-Qābiḍ: He is the One who withholds sustenance, souls, or deeds according to His wisdom.لبَاسِطُ: هو الذي يوسع الرزق على عباده ويمدهم بالنعم. He is the One who spreads out sustenance for His servants and bestows blessings upon them.",
"الخَافِضُ: هو الذي يخفض الكافرين بالذل والهوان، ويخفض الأقدار بميزانه العدل. al-Khāfiḍ: He is the One who humbles the disbelievers with disgrace and abasement and lowers destinies with His just balance. الرَّافِعُ: هو الذي يرفع المؤمنين بعزته، ويرفع الأقدار بفضله. ar-Rāfiʿ: He is the One who elevates the believers with His might and raises destinies by His grace.",
"المُعِزُّ: هو الذي يعز أولياءه بنصره وتأييده. al-Muʿizz: He is the One who grants honor to His allies with His support and aid. المُذِلُّ: هو الذي يذل الكافرين بعقابه وعدله. al-Muḏill: He is the One who humiliates the disbelievers with His punishment and justice.",
"السَّمِيعُ: هو الذي يسمع دعاء الخلق جميعًا، ويجيب دعاءهم. as-Samīʿ: He is the One who hears the supplication of all creation and responds to their prayers.",
"البَصِيرُ: هو الذي يرى كل شيء ظاهرًا وباطنًا، ويراقب أعمال عباده. al-Baṣīr: He is the One who sees everything, both apparent and hidden, and observes the deeds of His servants.",
"الحَكَمُ: هو الذي يفصل بين الخلائق بالحق والعدل يوم القيامة. al-Ḥakam: He is the One who judges between His creation with truth and justice on the Day of Judgment.",
"العَدْلُ: هو الذي عدل في حكمه وأفعاله، وميزان الحق بيده. al-ʿAdl: He is the One who is just in His judgment and actions, and the scale of truth is in His hand.",
"اللَّطِيفُ: هو الذي يرزق عباده بلطفه، ويعلم دقائق الأمور. al-Laṭīf: He is the One who provides for His servants with subtle kindness and knows the intricacies of matters.",
"الخَبِيرُ: هو الذي يعلم بواطن الأمور وخفاياها. al-Khabīr: He is the One who knows the inner aspects of matters and their secrets.",
"الحَلِيمُ: هو الذي لا يعجل بالعقوبة، ويصبر على عصيان العباد. al-Ḥalīm: He is the One who does not hasten punishment and patiently endures the disobedience of His servants.",
"العَظِيمُ: هو الذي لا يمكن إدراك كنهه، وكل شيء في الكون يدل على عظمته. al-ʿAẓīm: He is the One whose essence cannot be comprehended, and everything in the universe points to His greatness.",
"الغَفُورُ: هو الذي يكثر من المغفرة لعباده. al-Ghafūr: He is the One who frequently forgives His servants.",
"الشَّكُورُ: هو الذي يثيب على القليل من العمل، ويعطي الكثير من النعم. ash-Shakūr: He is the One who rewards even a small amount of good deeds and bestows abundant blessings.",
"العَلِيُّ: هو الذي علا بذاته وصفاته، ولا يدركه أحد. al-ʿAliyy: He is the One who is exalted in His essence and attributes, and none can comprehend Him.",
"الكَبِيرُ: هو العظيم الذي كل شيء دونه صغير. al-Kabīr: He is the Great One before whom everything else is insignificant.",
"الحَفِيظُ: هو الذي يحفظ الكون من الزوال، ويحفظ عباده من المصائب. al-Ḥafīz: He is the One who preserves the universe from perishing and protects His servants from calamities.",
"المُقِيتُ: هو الذي يرزق الأبدان والأرواح قوتها. al-Muqīt: He is the One who provides nourishment to both bodies and souls.",
"الحَسِيبُ: هو الذي يكفي عباده جميعًا، ويحاسبهم بعدله. al-Ḥasīb: He is the One who suffices all His servants and holds them accountable with His justice.",
"الجَلِيلُ: هو العظيم في ذاته وصفاته وأفعاله، المستحق للإجلال والتعظيم. al-Jalīl: He is the One who is magnificent in His essence, attributes, and actions, deserving of reverence and glorification.",
"الكَرِيمُ: هو الجواد المعطي الذي لا ينفد عطاؤه، ولا تنقطع نعمه. al-Karīm: He is the Generous One, the Giver whose bounties never deplete, and whose blessings never cease.",
"الرَّقِيبُ: هو الحافظ الذي لا يغفل عن شيء، يراقب كل ما يصدر عن عباده. ar-Raqīb: He is the Watchful One, who never neglects anything and observes all that His servants do.",
"المُجِيبُ: هو الذي يجيب الدعاء ويحقق الرجاء، مهما كانت الحاجة. al-Mujīb: He is the One who responds to supplications and fulfills hopes, no matter the need.",
"الوَاسِعُ: هو الذي وسع علمه ورحمته كل شيء، وأحاط بكل الوجود. al-Wāsiʿ: He is the One whose knowledge and mercy encompass everything, enveloping all of existence.",
"الحَكِيمُ: هو الذي يضع الأمور في مواضعها بحكمة بالغة. al-Ḥakīm: He is the One who places matters in their proper places with perfect wisdom.",
"الوَدُودُ: هو الذي يحب عباده المؤمنين، ويحبونه لطاعته وفضله. al-Wadūd: He is the One who loves His believing servants and is loved by them for His obedience and grace.",
"المَجِيدُ: هو الذي له المجد الكامل، والمنزه عن النقص والعيب. al-Majīd: He is the One who possesses complete glory, free from deficiency or flaw.",
"البَاعِثُ: هو الذي يبعث الخلق يوم القيامة، ويبعث الحياة في كل حي. al-Bāʿiṯ: He is the One who will resurrect the creation on the Day of Judgment and brings life to all living beings.",
"الشَّهِيدُ: هو الذي لا يغيب عنه شيء، ويشهد على عباده بأعمالهم. ash-Shahīd: He is the One who nothing escapes Him, and He witnesses His servants' deeds.",
"الحَقُّ: هو الذي يحق الحق، وكلماته وأفعاله كلها حق. al-Ḥaqq: He is the One who establishes truth, and all His words and actions are true.",
"الوَكِيلُ: هو الكافي لمن توكل عليه، المتولي أمر عباده. al-Wakīl: He is the One who suffices those who rely on Him and manages the affairs of His servants.",
"القَوِيُّ: هو الذي لا يغلبه شيء، وهو القادر على كل شيء. al-Qawiyy: He is the One whom nothing can overpower, and He is capable of all things.",
"المَتِينُ: هو القوي في ذاته وصفاته، الذي لا تنقطع قوته. al-Matīn: He is the One who is firm in His essence and attributes, whose strength never diminishes.",
"الوَلِيُّ: هو المتولي لأمور عباده، والمؤيد لأنبيائه وأوليائه. al-Waliyy: He is the One who manages the affairs of His servants and supports His prophets and allies.",
"الحَمِيدُ: هو الذي يستحق الحمد والثناء بكل ألسنة الخلق. al-Ḥamīd: He is the One deserving of praise and gratitude by all tongues of creation.",
"المُحْصِي: هو الذي أحصى كل شيء علمًا وعددًا. al-Muḥsīy: He is the One who has accounted for everything in knowledge and number.",
"المُبْدِئُ: هو الذي بدأ الخلق وأوجده من العدم. al-Mubdiʾ: He is the One who initiated creation and brought it into existence from nothing.",
"المُعِيدُ: هو الذي يعيد الخلق بعد الموت، ويعيد كل شيء إلى أصله. al-Muʿīd: He is the One who restores creation after death and returns everything to its origin.",
"المُحْيِي: هو الذي يحيي الأموات، ويحيي القلوب بالهداية. al-Muḥyī: He is the One who gives life to the dead and revives hearts with guidance.",
"المُمِيتُ: هو الذي يميت الأحياء بقدرته، وينهي أعمارهم. al-Mumīt: He is the One who causes the living to die by His power and ends their appointed terms.",
"الحَيُّ: هو الدائم الحياة التي لا بداية لها ولا نهاية. al-Ḥayy: He is the One with eternal life, having neither a beginning nor an end.",
"القَيُّومُ: هو القائم بنفسه، والمقيم لغيره، لا تأخذه سنة ولا نوم. al-Qayyūm: He is the One who is self-sustaining and sustains others, without slumber or sleep.",
"الوَاجِدُ: هو الغني الذي لا يحتاج إلى شيء، وهو صاحب الكمال المطلق. al-Wājid: He is the One who is self-sufficient, needing nothing, and possesses absolute perfection.",
"المَاجِدُ: هو الذي له المجد والعظمة في ذاته وأفعاله. al-Mājid: He is the One who possesses glory and greatness in His essence and actions.",
"الوَاحِدُ: هو الذي لا شريك له في ذاته ولا في صفاته. al-Wāḥid: He is the One who has no partner in His essence or attributes.",
"الصَّمَدُ: هو المقصود في الحوائج كلها، الذي لا يحتاج إلى أحد. aṣ-Ṣamad: He is the One to whom all needs are directed, who needs no one.",
"القَادِرُ: هو الذي لا يعجزه شيء في الأرض ولا في السماء. al-Qādir: He is the One for whom nothing in the heavens or earth is beyond His power.",
"المُقْتَدِرُ: هو الذي يقدر على كل شيء بحكمته وقدرته. al-Muqtadir: He is the One who has power over all things with His wisdom and might.",
"المُقَدِّمُ: هو الذي يرفع ويقدم من يشاء من عباده حسب حكمته. al-Muqaddim: He is the One who elevates and advances whomever He wills among His servants according to His wisdom.",
"المُؤَخِّرُ: هو الذي يؤخر من يشاء بعلمه وحكمته ويضع كل شيء في موضعه. al-Muʾakhkhir: He is the One who delays whomever He wills with His knowledge and wisdom, placing everything in its proper position.",
"الأَوَّلُ: هو الذي ليس قبله شيء، الموجود أزلاً بلا بداية. al-ʾAwwal:He is the One before whom there was nothing, existing eternally without a beginning.",
"الآخِرُ: هو الذي ليس بعده شيء، الباقي أبدًا بلا نهاية. al-ʾÃkhir: He is the One after whom there is nothing, eternally enduring without an end.",
"الظَّاهِرُ: هو الذي ظهر فوق كل شيء بقهره وعظمته. aẓ-Ẓāhir: He is the One who is above all things through His dominance and greatness.",
"البَاطِنُ: هو الذي أحاط بكل شيء علمًا، وخفي عن إدراك الأبصار. al-Bāṭin: He is the One who encompasses all things in knowledge and is hidden from the perception of vision.",
"الوَالِي: هو المتولي لأمور خلقه، المتصرف في ملكه كيف يشاء. al-Wāliy: He is the One who manages the affairs of His creation, disposing of His dominion as He wills.",
"المُتَعَالِ: هو الذي جل عن إفك المفترين، وتنزه عن وساوس المتحيرين. al-Mutʿāliy: He is the One who is exalted above the lies of the slanderers and is far removed from the whispers of the perplexed.",
"البَرُّ: هو العطوف على عباده ببره ولطفه، ومن على السائلين بحسن عطائه. al-Barr: He is the One who is compassionate towards His servants with His kindness and gentleness and bestows His good gifts upon those who ask.",
"التَّوَّابُ: هو الذي يوفق عباده للتوبة حتى يتوب عليهم ويقبل توبتهم. at-Tawwāb: He is the One who guides His servants to repentance, accepts their repentance, and forgives their sins.",
"المُنْتَقِمُ: هو الذي يقصم ظهور الطغاة، ويشدد العقوبة على العصاة بعد الإنذار. al-Muntaqim: He is the One who breaks the backs of tyrants and intensifies punishment for the disobedient after giving warnings.",
"العَفُوُ: هو الذي يترك المؤاخذة على الذنوب ويمحو السيئات ويتجاوز عن المعاصي. al-ʿAfuww: He is the One who forgoes accountability for sins, erases bad deeds, and overlooks transgressions.",
"الرَّؤُوفُ: هو المتعطف على المذنبين بالتوبة، الذي جاد بلطفه ومَنَّ بتعطفه. ar-Raʾūf: He is the One who is compassionate towards sinners with repentance, generous with His kindness, and merciful in His forgiveness.",
"مَالِكُ المُلْكِ: هو المتصرف في ملكه كيف يشاء، لا راد لحكمه ولا معقب لأمره. Mālik-ul-mulk: He is the One who disposes of His dominion as He wills, with none to overturn His judgment or challenge His command.",
"ذُو الجَلَالِ وَالإِكْرَامِ: هو المنفرد بصفات الجلال والعظمة، المختص بالإكرام. Ḏū l-Jalāli wa l-ʾIkrām: He is the One unique in majesty and greatness, distinguished by honor and dignity.",
"المُقْسِطُ: هو العادل في حكمه، الذي ينتصف للمظلوم من الظالم. al-Muqsiṭ: He is the One who is just in His judgment, granting justice to the oppressed against the oppressor.",
"الجَامِعُ: هو الذي يجمع الأولين والآخرين، والجمع بين الخلائق في يوم القيامة. al-Jāmiʿ: He is the One who brings together the first and the last and gathers all creatures on the Day of Judgment.",
"الغَنِيُّ: هو الذي لا يحتاج إلى شيء، المستغني عن كل ما سواه. al-Ghāniyy: He is the One who is self-sufficient, needing nothing, independent of everything.",
"المُغْنِي: هو معطي الغنى لعباده، يغني من يشاء غناه ويكفي من يشاء. al-Mughniyy: He is the One who grants wealth to His servants, enriching whomever He wills and sufficing whomever He wills.",
"الْمُعْطِي المانع*: هو الذي أعطى كل شيء، ويمنع العطاء عن من يشاء ابتلاء أو حماية. Al-Muti al-Māniʿ. The Giver and the Withholder*: He is the One who gives everything and withholds giving from whomever He wills as a test or protection.",
"الضَّارُ النَّافِعُ: هو الذي يقدر الضر والنفع لمن يشاء حسب حكمته. aḍ-Ḍār an-Nāfiʿ: He is the One who decrees harm and benefit for whomever He wills according to His wisdom.",
"النُّورُ: هو الهادي الذي ينير القلوب بنوره، والظاهر بذاته المظهر لغيره. an-Nūr: He is the One who guides and illuminates hearts with His light, manifest in Himself and manifester of others.",
"الهَادِي: هو الذي يهدي خلقه إلى الحق ويرشد القلوب إلى معرفته. al-Hādī: He is the One who guides His creation to truth and directs hearts to His knowledge.",
"البَدِيعُ: هو الذي أبدع الخلق بلا مثال سابق، المتفرد بصفاته. al-Badīʿ: He is the One who originated creation without precedent and is unique in His attributes.",
"البَاقِي: هو الدائم البقاء، الذي لا يعتريه فناء ولا زوال. al-Bāqī: He is the One who endures forever, unaffected by perishing or ceasing.",
"الوَارِثُ: هو الذي يبقى بعد فناء الخلق، ويرث الأرض ومن عليها. al-Wāriṯ: He is the One who remains after creation perishes, inheriting the earth and all upon it.",
"الرَّشِيدُ: هو الذي يرشد عباده إلى مصالحهم ويهديهم إلى الصواب بحكمته. ar-Rashīd: He is the One who guides His servants to their interests and directs them to the right path with His wisdom.",
"الصَّبُورُ: هو الذي لا يعاجل بالعقوبة، بل يحلم ويؤخر ويمهل عباده. aṣ-Ṣabūr: He is the One who does not hasten to punish, but is forbearing, delays, and grants respite to His servants."
];
let explanation
let colors = ["#f9ec00", "#f47920", "#e21d3c", "#583f99", "#9a258f", "#17479e", "#00addc", "#ed1846", "#ffffff"];
let selectedSymbols = [];
let selectedColors = [];
let btn;
let inpt; //holds the textbox
let name; //will hold the chosen name
function preload(){
actualintrobg = loadImage("bgall1.png")
introbg = loadImage("m_bg1i.png")
secondbg = loadImage("m_bg1.png")
thirdbg = loadImage("m_bg1g.png")
}
function setup() {
createCanvas(450, 450);
textAlign(CENTER, CENTER);
textSize(27);
rectMode(CENTER)
inpt = createElement("textarea")
document.querySelector('textarea').value = "How have you been feeling, and why have you been feeling that way? Also, what are you trying to summon or invoke in to your life because of how you’ve been feeling? ";
// Button for generating a new Sudoku
btn = createButton('Invoke Allah');
// btn.position(width/2 - 100, height - 130);
btn.mousePressed(generateNewSudoku);
}
function draw(){
if(scene == 0){
inpt.hide()
btn.hide()
image(actualintrobg, 0, 0, 450, 450)
fill("#e0e0e0")
stroke(255)
strokeWeight(2)
textSize(14.5)
text("This work invokes the power of Allah through his names for protection. Example: Since the 7th of October of last year, I have not felt normal within my body. That’s more than a year now. But what’s not feeling normal against the literal starvation, homelessness, destruction and death of Palestinians? I’m invoking Allah and his name Almuntaqim to avenge the oppressed against the criminals, Ar-Rahman and Ar-Raheem to surround the oppressed with the compassion that they’re obviously ain’t getting from other humans.", width/2, height/2, 350, 400)
//noStroke()
rect(width-25, height/2, 50, 50)
// rect(25, height/2, 50, 50)
}
else if(scene == 1){
inpt.show()
btn.show()
image(introbg, 0, 0, 450, 450)
fill(255)
noStroke()
// rect(width-25, height/2, 50, 50)
rect(25, height/2, 50, 50)
} else if(scene == 2){
image(secondbg, 0, 0, 450, 450)
fill(255)
noStroke()
rect(width-25, height/2, 50, 50)
rect(25, height/2, 50, 50)
drawSudoku();
} else if(scene == 3){
image(thirdbg, 0, 0, 450, 450)
fill(255)
// noStroke()
rect(width-25, height/2, 50, 50)
rect(25, height/2, 50, 50)
fill('#ffaee2')
rect(width/2, height/2, 300, 300)
fill('#b8eea4')
text(explanation, width/2, height/2, 300, 300)
// textSize(18)
stroke(255)
strokeWeight(1)
}
}
function mousePressed(){
if(scene == 0 && dist(mouseX, mouseY, width-25, height/2) < 25){
scene = 1
}
else if(scene == 1 && dist(mouseX, mouseY, 25, height/2) < 25){
scene = 0
} else if(scene == 2 && dist(mouseX, mouseY, 25, height/2) < 25){
scene = 1
btn.show()
inpt.show()
} else if(scene == 2 && dist(mouseX, mouseY, width-25, height/2) < 25){
scene = 3
} else if(scene == 3 && dist(mouseX, mouseY, 25, height/2) < 25){
scene = 2
} else if(scene == 3 && dist(mouseX, mouseY, width-25, height/2) < 25){
scene = 0
btn.show()
inpt.show()
}
}
function generateNewSudoku() {
btn.hide();
inpt.hide();
name = random(names); //choosing a 'random'
explanation = explanations[names.indexOf(name)]
selectedSymbols = shuffle(symbols).slice(0, 9); // Pick 9 random symbols
selectedColors = shuffle(colors).slice(0, 9); // Pick 9 random colors
sudokuGrid = generateSolvedSudoku(); // Generate a new solved grid
scene = 2
}
function drawSudoku() {
fill(0);
rect(width/2, height/2, 300, 300 )
textSize(18)
for (let row = 0; row < 9; row++) {
for (let col = 0; col < 9; col++) {
// make sudoku smaller or bigger
let x = col * 31.5;
let y = row * 31.5;
let num = sudokuGrid[row][col];
fill(selectedColors[num - 1]);
if(selectedSymbols[num-1] == "ﷲ"){
// textSize(81)
// noFill()
// circle(x+100, y+100, 81, 81)
textSize(81)
x = col * 50;
y = row * 50;
text(name, x+20.5, y+20.5)
} else {
stroke(0)
strokeWeight(0.5)
textSize(18)
text(selectedSymbols[num - 1], x + 100, y + 100);
}
}
}
}
function generateSolvedSudoku() {
// Initialize empty 9x9 grid
let grid = Array.from({ length: 9 }, () => Array(9).fill(0));
// Fill the diagonal 3x3 blocks
for (let i = 0; i < 9; i += 3) fillDiagonalBlock(grid, i, i);
// Backtrack to fill the entire grid
solveSudoku(grid);
return grid;
}
function fillDiagonalBlock(grid, row, col) {
let nums = shuffle([1, 2, 3, 4, 5, 6, 7, 8, 9]);
for (let i = 0; i < 3; i++) {
for (let j = 0; j < 3; j++) {
grid[row + i][col + j] = nums.pop();
}
}
}
function solveSudoku(grid) {
let emptyPos = findEmpty(grid);
if (!emptyPos) return true; // Solved
let [row, col] = emptyPos;
for (let num = 1; num <= 9; num++) {
if (isSafe(grid, row, col, num)) {
grid[row][col] = num;
if (solveSudoku(grid)) return true;
grid[row][col] = 0; // Backtrack
}
}
return false;
}
function findEmpty(grid) {
for (let i = 0; i < 9; i++) {
for (let j = 0; j < 9; j++) {
if (grid[i][j] === 0) return [i, j];
}
}
return null;
}
function isSafe(grid, row, col, num) {
for (let x = 0; x < 9; x++) {
if (grid[row][x] === num || grid[x][col] === num) return false;
}
let startRow = row - row % 3, startCol = col - col % 3;
for (let i = 0; i < 3; i++) {
for (let j = 0; j < 3; j++) {
if (grid[i + startRow][j + startCol] === num) return false;
}
}
return true;
}