Make a Program Using Notepad
Want to start learning a programming language? You don't need any fancy software; Notepad is capable of writing in any programming language. It doesn't offer many options, but is great for quick Batch files or for testing other small programs. You can have a simple program ready in just a minute, though you may want to consider another editor for more complex programs.
Contents
Steps
Basics
- Write code for any language. Since Notepad is a plain text editor, you can use it to write code for any language, from C to HTML. You can open Notepad from the Accessories folder in your Start menu, or by searching for "notepad".
- In the sections below, you will find some basic examples for a few different programming languages.
- Save the file in the correct format. If you want to use your code in the compiler or interpreter for the language you are programming in, you will need to save the file in the language's format. Click File → Save As. In the "Save as type" drop-down menu, select "All files (*.*)". Enter the extension for the language you are writing.
- Consider a more robust editor. While you can certainly write entire programs in Notepad, it's definitely not the easiest way. Notepad doesn't contain any syntax highlighting or indentation options, making it difficult to use for writing larger pieces of code. Consider a program such as Install-Notepad++, which is designed around programming syntax and is also free.
Batch File
- Learn basic Batch commands. Notepad is most commonly used to create Batch files. Batch files are programs used to automate functions through the command prompt. You can use batch files to apply changes to a number of files at once, create backup systems, and more.
- Below are a few basic Batch file examples.
- Write a basic backup program. This is a simple program that can backup files from one folder to another, only backing up files that have been modified since the last backup.
- Write a batch file to test your network. If you find yourself testing networks and internet connectivity often, this batch file will quickly display the IPConfig and Ping information for you.
- Save your file as a BAT file. When writing a Batch file in Notepad, you will want to save it as a .BAT file. This will change the file into a Batch file that can be executed by double-clicking it or running it from the command prompt.
- Click File → Save As. In the "Save as type" drop-down menu, select "All files (*.*)". Enter the extension ".bat" at the end of the file. When you save it, the file will turn into a Batch file, allowing you to run it.
- Create your own Batch files. There is a lot that you can do with Batch files. You can Delay-a-Batch-File, make a program for Make-a-Compressing-Batch-File-in-Computer, Add-a-Password-to-a-.Bat-File, and much more.
- See this guide for more details on creating Batch files.
Python Program
- Learn basic Python scripting. Python is a popular programming language for web scripting, and is one of the easier languages to learn. Python programs don't need to be compiled; you just need the interpreter installed on your system. Most Python programs are run through the command line interface.
- Below are a few basic Python file examples.
- Create a "Hello, World" program. This is one of the easiest programs to create and teaches you the basics of constructing programs in Python. It simply displays the phrase "Hello, World!" on the user's screen.
- Print the Fibonacci sequence. This simple program will calculate Fibonacci numbers up to 100. You can change the 100 value in the second line to whatever you'd like to change the number of results you get. Make sure to include the indentations, as that is how Python designates functions.
- Run your programs. You do not need to compile Python programs in order to run them. If you have a Python interpreter installed on your system, you can simply run the saved Python file to execute the program. Click File → Save As. In the "Save as type" drop-down menu, select "All files (*.*)". Enter the extension ".py" and save the file. This will allow your Python interpreter to open the file.
- Create more Python programs. Even though it's a fairly simple language, Python is very powerful and you can make a lot of useful stuff with it. You can create Create-a-List-in-Python, Create-Loops-in-Python, and Use-Python-Programming-to-Make-Graphing-X/Y-Charts. You can even Program-in-Python-With-Pygame.
- See this guide for more details on learning the Python language.
C Program
- Learn basic C coding. C is one of the older programming languages around, and is the base for many of the more popular languages being used currently, such as C++ and Objective-C.
- Below are a few basic C file examples.
- Create a "Hello, World" program. This is one of the easiest programs to create and teaches you the basics of constructing programs in C. It simply displays the phrase "Hello, World!" on the user's screen. Make sure to include the indentations, as they denote functions.
- Create a program that stores user input. Much of what you'll be doing in C involves taking and manipulating user input. This basic program allows you to take a number and store it as a variable, which is the first step towards constructing larger programs.
- Compile your programs. C requires a compiler in order to turn the code into a working program. Click File → Save As. In the "Save as type" drop-down menu, select "All files (*.*)". Enter the extension ".c" and then save the file. This will allow you to open it in your compiler.
- Create more programs. This is the very tip of the iceberg when it comes to C, which is a very powerful programming language. There is a lot you can do with C programs: you can Compare-Two-Strings-in-C-Programming, Delay-in-C, Create-an-Alert-in-C, and much more.
- See this guide for more details on programming in C.
Krake Program
- Learn Krake. It's probably the most simple language so far out there.
- Below comes a few examples
- As it sounds, it's literally "print Hello World" (without quotes) you type.
- Read it first, and save it to a variable,
then extract the value of the variable and print it.
- Krake doesn't require any compiling. Just save and run it.
- As you can see our previous example worked good, but no line breaks. That's because "print" prints HTML4, and we'd need to type "<br />" instead of lines.
- Learn Krake at their official website or Write-a-Krake-"Hello-World"-Program
Related Articles
- Use the Command Prompt and Write in Batch Language
- Build a Simple Computer Game Using Batch Script
- Create a Simple CSS Stylesheet Using Notepad
- Make a Simple Mod of a Game
- Build a Simple Calculator Using Batch Script
- Write a Krake "Hello World" Program