Code Sketch


Bixuu02 harrypotter part-6
By: Mhalsakant School
Category: Programming
//> using platform jvm
//> using jvm 17

import javax.swing._
import javax.swing.event._
import java.awt._
import java.awt.event._

object HarryPotterPart6App {

  def main(args: Array[String]): Unit = {

    SwingUtilities.invokeLater(new Runnable {
      def run(): Unit = {

        // 1. SECURITY VERIFICATION
        val correctPassword = "Bixuu02_anime"
        val userInput = JOptionPane.showInputDialog(
          null,
          "? HARRY POTTER SECURITY VERIFICATION (PART 6)\n\nPlease enter Password to access Harry Potter Part 6 Story:",
          "Harry Potter Part 6 Access",
          JOptionPane.QUESTION_MESSAGE
        )

        if (userInput == null || userInput != correctPassword) {
          JOptionPane.showMessageDialog(
            null,
            "? Access Denied! Incorrect Password.",
            "Error",
            JOptionPane.ERROR_MESSAGE
          )
          sys.exit(0)
        }

        // 2. STORY DATA (HARRY POTTER PART 6 - EPISODES 1 TO 20 in Hindi & English)
        val storyData: Map[String, String] = Map(
          "Chapter 1: The Unbreakable Vow" ->
            """==================================================
              |HARRY POTTER PART 6: THE HALF-BLOOD PRINCE
              |Written & Adapted by Bixuu (Hindi & English Mix)
              |==================================================
              |
              |MAIN CHARACTERS:
              | - Harry Potter (The Chosen One)
              | - Professor Albus Dumbledore & Severus Snape
              | - Draco Malfoy & Horace Slughorn
              | - Ron Weasley & Hermione Granger
              |
              |CHAPTER 1 STORY & DIALOGUES:
              |Story ki shuruat mein Narcissa Malfoy aur Bellatrix Lestrange Severus Snape ke ghar Spinner's End jati hain. Draco Malfoy ko ek khatarnak mission diya gaya hai, aur Narcissa Snape se ek 'Unbreakable Vow' (ek aisi kasam jise todne par maut ho jati hai) lene ko kehti hai ki wo Draco ki raksha karega agar wo fail ho gaya.
              |
              |Snape: "I will do it. I will watch over him."
              |===================================================""".stripMargin,

          "Chapter 2: Spinner's End & Dumbledore's Visit" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |CHAPTER 2 STORY & DIALOGUES:
              |Dumbledore khud Harry ko Privet Drive se lene aate hain. Raste mein wo Horace Slughorn ko wapas Hogwarts ke potions teacher ke roop mein join karane ke liye ek chhote se gaon rukte hain.
              |
              |Dumbledore: "Harry, ab aane wala samay bohot aasan nahi hoga... tayar rehna."
              |===================================================""".stripMargin,

          "Chapter 3: The Slug Club Invitation" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |CHAPTER 3 STORY & DIALOGUES:
              |Hogwarts Express mein Slughorn apne pasandida aur talented students ka ek group banata hai jise 'Slug Club' kehte hain. Harry aur Hermione ko bhi isme invite kiya jata hai, jabki Ron ko bahar chhod diya jata hai. Train mein Harry Invisibility Cloak pehkar Draco ki baatein sunne ki koshish karta hai, par Draco use pakad kar nose tod deta hai.
              |
              |Tonks (Heal karte hue): "Next time dhyan rakhna, Harry."
              |===================================================""".stripMargin,

          "Chapter 4: Horace Slughorn's Potions Class" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |CHAPTER 4 STORY & DIALOGUES:
              |Pehli potions class mein Slughorn ek choti si sheeshi mein 'Felix Felices' (Liquid Luck) naam ka potion dikhata hai jo jo jeetne wale student ko inaam mein diya jayega. Harry ko ek purani potions book milti hai jispar 'The Half-Blood Prince' likha hota hai. Us book ke handwritten tips se Harry class mein top kar jata hai.
              |
              |Snape: "Is book ke nuskhe magic mein kamaal kar rahe hain..."
              |===================================================""".stripMargin,

          "Chapter 5: Weasleys' Wizard Wheezes" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |CHAPTER 5 STORY & DIALOGUES:
              |Diagon Alley mein Fred aur George ki nayi joke shop?'Weasleys' Wizard Wheezes'?bohot zordar chal rahi hoti hai. Wahan Harry dekhta hai ki Draco Malfoy chupke se ek dark shop 'Borgin and Burkes' mein jata hai aur kuch ajeeb cheez kharidi hai.
              |
              |Harry: "Draco koi dangerous plan bana raha hai, mujhe shaq hai!"
              |===================================================""".stripMargin,

          "Chapter 6: The Pensieve Lessons Begin" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |CHAPTER 6 STORY & DIALOGUES:
              |Dumbledore apne office mein Harry ko Pensieve ke zariye Voldemort (Tom Riddle) ke past ki yaadein dikhana shuru karte hain. Wo pehli yaad ek orphanage ki dikhate hain jahan chota Tom Riddle dusre bachcho par control karta tha.
              |
              |Dumbledore: "Kismat ko samajhne ke liye, pehle uske past ko samajhna padta hai."
              |===================================================""".stripMargin,

          "Chapter 7: Quidditch Tryouts & Romilda Vane" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |CHAPTER 7 STORY & DIALOGUES:
              |Harry Gryffindor Quidditch team ka captain ban jata hai aur nayi team select karta hai. Romilda Vane naam ki student Harry ko ek love potion wala chocolate dena chahti hai, par galati se Ron wo kha leta hai aur pagal ho kar Hermione ke peeche pad jata hai.
              |
              |Ron (Pyar mein doobte hue): "Hermione... you're so beautiful!"
              |===================================================""".stripMargin,

          "Chapter 8: Ron's Accidental Poisoning" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |CHAPTER 8 STORY & DIALOGUES:
              |Jab Harry Ron ko Slughorn ke paas ilaaj ke liye le jata hai, toh Slughorn ek mehal-jaisi meethi wine offer karta hai. Ron jaise hi use peeta hai, wo zahar ki wajah se behosh hokar girne lagta hai. Harry turant 'Half-Blood Prince' ki book se ek counter-potion dhoond kar Ron ki jaan bachata hai.
              |
              |Slughorn: "My god! Ye mead poisoned thi!"
              |===================================================""".stripMargin,

          "Chapter 9: The Memories of Tom Riddle" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |CHAPTER 9 STORY & DIALOGUES:
              |Dumbledore aur Harry Slughorn ki ek aisi yaad dhoondte hain jismein Slughorn ne Tom Riddle ko 'Horcruxes' (apni aatma ke tukde alag-alag cheezon mein chhupane ki dark art) ke baare mein bataya tha. Slughorn wo yaad chupaye baitha hota hai.
              |
              |Harry: "Sir, mujhe wo asli yaad Slughorn se nikalni hi hogi!"
              |===================================================""".stripMargin,

          "Chapter 10: Sectumsempra Spell Discovery" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |CHAPTER 10 STORY & DIALOGUES:
              |Bathroom mein Draco Malfoy aur Harry ke beech bhayanak ladai ho jati hai. Gusse mein Harry Half-Blood Prince ki book ka ek naya aur anjaan spell use karta hai?'Sectumsempra'. Is spell se Draco ke badan par gehre zakhm ho jate hain aur khoon behne lagta hai. Theek waqt par Snape aakar Draco ki jaan bachata hai.
              |
              |Snape (Gusse mein): "Tumne ek dark spell use kiya hai, Potter! Meri book mujhe wapas do!"
              |===================================================""".stripMargin,

          "Chapter 11: Using the Liquid Luck (Felix Felices)" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |CHAPTER 11 STORY & DIALOGUES:
              |Felix Felices (Liquid Luck) pehkar Harry Slughorn ki asli yaad hasil karne ke liye Hagrid ke ghar jata hai. Wahan Aragog (giant spider) ki maut par sabhi ro rahe hote hain. Luck ki wajah se Harry aur Slughorn wahi baith kar wo purani yaad share kar lete hain.
              |
              |Slughorn: "Horcruxes... ye dark magic ki sabse buri sriman hai."
              |===================================================""".stripMargin,

          "Chapter 12: The Secret of the Horcruxes" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |CHAPTER 12 STORY & DIALOGUES:
              |Pensieve mein yaad dekhne ke baad Dumbledore batate hain ki Voldemort ne apni aatma ke 7 tukde kiye hain (jinme se diary aur ring destroy ho chuke hain, aur baaki 5 abhi bhi dhoondne hain). Harry aur Dumbledore ek naye Horcrux ko destroy karne ke liye nikalte hain.
              |
              |Dumbledore: "Ab hum sach ki bilkul qareeb hain, Harry."
              |===================================================""".stripMargin,

          "Chapter 13: Journey to the Sea Cave" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |CHAPTER 13 STORY & DIALOGUES:
              |Harry aur Dumbledore ek aisi samundari gufa (Sea Cave) mein pahunchte hain jahan ek khatarnak pani ke andar chhupta hua locket (Horcrux) rakha hota hai. Wahan pahunchne ke liye ek choti boat mein jana padta hai.
              |
              |Harry: "Ye jagah bohot bhayankar hai, sir."
              |===================================================""".stripMargin,

          "Chapter 14: Drinking the Poison" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |CHAPTER 14 STORY & DIALOGUES:
              |Locket ko paane ke liye Dumbledore ko ek ajeeb zehreela pani peena padta hai jo unhe darawane halwa aur dard mein daal deta hai. Harry dard se rote hue Dumbledore ko sambhalta hai aur locket apne haath mein le leta hai.
              |
              |Dumbledore (Kamzor aawaz mein): "Harry... mujhe pani do..."
              |===================================================""".stripMargin,

          "Chapter 15: Inferi Attack in the Cave" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |CHAPTER 15 STORY & DIALOGUES:
              |Jaise hi Harry locket nikalta hai, pani ke andar se 'Inferi' (mare hue insaanon ki sena) bahar nikal kar Harry aur Dumbledore par hamla kar deti hain. Harry apne spells se unhe rokne ki poori koshish karta hai.
              |
              |Dumbledore apni aakhri taakat se aag ka ek bada sa gola (Firestorm) banakar sabhi Inferi ko bhaga dete hain.
              |===================================================""".stripMargin,

          "Chapter 16: Return to Hogwarts Astronomy Tower" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |CHAPTER 16 STORY & DIALOGUES:
              |Jab wo dono Hogwarts lautte hain, toh Astronomy Tower par Death Eaters pehle se hi pahunch chuke hote hain. Draco Malfoy aakar Dumbledore ko gher leta hai, par wo dar ki wajah se mar nahi pata.
              |
              |Draco: "Main yeh nahi kar sakta... mujhe karni hi padegi!"
              |===================================================""".stripMargin,

          "Chapter 17: Severus Snape's Betrayal" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |CHAPTER 17 STORY & DIALOGUES:
              |Theek waqt par Severus Snape tower par aata hai. Dumbledore "Severus... please..." kehte hain, aur Snape bina kisi jhijk ke apni wand se ek killing spell (Avada Kedavra) Dumbledore par chala deta hai. Dumbledore tower se niche gir kar mar jate hain.
              |
              |Harry (Gusse aur dard se cheekhte hue): "Avada Kedavra!" (Snape par hamla karta hai, par Snape easily rok deta hai.)
              |===================================================""".stripMargin,

          "Chapter 18: The Flight of the Half-Blood Prince" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |CHAPTER 18 STORY & DIALOGUES:
              |Snape school se bhaagte waqt kehta hai: "Main hi wohi Half-Blood Prince hoon!" Harry yeh sunkar sann reh jata hai. Poore school mein shok ki lehar daud padti hai aur sabhi Dumbledore ki laash ke samne apni wand upar karke unhe samman dete hain.
              |
              |McGonagall: "Dumbledore ab nahi rahe..."
              |===================================================""".stripMargin,

          "Chapter 19: Discovering the Fake Locket" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |CHAPTER 19 STORY & DIALOGUES:
              |Jab Harry us locket ko kholta hai jo unhone cave se laya tha, toh pata chalta hai ki wo asli Horcrux nahi hai. Usme ek choti si parchi milti hai jispar 'R.A.B.' ke initials likhe hote hain, jiska matlab hai ki kisi ne asli locket pehle hi chura liya tha.
              |
              |Harry: "Humne itni mehnat ki, par ye nakli hai!"
              |===================================================""".stripMargin,

          "Chapter 20: Part 6 Grand Finale & Epilogue" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |CHAPTER 20 STORY & DIALOGUES (PART 6 FINALE):
              |Term khatam hone par Harry school wapas nahi jane ka faisla karta hai. Wo Ron aur Hermione ke sath milkar baki ke Horcruxes ko dhoondne aur Voldemort ko hamesha ke liye khatam karne ke safar par nikalne ka sankalp leta hai.
              |
              |Harry: "Hum akele nahi hain... hum is ladai ko jeet kar rahenge."
              |
              |THE END - HARRY POTTER PART 6 WRITTEN & ADAPTED BY BIXUU.
              |==================================================
              |
              |? ANNOUNCEMENT FROM CREATOR BIXUU:
              |"BIXUU SUCCESSFULLY CREATED HARRY POTTER PART 6 (THE HALF-BLOOD PRINCE)! 
              |Stay tuned for the grand finale Part 7!"
              |===================================================""".stripMargin
        )

        // 3. GUI WINDOW CREATION
        val frame = new JFrame("Harry Potter Viewer: HARRY POTTER PART 6 - By Bixuu")
        frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE)
        frame.setSize(950, 650)
        frame.setLocationRelativeTo(null)

        // Header Theme Color (Wizarding Dark Maroon & Gold)
        val headerLabel = new JLabel("  ? HARRY POTTER PART 6: THE HALF-BLOOD PRINCE (Adapted by Bixuu)  ", SwingConstants.CENTER)
        headerLabel.setFont(new Font("Arial", Font.BOLD, 14))
        headerLabel.setOpaque(true)
        headerLabel.setBackground(new Color(40, 10, 10))
        headerLabel.setForeground(Color.WHITE)
        headerLabel.setPreferredSize(new Dimension(950, 40))

        // Chapter List
        val chapterKeys = (1 to 20).map(i => storyData.keys.find(_.startsWith(s"Chapter $i:")).getOrElse(s"Chapter $i")).toArray
        val listModel = new DefaultListModel[String]()
        chapterKeys.foreach(listModel.addElement)

        val chapterList = new JList[String](listModel)
        chapterList.setFont(new Font("Arial", Font.PLAIN, 12))
        chapterList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION)
        chapterList.setSelectedIndex(0)

        val listScrollPane = new JScrollPane(chapterList)
        listScrollPane.setPreferredSize(new Dimension(320, 500))

        // Story Text Area
        val storyArea = new JTextArea()
        storyArea.setFont(new Font("Monospaced", Font.PLAIN, 13))
        storyArea.setEditable(false)
        storyArea.setLineWrap(true)
        storyArea.setWrapStyleWord(true)
        storyArea.setBackground(new Color(20, 20, 20))
        storyArea.setForeground(new Color(230, 230, 230))
        storyArea.setText(storyData(chapterKeys(0)))
        storyArea.setCaretPosition(0)

        val textScrollPane = new JScrollPane(storyArea)

        // Selection Listener
        chapterList.addListSelectionListener(new ListSelectionListener {
          def valueChanged(e: ListSelectionEvent): Unit = {
            if (!e.getValueIsAdjusting) {
              val selectedKey = chapterList.getSelectedValue
              if (selectedKey != null && storyData.contains(selectedKey)) {
                storyArea.setText(storyData(selectedKey))
                storyArea.setCaretPosition(0)
              }
            }
          }
        })

        // Layout Assembly
        val mainPanel = new JPanel(new BorderLayout())
        mainPanel.add(headerLabel, BorderLayout.NORTH)
        mainPanel.add(listScrollPane, BorderLayout.WEST)
        mainPanel.add(textScrollPane, BorderLayout.CENTER)

        frame.add(mainPanel)
        frame.setVisible(true)
      }
    })
  }
}

HarryPotterPart6App.main(Array())