Collatz Paradox and it's visualization on graph
This commit is contained in:
parent
1c9a9b0e22
commit
84a5519395
22
Collatz/Collatz.sln
Normal file
22
Collatz/Collatz.sln
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
# Visual Studio 2013
|
||||||
|
VisualStudioVersion = 12.0.40629.0
|
||||||
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Collatz", "Collatz\Collatz.csproj", "{C9A91581-4384-496F-B8A4-27EC3F44BADF}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
Release|Any CPU = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{C9A91581-4384-496F-B8A4-27EC3F44BADF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{C9A91581-4384-496F-B8A4-27EC3F44BADF}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{C9A91581-4384-496F-B8A4-27EC3F44BADF}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{C9A91581-4384-496F-B8A4-27EC3F44BADF}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
||||||
BIN
Collatz/Collatz.v12.suo
Normal file
BIN
Collatz/Collatz.v12.suo
Normal file
Binary file not shown.
BIN
Collatz/Collatz/1458303124_Analytics_balls.ico
Normal file
BIN
Collatz/Collatz/1458303124_Analytics_balls.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 110 KiB |
6
Collatz/Collatz/App.config
Normal file
6
Collatz/Collatz/App.config
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<configuration>
|
||||||
|
<startup>
|
||||||
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
|
||||||
|
</startup>
|
||||||
|
</configuration>
|
||||||
143
Collatz/Collatz/Collatz.csproj
Normal file
143
Collatz/Collatz/Collatz.csproj
Normal file
@ -0,0 +1,143 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||||
|
<PropertyGroup>
|
||||||
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||||
|
<ProjectGuid>{C9A91581-4384-496F-B8A4-27EC3F44BADF}</ProjectGuid>
|
||||||
|
<OutputType>WinExe</OutputType>
|
||||||
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
|
<RootNamespace>Collatz</RootNamespace>
|
||||||
|
<AssemblyName>Collatz</AssemblyName>
|
||||||
|
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||||
|
<FileAlignment>512</FileAlignment>
|
||||||
|
<PublishUrl>publish\</PublishUrl>
|
||||||
|
<Install>true</Install>
|
||||||
|
<InstallFrom>Disk</InstallFrom>
|
||||||
|
<UpdateEnabled>false</UpdateEnabled>
|
||||||
|
<UpdateMode>Foreground</UpdateMode>
|
||||||
|
<UpdateInterval>7</UpdateInterval>
|
||||||
|
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||||
|
<UpdatePeriodically>false</UpdatePeriodically>
|
||||||
|
<UpdateRequired>false</UpdateRequired>
|
||||||
|
<MapFileExtensions>true</MapFileExtensions>
|
||||||
|
<ApplicationRevision>0</ApplicationRevision>
|
||||||
|
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||||
|
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||||
|
<UseApplicationTrust>false</UseApplicationTrust>
|
||||||
|
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<Optimize>false</Optimize>
|
||||||
|
<OutputPath>bin\Debug\</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<OutputPath>bin\Release\</OutputPath>
|
||||||
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<StartupObject>Collatz.Program</StartupObject>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<ApplicationIcon>1458303124_Analytics_balls.ico</ApplicationIcon>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="MetroFramework">
|
||||||
|
<HintPath>D:\Other\Libs\metroframework-modern-ui-master\MetroFramework.Fonts\bin\Debug\MetroFramework.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System" />
|
||||||
|
<Reference Include="System.Core" />
|
||||||
|
<Reference Include="System.Windows.Forms.DataVisualization" />
|
||||||
|
<Reference Include="System.Xml.Linq" />
|
||||||
|
<Reference Include="System.Data.DataSetExtensions" />
|
||||||
|
<Reference Include="Microsoft.CSharp" />
|
||||||
|
<Reference Include="System.Data" />
|
||||||
|
<Reference Include="System.Deployment" />
|
||||||
|
<Reference Include="System.Drawing" />
|
||||||
|
<Reference Include="System.Windows.Forms" />
|
||||||
|
<Reference Include="System.Xml" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="CollatzProblem.cs">
|
||||||
|
<SubType>Form</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="CollatzProblem.Designer.cs">
|
||||||
|
<DependentUpon>CollatzProblem.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Program.cs" />
|
||||||
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
<Compile Include="valuesDisplay.cs">
|
||||||
|
<SubType>Form</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="valuesDisplay.Designer.cs">
|
||||||
|
<DependentUpon>valuesDisplay.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<EmbeddedResource Include="CollatzProblem.resx">
|
||||||
|
<DependentUpon>CollatzProblem.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="Properties\Resources.resx">
|
||||||
|
<Generator>ResXFileCodeGenerator</Generator>
|
||||||
|
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<Compile Include="Properties\Resources.Designer.cs">
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DependentUpon>Resources.resx</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<EmbeddedResource Include="valuesDisplay.resx">
|
||||||
|
<DependentUpon>valuesDisplay.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<None Include="Properties\Settings.settings">
|
||||||
|
<Generator>SettingsSingleFileGenerator</Generator>
|
||||||
|
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||||
|
</None>
|
||||||
|
<Compile Include="Properties\Settings.Designer.cs">
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DependentUpon>Settings.settings</DependentUpon>
|
||||||
|
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||||
|
</Compile>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="App.config" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<BootstrapperPackage Include=".NETFramework,Version=v4.5">
|
||||||
|
<Visible>False</Visible>
|
||||||
|
<ProductName>Microsoft .NET Framework 4.5 %28x86 and x64%29</ProductName>
|
||||||
|
<Install>true</Install>
|
||||||
|
</BootstrapperPackage>
|
||||||
|
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
|
||||||
|
<Visible>False</Visible>
|
||||||
|
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
|
||||||
|
<Install>false</Install>
|
||||||
|
</BootstrapperPackage>
|
||||||
|
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
||||||
|
<Visible>False</Visible>
|
||||||
|
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
||||||
|
<Install>false</Install>
|
||||||
|
</BootstrapperPackage>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Content Include="1458303124_Analytics_balls.ico" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
|
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||||
|
Other similar extension points exist, see Microsoft.Common.targets.
|
||||||
|
<Target Name="BeforeBuild">
|
||||||
|
</Target>
|
||||||
|
<Target Name="AfterBuild">
|
||||||
|
</Target>
|
||||||
|
-->
|
||||||
|
</Project>
|
||||||
17
Collatz/Collatz/Collatz.csproj.user
Normal file
17
Collatz/Collatz/Collatz.csproj.user
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
|
||||||
|
<StartAction>Project</StartAction>
|
||||||
|
<EnableUnmanagedDebugging>true</EnableUnmanagedDebugging>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<PublishUrlHistory>publish\</PublishUrlHistory>
|
||||||
|
<InstallUrlHistory />
|
||||||
|
<SupportUrlHistory />
|
||||||
|
<UpdateUrlHistory />
|
||||||
|
<BootstrapperUrlHistory />
|
||||||
|
<ErrorReportUrlHistory />
|
||||||
|
<FallbackCulture>en-US</FallbackCulture>
|
||||||
|
<VerifyUploadedFiles>false</VerifyUploadedFiles>
|
||||||
|
</PropertyGroup>
|
||||||
|
</Project>
|
||||||
162
Collatz/Collatz/CollatzProblem.Designer.cs
generated
Normal file
162
Collatz/Collatz/CollatzProblem.Designer.cs
generated
Normal file
@ -0,0 +1,162 @@
|
|||||||
|
namespace Collatz
|
||||||
|
{
|
||||||
|
partial class CollatzProblem
|
||||||
|
{
|
||||||
|
/// <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 Windows Form 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.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
|
||||||
|
System.Windows.Forms.DataVisualization.Charting.Legend legend1 = new System.Windows.Forms.DataVisualization.Charting.Legend();
|
||||||
|
System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series();
|
||||||
|
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CollatzProblem));
|
||||||
|
this.collatzGraph = new System.Windows.Forms.DataVisualization.Charting.Chart();
|
||||||
|
this.textBox1 = new System.Windows.Forms.TextBox();
|
||||||
|
this.label1 = new System.Windows.Forms.Label();
|
||||||
|
this.button1 = new System.Windows.Forms.Button();
|
||||||
|
this.comboBox1 = new System.Windows.Forms.ComboBox();
|
||||||
|
this.label2 = new System.Windows.Forms.Label();
|
||||||
|
this.button2 = new System.Windows.Forms.Button();
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.collatzGraph)).BeginInit();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// collatzGraph
|
||||||
|
//
|
||||||
|
chartArea1.Name = "ChartArea1";
|
||||||
|
this.collatzGraph.ChartAreas.Add(chartArea1);
|
||||||
|
this.collatzGraph.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
legend1.Name = "Legend1";
|
||||||
|
this.collatzGraph.Legends.Add(legend1);
|
||||||
|
this.collatzGraph.Location = new System.Drawing.Point(0, 0);
|
||||||
|
this.collatzGraph.Name = "collatzGraph";
|
||||||
|
this.collatzGraph.Palette = System.Windows.Forms.DataVisualization.Charting.ChartColorPalette.Berry;
|
||||||
|
this.collatzGraph.PaletteCustomColors = new System.Drawing.Color[] {
|
||||||
|
System.Drawing.Color.Blue};
|
||||||
|
series1.ChartArea = "ChartArea1";
|
||||||
|
series1.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
|
||||||
|
series1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||||
|
series1.Legend = "Legend1";
|
||||||
|
series1.Name = "Collatz Paradox";
|
||||||
|
this.collatzGraph.Series.Add(series1);
|
||||||
|
this.collatzGraph.Size = new System.Drawing.Size(624, 441);
|
||||||
|
this.collatzGraph.TabIndex = 0;
|
||||||
|
this.collatzGraph.Text = "Collatz Problem Plot";
|
||||||
|
//
|
||||||
|
// textBox1
|
||||||
|
//
|
||||||
|
this.textBox1.Dock = System.Windows.Forms.DockStyle.Right;
|
||||||
|
this.textBox1.Location = new System.Drawing.Point(520, 0);
|
||||||
|
this.textBox1.Name = "textBox1";
|
||||||
|
this.textBox1.Size = new System.Drawing.Size(104, 20);
|
||||||
|
this.textBox1.TabIndex = 1;
|
||||||
|
this.textBox1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.textBox1_TextChanged);
|
||||||
|
//
|
||||||
|
// label1
|
||||||
|
//
|
||||||
|
this.label1.AutoSize = true;
|
||||||
|
this.label1.Dock = System.Windows.Forms.DockStyle.Right;
|
||||||
|
this.label1.Location = new System.Drawing.Point(496, 0);
|
||||||
|
this.label1.Name = "label1";
|
||||||
|
this.label1.Size = new System.Drawing.Size(24, 13);
|
||||||
|
this.label1.TabIndex = 2;
|
||||||
|
this.label1.Text = "x = ";
|
||||||
|
//
|
||||||
|
// button1
|
||||||
|
//
|
||||||
|
this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||||
|
this.button1.Location = new System.Drawing.Point(549, 386);
|
||||||
|
this.button1.Name = "button1";
|
||||||
|
this.button1.Size = new System.Drawing.Size(75, 23);
|
||||||
|
this.button1.TabIndex = 3;
|
||||||
|
this.button1.Text = "Get Values";
|
||||||
|
this.button1.UseVisualStyleBackColor = true;
|
||||||
|
this.button1.Click += new System.EventHandler(this.button1_Click);
|
||||||
|
//
|
||||||
|
// comboBox1
|
||||||
|
//
|
||||||
|
this.comboBox1.Anchor = System.Windows.Forms.AnchorStyles.Right;
|
||||||
|
this.comboBox1.FormattingEnabled = true;
|
||||||
|
this.comboBox1.Location = new System.Drawing.Point(503, 144);
|
||||||
|
this.comboBox1.Name = "comboBox1";
|
||||||
|
this.comboBox1.Size = new System.Drawing.Size(121, 21);
|
||||||
|
this.comboBox1.TabIndex = 4;
|
||||||
|
this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged);
|
||||||
|
//
|
||||||
|
// label2
|
||||||
|
//
|
||||||
|
this.label2.Anchor = System.Windows.Forms.AnchorStyles.Right;
|
||||||
|
this.label2.AutoSize = true;
|
||||||
|
this.label2.Location = new System.Drawing.Point(500, 128);
|
||||||
|
this.label2.Name = "label2";
|
||||||
|
this.label2.Size = new System.Drawing.Size(72, 13);
|
||||||
|
this.label2.TabIndex = 5;
|
||||||
|
this.label2.Text = "Graph Type : ";
|
||||||
|
//
|
||||||
|
// button2
|
||||||
|
//
|
||||||
|
this.button2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||||
|
this.button2.Location = new System.Drawing.Point(549, 415);
|
||||||
|
this.button2.Name = "button2";
|
||||||
|
this.button2.Size = new System.Drawing.Size(75, 23);
|
||||||
|
this.button2.TabIndex = 6;
|
||||||
|
this.button2.Text = "Clean Graph";
|
||||||
|
this.button2.UseVisualStyleBackColor = true;
|
||||||
|
this.button2.Click += new System.EventHandler(this.button2_Click);
|
||||||
|
//
|
||||||
|
// CollatzProblem
|
||||||
|
//
|
||||||
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.ClientSize = new System.Drawing.Size(624, 441);
|
||||||
|
this.Controls.Add(this.button2);
|
||||||
|
this.Controls.Add(this.label2);
|
||||||
|
this.Controls.Add(this.comboBox1);
|
||||||
|
this.Controls.Add(this.button1);
|
||||||
|
this.Controls.Add(this.label1);
|
||||||
|
this.Controls.Add(this.textBox1);
|
||||||
|
this.Controls.Add(this.collatzGraph);
|
||||||
|
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||||
|
this.Name = "CollatzProblem";
|
||||||
|
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||||
|
this.Text = "Collatz Paradox";
|
||||||
|
this.Load += new System.EventHandler(this.Form1_Load);
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.collatzGraph)).EndInit();
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
this.PerformLayout();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private System.Windows.Forms.DataVisualization.Charting.Chart collatzGraph;
|
||||||
|
private System.Windows.Forms.TextBox textBox1;
|
||||||
|
private System.Windows.Forms.Label label1;
|
||||||
|
private System.Windows.Forms.Button button1;
|
||||||
|
private System.Windows.Forms.ComboBox comboBox1;
|
||||||
|
private System.Windows.Forms.Label label2;
|
||||||
|
private System.Windows.Forms.Button button2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
146
Collatz/Collatz/CollatzProblem.cs
Normal file
146
Collatz/Collatz/CollatzProblem.cs
Normal file
@ -0,0 +1,146 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Data;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
|
||||||
|
namespace Collatz
|
||||||
|
{
|
||||||
|
public partial class CollatzProblem : Form
|
||||||
|
{
|
||||||
|
Int64 x = 2;
|
||||||
|
List<Int64> values = null;
|
||||||
|
valuesDisplay vD = null;
|
||||||
|
int dialogs = 0;
|
||||||
|
int seriesIndex = 0;
|
||||||
|
|
||||||
|
public CollatzProblem(Int64 x)
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
|
||||||
|
if (x > 0)
|
||||||
|
this.x = x;
|
||||||
|
|
||||||
|
this.WindowState = FormWindowState.Maximized;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void setupComboBox()
|
||||||
|
{
|
||||||
|
comboBox1.DataSource = Enum.GetValues(typeof(System.Windows.Forms.DataVisualization.Charting.SeriesChartType));
|
||||||
|
|
||||||
|
comboBox1.SelectedIndex = 3;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private Int64 collatzFunc(Int64 m)
|
||||||
|
{
|
||||||
|
Int64 n = m;
|
||||||
|
|
||||||
|
if (n % 2 == 0)
|
||||||
|
n /= 2;
|
||||||
|
else
|
||||||
|
n = 3 * n + 1;
|
||||||
|
|
||||||
|
return n;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setupChart()
|
||||||
|
{
|
||||||
|
cleanChart();
|
||||||
|
|
||||||
|
collatzGraph.Series[seriesIndex].BorderWidth = 3;
|
||||||
|
collatzGraph.Series[seriesIndex].Name = "Collatz Paradox for \n x = " + x.ToString();
|
||||||
|
|
||||||
|
collatzGraph.ChartAreas[seriesIndex].AxisY.ScaleView.Zoom(0, 25);
|
||||||
|
collatzGraph.ChartAreas[seriesIndex].AxisX.ScaleView.Zoom(0, 25);
|
||||||
|
|
||||||
|
collatzGraph.ChartAreas[seriesIndex].CursorX.IsUserEnabled = true;
|
||||||
|
collatzGraph.ChartAreas[seriesIndex].CursorX.IsUserSelectionEnabled = true;
|
||||||
|
|
||||||
|
collatzGraph.ChartAreas[seriesIndex].CursorY.IsUserEnabled = true;
|
||||||
|
collatzGraph.ChartAreas[0].CursorY.IsUserSelectionEnabled = true;
|
||||||
|
|
||||||
|
collatzGraph.ChartAreas[seriesIndex].AxisX.ScaleView.Zoomable = true;
|
||||||
|
collatzGraph.ChartAreas[seriesIndex].AxisY.ScaleView.Zoomable = true;
|
||||||
|
|
||||||
|
values = new List<Int64>();
|
||||||
|
|
||||||
|
Int64 n = x;
|
||||||
|
Int64 i = 0;
|
||||||
|
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
values.Add(n);
|
||||||
|
if (n == 1)
|
||||||
|
{
|
||||||
|
collatzGraph.Series[seriesIndex].Points.AddXY(i, n);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
collatzGraph.Series[seriesIndex].Points.AddXY(i, n);
|
||||||
|
|
||||||
|
n = collatzFunc(n);
|
||||||
|
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
collatzGraph.Series[seriesIndex].Name += "\nNo. of steps to converge at 1 are " + i.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Form1_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
setupComboBox();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void textBox1_TextChanged(object sender, KeyEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.KeyData == Keys.Enter)
|
||||||
|
{
|
||||||
|
if (Int64.Parse(textBox1.Text) > 1)
|
||||||
|
{
|
||||||
|
this.x = int.Parse(textBox1.Text);
|
||||||
|
setupChart();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
MessageBox.Show("Error!!! Enter a Positive Int64eger...");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void button1_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (dialogs == 0)
|
||||||
|
dialogs = 1;
|
||||||
|
else
|
||||||
|
vD.Dispose();
|
||||||
|
|
||||||
|
vD = new valuesDisplay(values);
|
||||||
|
vD.Show();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
System.Windows.Forms.DataVisualization.Charting.SeriesChartType type;
|
||||||
|
Enum.TryParse<System.Windows.Forms.DataVisualization.Charting.SeriesChartType>(comboBox1.SelectedValue.ToString(), out type);
|
||||||
|
collatzGraph.Series[seriesIndex].ChartType = type;
|
||||||
|
|
||||||
|
setupChart();
|
||||||
|
}
|
||||||
|
|
||||||
|
void cleanChart()
|
||||||
|
{
|
||||||
|
foreach (var series in collatzGraph.Series)
|
||||||
|
series.Points.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void button2_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
cleanChart();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
2009
Collatz/Collatz/CollatzProblem.resx
Normal file
2009
Collatz/Collatz/CollatzProblem.resx
Normal file
File diff suppressed because it is too large
Load Diff
24
Collatz/Collatz/Program.cs
Normal file
24
Collatz/Collatz/Program.cs
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace Collatz
|
||||||
|
{
|
||||||
|
static class Program
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The main entry point for the application.
|
||||||
|
/// </summary>
|
||||||
|
[STAThread]
|
||||||
|
static void Main()
|
||||||
|
{
|
||||||
|
Application.EnableVisualStyles();
|
||||||
|
Application.SetCompatibleTextRenderingDefault(false);
|
||||||
|
|
||||||
|
Application.Run(new CollatzProblem(10));
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
36
Collatz/Collatz/Properties/AssemblyInfo.cs
Normal file
36
Collatz/Collatz/Properties/AssemblyInfo.cs
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
using System.Reflection;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
// General Information about an assembly is controlled through the following
|
||||||
|
// set of attributes. Change these attribute values to modify the information
|
||||||
|
// associated with an assembly.
|
||||||
|
[assembly: AssemblyTitle("Collatz")]
|
||||||
|
[assembly: AssemblyDescription("")]
|
||||||
|
[assembly: AssemblyConfiguration("")]
|
||||||
|
[assembly: AssemblyCompany("")]
|
||||||
|
[assembly: AssemblyProduct("Collatz")]
|
||||||
|
[assembly: AssemblyCopyright("Copyright © 2016")]
|
||||||
|
[assembly: AssemblyTrademark("")]
|
||||||
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
|
// Setting ComVisible to false makes the types in this assembly not visible
|
||||||
|
// to COM components. If you need to access a type in this assembly from
|
||||||
|
// COM, set the ComVisible attribute to true on that type.
|
||||||
|
[assembly: ComVisible(false)]
|
||||||
|
|
||||||
|
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||||
|
[assembly: Guid("08425262-6bb3-477b-9695-7bd81b56a38b")]
|
||||||
|
|
||||||
|
// Version information for an assembly consists of the following four values:
|
||||||
|
//
|
||||||
|
// Major Version
|
||||||
|
// Minor Version
|
||||||
|
// Build Number
|
||||||
|
// Revision
|
||||||
|
//
|
||||||
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||||
|
// by using the '*' as shown below:
|
||||||
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
|
[assembly: AssemblyVersion("1.0.0.0")]
|
||||||
|
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||||
71
Collatz/Collatz/Properties/Resources.Designer.cs
generated
Normal file
71
Collatz/Collatz/Properties/Resources.Designer.cs
generated
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by a tool.
|
||||||
|
// Runtime Version:4.0.30319.42000
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Collatz.Properties
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||||
|
/// </summary>
|
||||||
|
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||||
|
// class via a tool like ResGen or Visual Studio.
|
||||||
|
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||||
|
// with the /str option, or rebuild your VS project.
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
|
internal class Resources
|
||||||
|
{
|
||||||
|
|
||||||
|
private static global::System.Resources.ResourceManager resourceMan;
|
||||||
|
|
||||||
|
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||||
|
|
||||||
|
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||||
|
internal Resources()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the cached ResourceManager instance used by this class.
|
||||||
|
/// </summary>
|
||||||
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
|
internal static global::System.Resources.ResourceManager ResourceManager
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if ((resourceMan == null))
|
||||||
|
{
|
||||||
|
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Collatz.Properties.Resources", typeof(Resources).Assembly);
|
||||||
|
resourceMan = temp;
|
||||||
|
}
|
||||||
|
return resourceMan;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Overrides the current thread's CurrentUICulture property for all
|
||||||
|
/// resource lookups using this strongly typed resource class.
|
||||||
|
/// </summary>
|
||||||
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
|
internal static global::System.Globalization.CultureInfo Culture
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return resourceCulture;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
resourceCulture = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
117
Collatz/Collatz/Properties/Resources.resx
Normal file
117
Collatz/Collatz/Properties/Resources.resx
Normal file
@ -0,0 +1,117 @@
|
|||||||
|
<?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.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: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" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
</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" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
</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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
</root>
|
||||||
30
Collatz/Collatz/Properties/Settings.Designer.cs
generated
Normal file
30
Collatz/Collatz/Properties/Settings.Designer.cs
generated
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by a tool.
|
||||||
|
// Runtime Version:4.0.30319.42000
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Collatz.Properties
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
|
||||||
|
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
|
||||||
|
{
|
||||||
|
|
||||||
|
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||||
|
|
||||||
|
public static Settings Default
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return defaultInstance;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
7
Collatz/Collatz/Properties/Settings.settings
Normal file
7
Collatz/Collatz/Properties/Settings.settings
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
|
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
|
||||||
|
<Profiles>
|
||||||
|
<Profile Name="(Default)" />
|
||||||
|
</Profiles>
|
||||||
|
<Settings />
|
||||||
|
</SettingsFile>
|
||||||
BIN
Collatz/Collatz/bin/Debug/Collatz.exe
Normal file
BIN
Collatz/Collatz/bin/Debug/Collatz.exe
Normal file
Binary file not shown.
6
Collatz/Collatz/bin/Debug/Collatz.exe.config
Normal file
6
Collatz/Collatz/bin/Debug/Collatz.exe.config
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<configuration>
|
||||||
|
<startup>
|
||||||
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
|
||||||
|
</startup>
|
||||||
|
</configuration>
|
||||||
BIN
Collatz/Collatz/bin/Debug/Collatz.pdb
Normal file
BIN
Collatz/Collatz/bin/Debug/Collatz.pdb
Normal file
Binary file not shown.
BIN
Collatz/Collatz/bin/Debug/Collatz.vshost.exe
Normal file
BIN
Collatz/Collatz/bin/Debug/Collatz.vshost.exe
Normal file
Binary file not shown.
6
Collatz/Collatz/bin/Debug/Collatz.vshost.exe.config
Normal file
6
Collatz/Collatz/bin/Debug/Collatz.vshost.exe.config
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<configuration>
|
||||||
|
<startup>
|
||||||
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
|
||||||
|
</startup>
|
||||||
|
</configuration>
|
||||||
11
Collatz/Collatz/bin/Debug/Collatz.vshost.exe.manifest
Normal file
11
Collatz/Collatz/bin/Debug/Collatz.vshost.exe.manifest
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||||
|
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
|
||||||
|
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
|
||||||
|
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
|
||||||
|
<security>
|
||||||
|
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||||
|
<requestedExecutionLevel level="asInvoker" uiAccess="false"/>
|
||||||
|
</requestedPrivileges>
|
||||||
|
</security>
|
||||||
|
</trustInfo>
|
||||||
|
</assembly>
|
||||||
BIN
Collatz/Collatz/bin/Debug/MetroFramework.dll
Normal file
BIN
Collatz/Collatz/bin/Debug/MetroFramework.dll
Normal file
Binary file not shown.
BIN
Collatz/Collatz/bin/Debug/MetroFramework.pdb
Normal file
BIN
Collatz/Collatz/bin/Debug/MetroFramework.pdb
Normal file
Binary file not shown.
BIN
Collatz/Collatz/obj/Debug/Collatz.CollatzProblem.resources
Normal file
BIN
Collatz/Collatz/obj/Debug/Collatz.CollatzProblem.resources
Normal file
Binary file not shown.
BIN
Collatz/Collatz/obj/Debug/Collatz.Properties.Resources.resources
Normal file
BIN
Collatz/Collatz/obj/Debug/Collatz.Properties.Resources.resources
Normal file
Binary file not shown.
@ -0,0 +1,12 @@
|
|||||||
|
C:\Users\muham\documents\visual studio 2013\Projects\Collatz\Collatz\bin\Debug\Collatz.exe
|
||||||
|
C:\Users\muham\documents\visual studio 2013\Projects\Collatz\Collatz\bin\Debug\Collatz.exe.config
|
||||||
|
C:\Users\muham\documents\visual studio 2013\Projects\Collatz\Collatz\obj\Debug\Collatz.CollatzProblem.resources
|
||||||
|
C:\Users\muham\documents\visual studio 2013\Projects\Collatz\Collatz\obj\Debug\Collatz.Properties.Resources.resources
|
||||||
|
C:\Users\muham\documents\visual studio 2013\Projects\Collatz\Collatz\obj\Debug\Collatz.valuesDisplay.resources
|
||||||
|
C:\Users\muham\documents\visual studio 2013\Projects\Collatz\Collatz\obj\Debug\Collatz.csproj.GenerateResource.Cache
|
||||||
|
C:\Users\muham\documents\visual studio 2013\Projects\Collatz\Collatz\obj\Debug\Collatz.exe
|
||||||
|
C:\Users\muham\documents\visual studio 2013\Projects\Collatz\Collatz\obj\Debug\Collatz.pdb
|
||||||
|
C:\Users\muham\documents\visual studio 2013\Projects\Collatz\Collatz\bin\Debug\Collatz.pdb
|
||||||
|
C:\Users\muham\documents\visual studio 2013\Projects\Collatz\Collatz\obj\Debug\Collatz.csprojResolveAssemblyReference.cache
|
||||||
|
C:\Users\muham\documents\visual studio 2013\Projects\Collatz\Collatz\bin\Debug\MetroFramework.dll
|
||||||
|
C:\Users\muham\documents\visual studio 2013\Projects\Collatz\Collatz\bin\Debug\MetroFramework.pdb
|
||||||
BIN
Collatz/Collatz/obj/Debug/Collatz.csproj.GenerateResource.Cache
Normal file
BIN
Collatz/Collatz/obj/Debug/Collatz.csproj.GenerateResource.Cache
Normal file
Binary file not shown.
Binary file not shown.
BIN
Collatz/Collatz/obj/Debug/Collatz.exe
Normal file
BIN
Collatz/Collatz/obj/Debug/Collatz.exe
Normal file
Binary file not shown.
BIN
Collatz/Collatz/obj/Debug/Collatz.pdb
Normal file
BIN
Collatz/Collatz/obj/Debug/Collatz.pdb
Normal file
Binary file not shown.
BIN
Collatz/Collatz/obj/Debug/Collatz.valuesDisplay.resources
Normal file
BIN
Collatz/Collatz/obj/Debug/Collatz.valuesDisplay.resources
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
64
Collatz/Collatz/valuesDisplay.Designer.cs
generated
Normal file
64
Collatz/Collatz/valuesDisplay.Designer.cs
generated
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
namespace Collatz
|
||||||
|
{
|
||||||
|
partial class valuesDisplay
|
||||||
|
{
|
||||||
|
/// <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 Windows Form 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(valuesDisplay));
|
||||||
|
this.richTextBox1 = new System.Windows.Forms.RichTextBox();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// richTextBox1
|
||||||
|
//
|
||||||
|
this.richTextBox1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
this.richTextBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||||
|
this.richTextBox1.Location = new System.Drawing.Point(0, 0);
|
||||||
|
this.richTextBox1.Name = "richTextBox1";
|
||||||
|
this.richTextBox1.ReadOnly = true;
|
||||||
|
this.richTextBox1.Size = new System.Drawing.Size(464, 321);
|
||||||
|
this.richTextBox1.TabIndex = 0;
|
||||||
|
this.richTextBox1.Text = "";
|
||||||
|
//
|
||||||
|
// valuesDisplay
|
||||||
|
//
|
||||||
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.ClientSize = new System.Drawing.Size(464, 321);
|
||||||
|
this.Controls.Add(this.richTextBox1);
|
||||||
|
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||||
|
this.Name = "valuesDisplay";
|
||||||
|
this.Text = "All Step Values";
|
||||||
|
this.Load += new System.EventHandler(this.valuesDisplay_Load);
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private System.Windows.Forms.RichTextBox richTextBox1;
|
||||||
|
}
|
||||||
|
}
|
||||||
39
Collatz/Collatz/valuesDisplay.cs
Normal file
39
Collatz/Collatz/valuesDisplay.cs
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Data;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace Collatz
|
||||||
|
{
|
||||||
|
public partial class valuesDisplay : Form
|
||||||
|
{
|
||||||
|
List<Int64> values = null;
|
||||||
|
|
||||||
|
public valuesDisplay(List <Int64> values)
|
||||||
|
{
|
||||||
|
this.values = values;
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void valuesDisplay_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (values != null)
|
||||||
|
{
|
||||||
|
foreach (var v in values)
|
||||||
|
{
|
||||||
|
richTextBox1.Text += v;
|
||||||
|
if (v != 1)
|
||||||
|
richTextBox1.Text += " >> ";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
richTextBox1.Text += "Give some value of 'x' ";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
2006
Collatz/Collatz/valuesDisplay.resx
Normal file
2006
Collatz/Collatz/valuesDisplay.resx
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user