diff options
| author | RogueAI42 <[email protected]> | 2017-06-17 19:16:50 +1000 |
|---|---|---|
| committer | RogueAI42 <[email protected]> | 2017-06-17 19:16:50 +1000 |
| commit | dbf794c9849c0046cf2e93a878c6d8d9101d2fc8 (patch) | |
| tree | d5ff20daf283fff179f0ddb79b07edafd59c613a /ShiftOS.WinForms/ShiftnetSites | |
| parent | 77cb4a9a14de07023e86a9a5cda7171fcb4ec8ec (diff) | |
| download | shiftos_thereturn-dbf794c9849c0046cf2e93a878c6d8d9101d2fc8.tar.gz shiftos_thereturn-dbf794c9849c0046cf2e93a878c6d8d9101d2fc8.tar.bz2 shiftos_thereturn-dbf794c9849c0046cf2e93a878c6d8d9101d2fc8.zip | |
MindBlow: Brainfuck IDE for ShiftOS
For 50,000 Codepoints you can write and run Brainfuck programs in
a dedicated IDE. Check out the site on "shiftnet/mindblow".
The IDE seems to be working perfectly. The site has some theming
issues.
Diffstat (limited to 'ShiftOS.WinForms/ShiftnetSites')
| -rw-r--r-- | ShiftOS.WinForms/ShiftnetSites/MindBlow.Designer.cs | 192 | ||||
| -rw-r--r-- | ShiftOS.WinForms/ShiftnetSites/MindBlow.cs | 74 | ||||
| -rw-r--r-- | ShiftOS.WinForms/ShiftnetSites/MindBlow.resx | 145 |
3 files changed, 411 insertions, 0 deletions
diff --git a/ShiftOS.WinForms/ShiftnetSites/MindBlow.Designer.cs b/ShiftOS.WinForms/ShiftnetSites/MindBlow.Designer.cs new file mode 100644 index 0000000..fce1f14 --- /dev/null +++ b/ShiftOS.WinForms/ShiftnetSites/MindBlow.Designer.cs @@ -0,0 +1,192 @@ +namespace ShiftOS.WinForms.ShiftnetSites +{ + partial class MindBlow + { + /// <summary> + /// Required designer variable. + /// </summary> + private System.ComponentModel.IContainer components = null; + + /// <summary> + /// Clean up any resources being used. + /// </summary> + /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MindBlow)); + this.nav = new System.Windows.Forms.Panel(); + this.title = new System.Windows.Forms.Label(); + this.aboutpnl = new System.Windows.Forms.Panel(); + this.label1 = new System.Windows.Forms.Label(); + this.buybtn = new System.Windows.Forms.Button(); + this.label2 = new System.Windows.Forms.Label(); + this.aboutbtn = new System.Windows.Forms.LinkLabel(); + this.tutorialpnl = new System.Windows.Forms.Panel(); + this.label3 = new System.Windows.Forms.Label(); + this.tutorialbtn = new System.Windows.Forms.LinkLabel(); + this.pictureBox1 = new System.Windows.Forms.PictureBox(); + this.nav.SuspendLayout(); + this.aboutpnl.SuspendLayout(); + this.tutorialpnl.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); + this.SuspendLayout(); + // + // nav + // + this.nav.Controls.Add(this.tutorialbtn); + this.nav.Controls.Add(this.aboutbtn); + this.nav.Controls.Add(this.title); + this.nav.Dock = System.Windows.Forms.DockStyle.Left; + this.nav.Location = new System.Drawing.Point(0, 0); + this.nav.Name = "nav"; + this.nav.Size = new System.Drawing.Size(200, 470); + this.nav.TabIndex = 0; + // + // title + // + this.title.AutoSize = true; + this.title.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.title.Location = new System.Drawing.Point(3, 0); + this.title.Name = "title"; + this.title.Size = new System.Drawing.Size(101, 24); + this.title.TabIndex = 0; + this.title.Text = "MindBlow"; + // + // aboutpnl + // + this.aboutpnl.Controls.Add(this.pictureBox1); + this.aboutpnl.Controls.Add(this.label2); + this.aboutpnl.Controls.Add(this.buybtn); + this.aboutpnl.Controls.Add(this.label1); + this.aboutpnl.Location = new System.Drawing.Point(206, 0); + this.aboutpnl.Name = "aboutpnl"; + this.aboutpnl.Size = new System.Drawing.Size(512, 470); + this.aboutpnl.TabIndex = 1; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(3, 8); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(313, 65); + this.label1.TabIndex = 0; + this.label1.Text = resources.GetString("label1.Text"); + // + // buybtn + // + this.buybtn.Location = new System.Drawing.Point(6, 76); + this.buybtn.Name = "buybtn"; + this.buybtn.Size = new System.Drawing.Size(75, 23); + this.buybtn.TabIndex = 1; + this.buybtn.Text = "Buy Now"; + this.buybtn.UseVisualStyleBackColor = true; + this.buybtn.Click += new System.EventHandler(this.buybtn_Click); + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(87, 81); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(132, 13); + this.label2.TabIndex = 2; + this.label2.Text = "(Price: 50,000 Codepoints)"; + // + // aboutbtn + // + this.aboutbtn.AutoSize = true; + this.aboutbtn.Location = new System.Drawing.Point(4, 24); + this.aboutbtn.Name = "aboutbtn"; + this.aboutbtn.Size = new System.Drawing.Size(85, 13); + this.aboutbtn.TabIndex = 1; + this.aboutbtn.TabStop = true; + this.aboutbtn.Text = "About/Purchase"; + this.aboutbtn.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.aboutbtn_LinkClicked); + // + // tutorialpnl + // + this.tutorialpnl.Controls.Add(this.label3); + this.tutorialpnl.Location = new System.Drawing.Point(209, 0); + this.tutorialpnl.Name = "tutorialpnl"; + this.tutorialpnl.Size = new System.Drawing.Size(506, 467); + this.tutorialpnl.TabIndex = 2; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(3, 8); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(375, 208); + this.label3.TabIndex = 0; + this.label3.Text = resources.GetString("label3.Text"); + // + // tutorialbtn + // + this.tutorialbtn.AutoSize = true; + this.tutorialbtn.Location = new System.Drawing.Point(4, 37); + this.tutorialbtn.Name = "tutorialbtn"; + this.tutorialbtn.Size = new System.Drawing.Size(35, 13); + this.tutorialbtn.TabIndex = 2; + this.tutorialbtn.TabStop = true; + this.tutorialbtn.Text = "Guide"; + this.tutorialbtn.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.tutorialbtn_LinkClicked); + // + // pictureBox1 + // + this.pictureBox1.Image = global::ShiftOS.WinForms.Properties.Resources.mindblow; + this.pictureBox1.Location = new System.Drawing.Point(6, 105); + this.pictureBox1.Name = "pictureBox1"; + this.pictureBox1.Size = new System.Drawing.Size(390, 295); + this.pictureBox1.TabIndex = 3; + this.pictureBox1.TabStop = false; + // + // MindBlow + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.aboutpnl); + this.Controls.Add(this.tutorialpnl); + this.Controls.Add(this.nav); + this.Name = "MindBlow"; + this.Size = new System.Drawing.Size(718, 470); + this.Resize += new System.EventHandler(this.MindBlow_Resize); + this.nav.ResumeLayout(false); + this.nav.PerformLayout(); + this.aboutpnl.ResumeLayout(false); + this.aboutpnl.PerformLayout(); + this.tutorialpnl.ResumeLayout(false); + this.tutorialpnl.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Panel nav; + private System.Windows.Forms.Label title; + private System.Windows.Forms.Panel aboutpnl; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Button buybtn; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.LinkLabel aboutbtn; + private System.Windows.Forms.Panel tutorialpnl; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.LinkLabel tutorialbtn; + private System.Windows.Forms.PictureBox pictureBox1; + } +} diff --git a/ShiftOS.WinForms/ShiftnetSites/MindBlow.cs b/ShiftOS.WinForms/ShiftnetSites/MindBlow.cs new file mode 100644 index 0000000..e5d035d --- /dev/null +++ b/ShiftOS.WinForms/ShiftnetSites/MindBlow.cs @@ -0,0 +1,74 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using ShiftOS.Engine; + +namespace ShiftOS.WinForms.ShiftnetSites +{ + [ShiftnetSite("shiftnet/mindblow", "MindBlow", "World's First IDE for ShiftOS")] + public partial class MindBlow : UserControl, IShiftnetSite + { + public MindBlow() + { + InitializeComponent(); + } + + public event Action<string> GoToUrl; + public event Action GoBack; + + private void DoLayout() + { + aboutpnl.Left = tutorialpnl.Left = nav.Width; + aboutpnl.Width = tutorialpnl.Width = Width - nav.Width; + tutorialpnl.Height = Height; + } + + private void aboutbtn_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) + { + aboutpnl.BringToFront(); + } + + private void tutorialbtn_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) + { + tutorialpnl.BringToFront(); + } + + private void MindBlow_Resize(object sender, EventArgs e) + { + DoLayout(); + } + + private void buybtn_Click(object sender, EventArgs e) + { + if (Shiftorium.UpgradeInstalled("mindblow")) + Infobox.Show("Already Purchased", "You have already bought MindBlow."); + else if (SaveSystem.CurrentSave.Codepoints < 50000) + Infobox.Show("Not Enough Codepoints", "You do not have enough Codepoints to buy MindBlow."); + else + { + Shiftorium.Buy("mindblow", 50000); + Infobox.Show("Installation Complete", "MindBlow has been successfully installed."); + } + } + + public void Setup() + { + DoLayout(); + aboutpnl.BringToFront(); + } + + public void OnSkinLoad() + { + } + + public void OnUpgrade() + { + } + } +} diff --git a/ShiftOS.WinForms/ShiftnetSites/MindBlow.resx b/ShiftOS.WinForms/ShiftnetSites/MindBlow.resx new file mode 100644 index 0000000..08ff93f --- /dev/null +++ b/ShiftOS.WinForms/ShiftnetSites/MindBlow.resx @@ -0,0 +1,145 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <data name="label1.Text" xml:space="preserve"> + <value>Ever wanted to make your own ShiftOS software? + +MindBlow is the world's first IDE designed specifically for ShiftOS. +It allows you to develop and run your own programs written in the +Brainfuck programming language.</value> + </data> + <data name="label3.Text" xml:space="preserve"> + <value>The Brainfuck programming language is simple to learn and use. +There are a total of 8 commands in the language: + +> Increment the memory pointer. +< Decrement the memory pointer. ++ Increment the number at the memory pointer. +- Decrement the number at the memory pointer. +. Print the ASCII value at the memory pointer. +, Get a character from the user and put its ASCII value at the memory pointer. +[ Jump to the next ']' if the number at the memory pointer is zero. +] Jump to the last '[' if the number at the memory pointer isn't zero. + +Any characters that aren't valid commands will be ignored. +Here is a simple program to read 10 characters from the user and display them: +++++++++++ +[->,.<]</value> + </data> +</root>
\ No newline at end of file |
