Questions tagged [pascal]

Pascal is an imperative language from the Wirthian family created in 1969. It lives on in compilers like Free Pascal and Delphi.

Filter by
Sorted by
Tagged with
4
votes
1answer
1k views

Merge two integer lists in Pascal

The purpose of the code is to merge two ordered lists (list 1 : 5 integers, list 2 : 8 integers) into another third ordered list, whilst maintaining their order, while entries that appear in more than ...
2
votes
1answer
70 views

X, Y Coordinates class in Lazarus (Delphi-like)

After I've now officially announced, that I'm discontinuing my color picker for Windows, I'm about to embark on a journey through Linux development. I was quite strong in Delphi on Windows, and see ...
4
votes
1answer
97 views
2
votes
1answer
191 views

Inserting an element into a linked list

This program adds an element to the end of a linked list of integers, which is previously keyed in by the user. This works fine on my computer, but I am wondering: If there is a simpler way to do ...
6
votes
0answers
52 views

Prompt user to enter boat details and print them

My code works perfectly fine but I was wondering if there was any better ways I could write my code like tidy it up a bit or rewrite a part of it. I want to learn how I can write my code in a better ...
2
votes
1answer
693 views

Semi-Reliable Communications Using UDP

I'm writing a communications library for a class. Part of the requirements is that semi-reliable communications, which leads me to this monstrosity: ...
1
vote
0answers
203 views

Counting the number of letters in a .txt file in Pascal

I wrote this program that counts the number of letters in random.txt file in the Pascal programming language. It doesn't matter if the letters are capitalized. Other characters are ignored. When it ...
1
vote
0answers
594 views

Pascal Bubble Sort Implementation

I would prefer a review of: Efficiency Standards Different approaches Here's the code: ...
12
votes
1answer
13k views

Human-like mouse movement

The code will move the mouse from a start point (xs, ys) to finish point (xe, ye) like a human would. I'd like some help possibly shortening the code (by optimizing it) and making it more readable. ...
7
votes
1answer
142 views

Auto-click the sequence

The following pascal script needs a bit of context for it's purpose to be understood. For those who don't give about purpose, feel free to skip ahead. Background A game I'm terribly fond of has a ...
2
votes
1answer
85 views

Giving money to the bank

Lets say we need to write an algorithm for giving money to the bank. We need to know interest rate, money which we put every year on our account, and amount of money we want to get. F.e int. rate is 1%...
3
votes
1answer
12k views

Function to split text

The following pascal function (compiled with Delphi) will split strings. It works perfectly, but how to improve the code? For example, to avoid using the repeat-until loop. ...
10
votes
1answer
452 views

Sync eye movements with external events

This solution was used to synchronize events between two applications: An eye tracking software, Python, and a stimulus control software, object Free Pascal/Delphi. It avoided a rewrite of the ...
4
votes
0answers
655 views

Multithread debug logger for Free Pascal / Lazarus

Debug experience can be much improved in the Lazarus development interface. Please, if you use this free development environment and have the same felling, do not consider this affirmation simply as a ...
3
votes
1answer
359 views

Binary and linear search methods for a number-guessing game

This is a code written is Pascal (Delphi). It asks the user to think of a number between min_ and max_ and then guesses the ...
8
votes
1answer
407 views

Enhancing speed of looping cycle using Freepascal

I use Lazarus 1.2.4 and Freepascal 2.6.4. I have created a program that reads a disk in buffers of 64Kb (tried various buffer sizes) using a repeat...until loop. Each buffer is hashed using the SHA1 ...
3
votes
1answer
96 views

Pass the password back

This code simply receives a very basic 'password' (numbers, letters, nothing fancy). After you press enter, it will display it back. The only special key I'm handling is backspace (code ...
4
votes
2answers
75 views

Generating Position

I'm written the following code to calculate the position of a motor during each timestep, the result of which will be compared with feedback from a quadrature encoder and subjected to a PID algorithm. ...
3
votes
1answer
70 views

Yellow Pages Search

I've written code in Free Pascal based on a contest problem (The contest insists that I have to write with Pascal). It works like charm, but I think it still need some improvements, from memory usage ...
3
votes
2answers
69 views
6
votes
2answers
816 views

Querying MySQL from an external application

I have a database that I need to query over and over as fast as possible. My queries execute pretty quickly, but there seems to be some additional lag. I have a feeling that this lag is due to the ...
7
votes
1answer
367 views

Drawing and Painting a Menu Component

I have produced a working menu component for a project I'm working on, but would like to reduce the amount of code used and improve the methods - especially in the Paint implementation - still further,...
3
votes
1answer
246 views

Painting Tom Sawyer's Fence - programming on Free Pascal

Tom Sawyer has many friends who paints his fence. Each friend painted contiguous part of the fence. Some planks could stay unpainted, some could be painted several times. Program must output the ...
7
votes
1answer
234 views

Eight Directions Crossword

I solved a problem which you can read about here, but it gives me "time limit exceeded" even though it runs in 4 seconds. I really don't understand why. I don't think my code can be any simpler, ...