1. Computing
Delphi Code Puzzles
Welcome to the Delphi Code Puzzle solving challenge, the place where you compete against yourself and the Delphi compiler for fame and glory.
 Related Resources
• More Code Puzzles

• Quizzes, Tests and Trivia

• A Beginner's Guide to Delphi Programming
 From Other Guides
• Quizzes and Tests in About Computing & Technology

   Delphi Code Puzzles Description
Your task is to solve Delphi Code Puzzle by assembling a program code one line at a time. For each code line, your will be presented with four options. Each option represents a line of code. Only one line will be the correct pick - sometimes even more of them. You'll know if you've picked the correct line only when you finish the puzzle.

All the puzzles are designed to work as console mode applications. In other words, if you need an input from the "user" you use the readln() function. If you need to write something back to the user you use the writeln() function.

When you reach to the end - by solving a particular Delphi Pascal code puzzle, you'll have the option to see whether your code can be compiled in Delphi, or not.

If the code is correct and, therefore, can be compiled, BRAVO, you've solved the puzzle.

Sumbit your Delphi Code Puzzle problem
If you would like to submit your (simple) Delphi code for use on the About Delphi Programming site, please use the Delphi Code Puzzle Sumbission Form.

   Delphi Code Puzzles
Here's a list of available Delphi Code Puzzles, try them - test your Delphi Programming knowledge for free!

  • DEMO PUZZLE: Hello Delphi Programming World, from *User Name*
    Problem: Let the user type it's name in a string variable sName. The program should output 'Hello Delphi Programming World, *sName*'.
  • The power of an integer
    Problem: Let the user type a value for an integer variable iBase. The program should output the value of iBase raised to the power of two.
  • The result of an integer division
    Problem: Let the user type a value for two integer variables: iNumA, iNumB. The program should calculate the integer division between iNumA and iNumB; assign the result to variable iRes and output the result.
  • Square and a square root of a number
    Problem: Let the user type a value for a real variable ANumber. If ANumer is greater than 0, the program should output the square root of ANumber; if ANumer is less or equal to 0, the program should output the square of ANumber.
  • First 10 pozitive integer numbers
    Problem: By using the for loop, output the first 10 pozitive integer numbers.
  • Number of 'A' characters in a string
    Problem: Let the user type a string in a string variable sInput. The program should find the number of 'A' characters in sInput.
  • Alphabet (A..Z) output
    Submitted by: Baruce
    Problem: Write the alphabet (A..Z) out in as few lines as possible without hard coding it within the program. i.e. no array or string containing the alphabet.
  • ©2013 About.com. All rights reserved.