A single pixel moving in a circular path

44

6

This is a graphical output challenge where the task is to give the shortest code per language.

Task

Your code should plot a single purple pixel (hex value #800080 or rgb(128, 0, 128)), moving clockwise round a circle. It should take exactly 60 seconds to make a full journey round the circle and should continue indefinitely. Nothing else should be shown on the screen or window except for the pixel. The width of the circle should be 0.75 (rounding suitably) the width of the screen or window and the background should be white. To prevent silly solutions, the screen or window should be at least 100 pixels wide.

Your code should be a full program.

Languages and libraries

You can use any language or library you like. However, I would like to be able to test your code if possible so if you can provide clear instructions for how to run it in Ubuntu that would be very much appreciated.

Missing top twenty languages. Help needed.

The following top twenty programming languages are currently missing any solution at all.

  • C, C++, C#, Python, PHP, Visual Basic .NET, Perl, Delphi/Object Pascal, Assembly, Objective-C, Swift, Pascal, Matlab/Octave, PL/SQL, OpenEdge ABL, R

Catalog

The Stack Snippet at the bottom of this post generates the catalog from the answers a) as a list of shortest solution per language and b) as an overall leaderboard.

To make sure that your answer shows up, please start your answer with a headline, using the following Markdown template:

## Language Name, N bytes

where N is the size of your submission. If you improve your score, you can keep old scores in the headline, by striking them through. For instance:

## Ruby, <s>104</s> <s>101</s> 96 bytes

If there you want to include multiple numbers in your header (e.g. because your score is the sum of two files or you want to list interpreter flag penalties separately), make sure that the actual score is the last number in the header:

## Perl, 43 + 2 (-p flag) = 45 bytes

You can also make the language name a link which will then show up in the snippet:

## [><>](http://esolangs.org/wiki/Fish), 121 bytes

<style>body { text-align: left !important} #answer-list { padding: 10px; width: 290px; float: left; } #language-list { padding: 10px; width: 290px; float: left; } table thead { font-weight: bold; } table td { padding: 5px; }</style><script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b"> <div id="language-list"> <h2>Shortest Solution by Language</h2> <table class="language-list"> <thead> <tr><td>Language</td><td>User</td><td>Score</td></tr> </thead> <tbody id="languages"> </tbody> </table> </div> <div id="answer-list"> <h2>Leaderboard</h2> <table class="answer-list"> <thead> <tr><td></td><td>Author</td><td>Language</td><td>Size</td></tr> </thead> <tbody id="answers"> </tbody> </table> </div> <table style="display: none"> <tbody id="answer-template"> <tr><td>{{PLACE}}</td><td>{{NAME}}</td><td>{{LANGUAGE}}</td><td>{{SIZE}}</td><td><a href="{{LINK}}">Link</a></td></tr> </tbody> </table> <table style="display: none"> <tbody id="language-template"> <tr><td>{{LANGUAGE}}</td><td>{{NAME}}</td><td>{{SIZE}}</td><td><a href="{{LINK}}">Link</a></td></tr> </tbody> </table><script>var QUESTION_ID = 62095; var ANSWER_FILTER = "!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe"; var COMMENT_FILTER = "!)Q2B_A2kjfAiU78X(md6BoYk"; var OVERRIDE_USER = 9206; var answers = [], answers_hash, answer_ids, answer_page = 1, more_answers = true, comment_page; function answersUrl(index) { return "https://api.stackexchange.com/2.2/questions/" + QUESTION_ID + "/answers?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + ANSWER_FILTER; } function commentUrl(index, answers) { return "https://api.stackexchange.com/2.2/answers/" + answers.join(';') + "/comments?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + COMMENT_FILTER; } function getAnswers() { jQuery.ajax({ url: answersUrl(answer_page++), method: "get", dataType: "jsonp", crossDomain: true, success: function (data) { answers.push.apply(answers, data.items); answers_hash = []; answer_ids = []; data.items.forEach(function(a) { a.comments = []; var id = +a.share_link.match(/\d+/); answer_ids.push(id); answers_hash[id] = a; }); if (!data.has_more) more_answers = false; comment_page = 1; getComments(); } }); } function getComments() { jQuery.ajax({ url: commentUrl(comment_page++, answer_ids), method: "get", dataType: "jsonp", crossDomain: true, success: function (data) { data.items.forEach(function(c) { if (c.owner.user_id === OVERRIDE_USER) answers_hash[c.post_id].comments.push(c); }); if (data.has_more) getComments(); else if (more_answers) getAnswers(); else process(); } }); } getAnswers(); var SCORE_REG = /<h\d>\s*([^\n,<]*(?:<(?:[^\n>]*>[^\n<]*<\/[^\n>]*>)[^\n,<]*)*),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/; var OVERRIDE_REG = /^Override\s*header:\s*/i; function getAuthorName(a) { return a.owner.display_name; } function process() { var valid = []; answers.forEach(function(a) { var body = a.body; a.comments.forEach(function(c) { if(OVERRIDE_REG.test(c.body)) body = '<h1>' + c.body.replace(OVERRIDE_REG, '') + '</h1>'; }); var match = body.match(SCORE_REG); if (match) valid.push({ user: getAuthorName(a), size: +match[2], language: match[1], link: a.share_link, }); else console.log(body); }); valid.sort(function (a, b) { var aB = a.size, bB = b.size; return aB - bB }); var languages = {}; var place = 1; var lastSize = null; var lastPlace = 1; valid.forEach(function (a) { if (a.size != lastSize) lastPlace = place; lastSize = a.size; ++place; var answer = jQuery("#answer-template").html(); answer = answer.replace("{{PLACE}}", lastPlace + ".") .replace("{{NAME}}", a.user) .replace("{{LANGUAGE}}", a.language) .replace("{{SIZE}}", a.size) .replace("{{LINK}}", a.link); answer = jQuery(answer); jQuery("#answers").append(answer); var lang = a.language; lang = jQuery('<a>'+lang+'</a>').text(); languages[lang] = languages[lang] || {lang: a.language, lang_raw: lang, user: a.user, size: a.size, link: a.link}; }); var langs = []; for (var lang in languages) if (languages.hasOwnProperty(lang)) langs.push(languages[lang]); langs.sort(function (a, b) { if (a.lang_raw > b.lang_raw) return 1; if (a.lang_raw < b.lang_raw) return -1; return 0; }); for (var i = 0; i < langs.length; ++i) { var language = jQuery("#language-template").html(); var lang = langs[i]; language = language.replace("{{LANGUAGE}}", lang.lang) .replace("{{NAME}}", lang.user) .replace("{{SIZE}}", lang.size) .replace("{{LINK}}", lang.link); language = jQuery(language); jQuery("#languages").append(language); } }</script>

user9206

Posted 2015-10-29T14:27:15.280

Reputation:

1what radius should the circle be? – Timothy Groote – 2015-10-29T14:40:26.337

@TimothyGroote "The width of the circle should be 0.75 (rounding suitably) the width of the screen or window and the background should be white." (Although I'm not sure what window, since the animation should fill the entire screen.) – Martin Ender – 2015-10-29T14:40:55.250

19Why should the pixel be purple? I would assume some languages like TI-Basic don't have color capabilities, which means they can't be used for the challenge for a pretty abitrary reason – Fatalize – 2015-10-29T14:42:05.550

1@Fatalize that doesn't mean you can't golf the color into the program in some clever creative way to save bytes. – Timothy Groote – 2015-10-29T14:43:11.983

3@TimothyGroote TI-BASIC has mainly only one color: black. Everything else is an off pixel. There are C(SE) calculators that have colors, but not everyone has one. – Conor O'Brien – 2015-10-29T14:53:34.193

@CᴏɴᴏʀO'Bʀɪᴇɴ The good news is that BBC BASIC can do color. http://www.bbcbasic.co.uk/bbcwin/manual/bbcwin3.html

– None – 2015-10-29T15:01:37.023

@Lembik ....Lucky. Verry lucky – Conor O'Brien – 2015-10-29T15:08:10.467

10I'm sure putting a purple cellofane over your screen does not add to your code size in bytes. i mean it worked vor the vectrex ;) – Timothy Groote – 2015-10-29T15:45:06.317

1No restriction on move granularity? So a pixel jumping each 30 seconds to the diagonally opposite point on the circle would be valid? – manatwork – 2015-10-29T15:56:45.127

@manatwork Good question. No that would be no good. It should be smooth animation. I don't want to define exactly what that means but it should certainly not skip pixels out on purpose. – None – 2015-10-29T16:04:08.630

QBasic also has a limited set of colors. Is #8B008B (dark magenta, COLOR 5) close enough? – DLosc – 2015-10-29T16:14:34.843

@DLosc Yes that will be fine. If you could include instructions for how to run qbasic code too that would be great. – None – 2015-10-29T16:16:35.393

Another question. The QBasic screen mode I want to use is 320 wide by 200 tall. The biggest circle that fits on that screen will be slightly less than 0.75 of the width of the screen. Ok to use as long as it's more than 0.75 of the height of the screen? – DLosc – 2015-10-29T16:56:52.777

@DLosc Please go ahead :) – None – 2015-10-29T16:57:32.853

Can the pixel blink as it moves? Also curious whether purple is mandatory, I have an answer using TI-Basic and its monochrome screen. – codebreaker – 2015-10-29T19:56:07.267

@codebreaker I am not sure what you mean by blink. purple is the rule but as there is no winning criterion I would just do your best and see if anyone upvotes you :) – None – 2015-10-29T20:00:39.870

I think you should've chosen black for the background so we could actually see the pixel more easily. – mbomb007 – 2015-10-29T20:03:10.767

@mbomb007 Yes you are right. – None – 2015-10-29T20:08:49.693

Is it at least 0.75x screen width, or exactly? – lirtosiast – 2015-10-29T21:28:27.387

There should be a turtle answer! – RobAu – 2015-10-29T21:36:08.357

What is the minimum update rate? 1 frame per second? – lirtosiast – 2015-10-29T22:13:48.400

@Lembik: Is it OK if the time required for a full circle is 60 seconds on a particular machine, or does the timing have to be machine-independent? – Franz D. – 2015-10-30T10:26:28.273

@FranzD. Ideally it would be machine-independent but I won't be too fussy. – None – 2015-10-30T10:27:14.173

@Lembik, you're a quick one :) – Franz D. – 2015-10-30T10:27:54.540

@ThomasKwa Given that it has to do a full circle in 60 seconds and it has to be smooth, the frame rate should be fast enough to allow that. – None – 2015-10-30T10:28:00.043

@Lembik If you mean by smooth that every pixel on the circle must be displayed, I need to change my answer again, since TI-BASIC doesn't have any means of getting fractional seconds. Is it acceptable for the program to terminate after a couple of years? – lirtosiast – 2015-10-30T10:44:12.640

@ThomasKwa Yes it is! – None – 2015-10-30T10:58:18.170

as there is no winning criterion I would just do your best and see if anyone upvotes you That's not how catalogs work. If your challenge says the pixel must be purple, it must be purple. If you want exempt some languages from this rule, say so in the question. – Dennis – 2015-10-31T17:28:10.397

@Dennis You are right. I just didn't want to be mean. – None – 2015-10-31T19:05:01.990

interesting coincidence, a quora answer about drawing a circle to a CRT on a PDP-8 in 1969 just came up in my digest feed this morning: http://qr.ae/RkWTqm

– zamnuts – 2015-11-02T06:07:49.687

@zamnuts A clear case of time travel assisted plagiarism I think! – None – 2015-11-02T09:54:20.203

Answers

23

Processing, 101 97 96 bytes

4 bytes thanks to Flambino.

1 byte thanks to Kritixi Lithos.

float d;void draw(){background(-1);stroke(#800080);d+=PI/1800;point(50+cos(d)*38,50+sin(d)*38);}

This creates a default 100 by 100 pixel window with the required animation.

output window

Disclaimer: that image is not a GIF. Don't stare at it for a minute.

PurkkaKoodari

Posted 2015-10-29T14:27:15.280

Reputation: 16 699

clever. i had no idea you could just omit setup. – Timothy Groote – 2015-10-29T14:53:38.787

2Does this implement the 60 seconds rule? – None – 2015-10-29T15:12:29.873

2

@Lembik Yes. The default framerate is 60 fps, and I'm incrementing the angle π/1800 radians at a time. (It was π/3600 10 seconds ago because of my brain fart.)

– PurkkaKoodari – 2015-10-29T17:21:12.507

5

@Pietu1998 That brainfart was due to the fact that pi is wrong

– Cruncher – 2015-10-29T20:46:09.187

2@Cruncher gotta love vi hart! – Tim – 2015-10-29T21:52:25.677

1You can save 4 bytes: Don't bother initializing d to zero, and define the stroke as stroke(#800080); - Processing understands CSS-style hex colors – Flambino – 2015-10-30T00:07:16.180

17Hey, your GIF isn't working, I stared at it for a minute but nothing happened – Beta Decay – 2015-11-01T08:34:54.633

@BetaDecay If you look closely, it's actually a video file. Simply click on the play button and watch carefully. – Mateen Ulhaq – 2015-11-02T07:53:53.510

background(-1); is 1 byte shorter – user41805 – 2017-02-06T15:27:40.210

Also you can move the d+=PI/1800 into cos like this: point(50+cos(d+=PI/180)*38,50+sin(d)*38); to save few bytes – user41805 – 2017-02-06T16:51:54.187

16

QB64, 79 bytes

QB64 is a QBasic emulator that adds some nice features. This program uses one (CLS,15) that isn't supported by vanilla QBasic.

SCREEN 7
DO
T=TIMER/9.55
PSET(COS(T)*75+99,SIN(T)*75+99),5
PLAY"c8"
CLS,15
LOOP

This is very loud. It uses the PLAY command to halt execution for a short while before clearing the screen; otherwise the pixel will flicker and become invisible.

Download QB64, load this file, click Run and then Start.

Here it is in action:

the program

I took some tricks (SCREEN 7 instead of SCREEN 13, and PSET instead of POKE) from @DLosc's answer, so credit is due. As in his answer, my magenta is actually #8B008B, which was deemed acceptable by the OP.

(The constant 9.55 is an approximation of 30/π = 9.54929658551. Is it close enough?)

Lynn

Posted 2015-10-29T14:27:15.280

Reputation: 55 648

Ha! Never thought of using PLAY for a delay. Could've sworn there was a code for a rest, but I'm not seeing it now in the help file. I did consider using (a function of) TIMER as the parameter, but never tried it to see if it was shorter. Kudos! – DLosc – 2015-10-29T19:46:11.353

4Thank! I shamelessly lifted PSET from you, so kudos back :) It looks like a rest is n0 which is longer than c. Also, I like it as a bit of rule-bending: the OP said nothing else could be shown in the window, but never said my program couldn't loudly go *BEEP BEEP BEEP BEEP*. – Lynn – 2015-10-29T19:48:06.367

1I have nothing against the beeps but I can't actually see a pixel moving around a circle when I try in linux. – None – 2015-10-29T19:57:25.390

1Here it is in action on my machine, which should be enough proof. – Lynn – 2015-10-29T19:59:38.313

@Mauris That is convincing. Is that in QB64 on linux? – None – 2015-10-29T20:04:27.180

That's QB64 on Windows. I have no idea what would cause it to behave differently... Maybe @DLosc can test it in DOS? – Lynn – 2015-10-29T20:05:40.613

12I stared at the image for a while, because you said "here it is in action". – mbomb007 – 2015-10-29T20:07:54.347

Works for me too now! (I had a typo.) Very impressive. – None – 2015-10-29T20:12:43.397

@Mauris The ,15 after CLS is not valid for QBasic 4.5 and not necessary - you can omit it. – mınxomaτ – 2015-10-29T20:27:52.597

Doesn't the background color have to be white? For me, that changes it to black. – Lynn – 2015-10-29T20:34:49.963

Yes it does, (I didn't read that). Still, it is not valid QB Syntax (debugger expects the end of the statement after CLS). I tried it with QBasic 1.1 and 4.5. I don't have 7.1 currently installed, but it should make no difference. What's the version you are targeting? – mınxomaτ – 2015-10-29T20:39:00.793

Ah, it looks like that argument to CLS is a QB64 extension... I'll add that to the post.

– Lynn – 2015-10-29T21:00:08.100

@Mauris QB64 is really almost it's own language. I suggest changing the header to "QB64" :) – mınxomaτ – 2015-10-29T21:00:52.160

14

HTML, 235 290 295 354 347 bytes

<a><style>*{position:absolute;margin:0;box-sizing:border-box}body{height:100vh;width:100vh}a{left:12.5%;top:50%;width:75%;height:1px;border-left:1px solid purple;animation:r 60s infinite linear}@keyframes r{100%{transform:rotate(360deg

Save as a .html file and open in a browser, that doesn't need vendor prefixes, like Chrome or Firefox. Or try this fiddle.


This is a new version which is way shorter than my first attempt, that I had written 5 minutes before a meeting. The new size of the canvas is a square based on the viewport height. That works pretty well and is not restricted to a certain defined height. I'm very accurate about the settings in the challenge (75% size of its parent, purple and 1px). Therefore I need and can't discard or simplify the following rules:

* { margin: 0; box-sizing:border-box; }
a { left: 12.5%; }

Ungolfed

This is the ungolfed version with clean markup:

<!DOCTYPE html>
<html>

<head>
    <style>
        * {
            position: absolute;
        }

        body {
            margin: 0;
            height: 100vh;
            width: 100vh;
        }

        a {
            left: 12.5%;
            top: 50%;
            width: 75%;
            height: 1px;
            border-left: 1px solid purple;
            box-sizing: border-box;
            animation: r 60s infinite linear;
        }

        @keyframes r {
            100%{
                transform: rotate(360deg)
            }
        }
    </style>    
</head>
<body>
    <a></a>
</body>

Edits

  • Added 7 bytes. I thought nobody would notice, that there's a default easing on the animation. ;) I've set it to linear now.
  • Saved 59 bytes by throwing everything abort that the browser will handle automatically.
  • Saved 3 bytes by removing the trailing )}}. Thanks to toothbrush.
  • Saved 2 bytes by using 12% instead of 12px which is the same value corresponding to the size of the parent element.
  • Saved 55 bytes due to massive refactoring, also taken a lot of comments into account. Thanks a lot for all the contributions.

insertusernamehere

Posted 2015-10-29T14:27:15.280

Reputation: 4 551

1I just wanted to comment on the post, i would like to see a pure html/css solution (ty for submitting one) – dwana – 2015-10-29T15:12:06.307

1Using fiddle the speed of the moving pixel is very uneven. It almost grinds to a halt when the pixel is on the far left. Any ideas why? – None – 2015-10-29T15:27:31.790

@Lembik Argh, I thought nobody would notice due to the long duration of 60 seconds. ;) There's a default easing which you have to overwrite by linear. The answer is already updated. – insertusernamehere – 2015-10-29T15:35:43.823

1@insertusernamehere :) I think the ungolfed version needs updating too now. – None – 2015-10-29T15:38:48.163

You could use other units, like em, cm, mm, in and so on. 9cm should be enough. – Ismael Miguel – 2015-10-29T15:48:47.663

I'm pretty sure you can use <a/> to cut a few bytes. – Ypnypn – 2015-10-29T16:05:15.433

@Ypnypn Wouldn't that result in invalid HTML5? – insertusernamehere – 2015-10-29T16:06:39.790

@insertusernamehere If I'm not mistaken, most browsers will still accept it – Ypnypn – 2015-10-29T16:07:10.597

@Ypnypn True that, but then you could also skip the head and body elements and set styles within body. ;) – insertusernamehere – 2015-10-29T16:09:00.300

5You should go for the smallest working code irrespective of validity. Things like polluting the global namespace are par for the course while golfing. – John Dvorak – 2015-10-29T18:28:07.873

@JanDvorak Thanks for your tip. I've thrown everything abort now that is unnecessary. :) – insertusernamehere – 2015-10-29T19:08:10.207

1@JanDvorak Dirty advice! Maybe at least have one good quality answer and one that breaks all the rules :) – None – 2015-10-29T19:08:31.467

@lembik perhaps separate valid/invalid HTML in two separate languages? – John Dvorak – 2015-10-29T19:10:56.943

@ismael 9% for the win. As long as it works in your environment, you're golden. – John Dvorak – 2015-10-29T19:13:00.247

Do you need to specify the body size at all? I think not. – John Dvorak – 2015-10-29T19:14:51.183

Can you remove the content:''? – mbomb007 – 2015-10-29T20:06:35.273

2You can drop )}} from the end (the CSS parser will automatically end the blocks) – Toothbrush – 2015-10-29T20:08:39.713

@toothbrush Good catch. Updated. – insertusernamehere – 2015-10-29T22:59:29.803

1You can skip the whole :after ruleset. Instead set a to left: 50%, width: 1px, and border-top: 1px solid #800080 - saves you 48 bytes by my count – Flambino – 2015-10-30T00:24:18.433

If you merge position:absolute, which is defined for both a and a:after, you can save 8 more bytes: <a><style>body{position:relative;width:100px;height:100px}a{left:12%;top:12%;animation:r 60s infinite linear;transform-origin:50%50%;width:75%;height:75%}a,a:after{position:absolute}a:after{content:'';width:1px;height:1px;background:#800080}@keyframes r{100%{transform:rotate(360deg. Or do what @Flambino suggests. – Toothbrush – 2015-10-30T12:11:24.107

Also, you could use 7em (usually 112px) instead of 100px for the width and height of body. Saves 4 bytes. – Toothbrush – 2015-10-30T12:21:57.470

@toothbrush thanks for the suggestions - I have a brand new version almost ready and will that into account as well - will get back to you when I get home and have the time. Thanks. :) – insertusernamehere – 2015-10-30T12:23:41.130

If you increase the distance from the edge, you can remove transform-origin which is 50% 50% 0 by default (e.g. <a><style>body{position:relative;width:7em;height:7em}a{left:15%;top:15%;animation:r 60s infinite linear;width:70%;height:70%}a,a:after{position:absolute}a:after{content:'';width:1px;height:1px;background:#800080}@keyframes r{100%{transform:rotate(360deg). – Toothbrush – 2015-10-30T12:38:48.620

14

Java, 449 443 439 bytes

Because I've always had stupid ideas. Like golfing in Java ;) .

import java.awt.*;import javax.swing.*;class F extends JFrame{F()throws Exception{setContentPane(new P());setSize(400,400);setVisible(0<1);for(;;Thread.sleep(100))repaint();}class P extends JPanel{double c;public void paintComponent(Graphics g){g.setColor(new Color(8388736));c=(c-0.1)%60;double t=0.104*c;g.fillRect((int)(180+Math.sin(t)*120),(int)(180+Math.cos(t)*120),1,1);}}public static void main(String[]x)throws Exception{new F();}}

Edit: Thanks for @Ypnypn for golfing 7 bytes!

Edit2: Thanks for @Franz D. for saving 3 bytes!

Peter Lenkefi

Posted 2015-10-29T14:27:15.280

Reputation: 1 577

7Java is winning the longest shortest code competition so far :) – None – 2015-10-29T16:50:18.160

@lembik even beats w3valid HTML, which is impressive. – John Dvorak – 2015-10-29T18:30:50.840

1>

  • You don't need to initialize member variables to zero, so you can save two bytes (~0.45%) by converting "c=0" to "c".
  • < – Franz D. – 2015-10-29T20:16:43.830

    1And you can save one more byte by initializing the color in hex, i.e. new Color(0x800080). – Franz D. – 2015-10-29T20:17:14.383

    1@FranzD. Even better - just use the decimal number 8388736. – Ypnypn – 2015-10-29T21:14:53.887

    I just submitted my own Java solution -- sorry Peter, but I had too many changes for a single comment :) – Franz D. – 2015-10-29T21:48:34.473

    @FranzD. Very good! – Peter Lenkefi – 2015-10-29T22:31:42.243

    You can use show() instead of setVisible(0<1). (also put this comment on Franz's answer :) – tobii – 2015-10-29T22:35:17.883

    @tobii Thanks! I won't modify this as Fran's answer is much shorter already – Peter Lenkefi – 2015-10-29T22:40:36.587

    You should try groovy. Much shorter. – J Atkin – 2015-11-01T14:24:54.013

    1Get rid of JFrame, use Frame, allows you to remove javax import. – Magic Octopus Urn – 2016-11-30T15:41:14.113

    14

    Mathematica, 102 101 94 bytes

    Animate[Graphics[{White,Disk[],{Purple,Point[{0,1}]}}~Rotate~-t],{t,0,2π},DefaultDuration->60]
    

    Creates a white circle that is hidden and places a point that follows its edge from 0 to 2π. Mathematica's DefaultDuration option let's me set it to complete a loop every 60 seconds.

    Here's a sped up version of the output:

    EDIT: Change Circle to Disk to save 2 characters, added a negative sign to t to make it move clockwise.

    EDIT: Saved 7 bytes by using the ~ operator (thanks to Mauris).

    tjq

    Posted 2015-10-29T14:27:15.280

    Reputation: 141

    14Further proof that Mathematica is just a programming language where you write some vague English words that sort of mean what you want, then add punctuation. (I hear you can use a~f~b instead of f[a,b], wouldn't that make your Rotate shorter?) – Lynn – 2015-10-29T20:36:45.363

    1You can also use prefix notation for Point@{0,1} and I don't think you need the list around Purple,Point.... – Martin Ender – 2015-10-30T08:48:02.777

    1@Mauris. To the untrained eye, Mathematica may indeed look like vague English words and punctuation. In reality, they are the names of specific, well-defined functions, settings and operators. The likelihood that a non-programmer could spin out workable code is zilch. – DavidC – 2015-10-30T09:27:31.033

    3@David: Haha, of course I'm aware -- I was just joking :) – Lynn – 2015-10-30T12:26:33.050

    @Mauris, You fooled me! – DavidC – 2015-10-30T15:10:19.653

    Point@{1,0}. You can also eliminate the braces corresponding to {Purple....} – DavidC – 2015-10-31T14:39:11.027

    Don't the rules require movement clockwise indefinitely? – Michael Stern – 2015-11-01T11:18:16.943

    You should change Point[{0,1}] to Point@{0,3/4}. – LegionMammal978 – 2015-11-01T12:41:17.880

    This doesn't produce the correct size of the circle though. But it looks good :-) – Jens – 2015-11-02T17:56:00.523

    14

    TI-BASIC, 44 bytes

    For the TI-84+ CSE/CE calculators, which support some limited BASIC color graphics.

    AxesOff
    ZSquare
    While rand
    Pt-Off(imag(Ans),real(Ans
    7.5e^(-i6startTmr°
    Pt-On(imag(Ans),real(Ans),13
    End
    

    The color here is magenta, or color 13 (one can also use the MAGENTA token).

    I use rand instead of 1 for the infinite loop condition to provide a tiny bit of delay (~15 ms) between when the pixel is displayed and when it is turned off again.

    Set your calculator to radian mode before running this program; I don't count this in the size because it's the default state. Also set Ans to 0 by entering a 0 before the program; this is also the default.

    Thanks to @quartata for testing this program (I don't own a color calculator).

    lirtosiast

    Posted 2015-10-29T14:27:15.280

    Reputation: 20 331

    Naive idea: can you make the program call itself instead of using a while loop, and would that be shorter? – Lynn – 2015-10-30T12:31:44.927

    @Mauris the while loop is 3 tokens, while a program name is longer usually – TheDoctor – 2015-10-30T20:03:50.050

    1@Mauris The While loop is actually 4 bytes, and it's possible to recurse in 3, but the stack runs out very quickly, after less than 300 calls. – lirtosiast – 2015-10-31T00:24:47.920

    @Lembik Because you're fine with [http://codegolf.stackexchange.com/a/62203/39328], I won't change this to be smoother. – lirtosiast – 2015-10-31T15:56:55.227

    13

    Java, 339 308 289 287 bytes

    import java.awt.*;class F extends Frame{{setSize(200,200);show();}int c;public void paint(Graphics g){g.setColor(new Color(8388736));g.fillRect((int)(99+Math.sin(--c*.01)*75),(int)(99+Math.cos(c*.01)*75),1,1);for(int i=0;++i<62864;)paint();}public static void main(String[] x){new F();}}
    

    Thanks to @Peter Lenkefi, whose great solution got me started, and whose for-loop I shamelessly copied!

    The main saving was due to switching to pure AWT and rendering directly in the Frame -- no need for a JPanel (or Canvas). I also made the counter an integer variable, updated by simple increment, and saved a few bytes twiddling the constants to be able to strip a digit here and there.

    EDIT: Thanks to @Peter Lenkefi and @tobii for their suggestions in the comments. Beating HTML would be nice -- does anyone know how to reliably pause execution in Java without using sleep() and having to catch exceptions?

    EDIT 2: JAVA BEATS HTML (currently at 290 bytes!) :D Timing is now machine-dependent, but ~60 seconds for a full circle on my machine, which is OK according to @Lembik. Thanks again to @PeterLenkefi for his suggestion -- my answer is more than half his :)

    EDIT 3: @Ajay suggested to remove the "re" from "repaint". Two bytes less. We're getting there :)

    Franz D.

    Posted 2015-10-29T14:27:15.280

    Reputation: 231

    Very nice job :D I don't really java so I don't know GUI stuff. I should look into AWT then. – Peter Lenkefi – 2015-10-29T22:29:44.263

    You can use show() instead of setVisible(0<1) – tobii – 2015-10-29T22:34:09.410

    Also you can save 2 bytes if you remove the braces from the for loop. – Peter Lenkefi – 2015-10-29T22:37:24.450

    g.fillRect(99+(int)Math.sin(--c.01)75,99+(int)Math.cos(c.01)75,1,1); 4 bytes less – Peter Lenkefi – 2015-10-29T22:43:47.863

    Oh and you can get rid of exception throwing and the for loop by calling repaint and Thread.sleep in paint() (you need to surround with try-catch tho). – Peter Lenkefi – 2015-10-29T22:53:04.580

    Using a try/catch, removing the braces for the for loop, using show() instead of setVisible(0<1), and just using {} instead of F(){} for your constructor would save 21 bytes. – tobii – 2015-10-29T22:56:28.120

    1We have to get it under HTML (so <290 right now) – Peter Lenkefi – 2015-10-29T23:05:57.640

    @tobii, I didn't know that constructor idiom. Great for obfuscation :) – Franz D. – 2015-10-30T08:44:43.733

    1@PeterLenkefi: Unfortunately, I can't save the braces of the cast; casting the sin/cos result directly breaks the computation. Your repaint inside paint() is incredibly dirty :) – Franz D. – 2015-10-30T08:45:00.057

    @FranzD. Oh yeah the casting wouldn't work... Oh well, dirty but shorter :D – Peter Lenkefi – 2015-10-30T09:18:12.920

    Instead of Thread.sleep you could try something like for(int z=0;z++<99999;); which based on your computer's speed will work. Or will not ;) – Peter Lenkefi – 2015-10-30T09:23:57.820

    I don't think this is OK for the question, as the time for a full circle would depend entirely on the machine. I'll ask, though... I also tried a loop using System.nanoTime(), but this is longer than sleep with exceptions :( – Franz D. – 2015-10-30T10:24:48.173

    Updated my answer... 1 byte less than HTML now :D – Franz D. – 2015-10-30T10:54:01.780

    For saving an extra byte, one could use "for(short i=0;++i!=0;)" for the delay loop. That's ~65 sec on my machines for a full circle. – Franz D. – 2015-10-30T11:09:13.197

    @PeterLenkefi Please for the love of God don't use AWT for anything sensible! Look into JavaFX or shudder Swing instead. – Troyseph – 2015-10-30T13:55:36.613

    1@Troyseph I meant for golfing ;) I don't use java for anything. – Peter Lenkefi – 2015-10-30T14:41:58.257

    You can save one more byte by changing public static void main(String[] x) to public static void main(String[]x) -- the space between String[] and x is not required. – Pokechu22 – 2015-10-30T17:55:47.770

    1Using int c,i and omitting the int in for(int i=.. should save some more. – Marco13 – 2015-11-02T11:25:47.530

    1You don't even need the class declaration for F, you can just extend the Frame class inline: new Frame(){...}. – Magic Octopus Urn – 2016-12-01T20:03:55.010

    9

    Haskell, 143 136 bytes

    This uses the gloss package:

    import Graphics.Gloss
    main=animate(InWindow""(100,100)(0,0))white$ \t->color(makeColor 0.5 0 0.5 1).rotate(t*6).translate 38 0$circle 1
    

    The prettier version is

    import Graphics.Gloss
    
    purple :: Color
    purple = makeColor 0.5 0.0 0.5 1.0
    
    main :: IO ()
    main = animate (InWindow "" (100,100) (0,0)) white $ \t ->
        color purple . rotate (t * 6) . translate 38 0 $ circle 1
    

    Frerich Raabe

    Posted 2015-10-29T14:27:15.280

    Reputation: 191

    You can remove some whitespace. – rightfold – 2015-10-30T12:21:21.213

    @Elyse Indeed, thanks. I also removed two unneeded .0. – Frerich Raabe – 2015-10-30T12:28:02.973

    8

    HTML (CSS?), 167 bytes

    Inspired by insertusernamehere's answer

    <style>body{position:fixed;left:50%;top:12%;width:1px;height:75vmin;border-top:1px solid #800080;animation:r 60s infinite linear}@keyframes r{to{transform:rotate(1turn
    

    Ungolfed:

    body {
        position: fixed;
        left: 50%;
        top: 12%;
        width: 1px;
        height: 75vmin;
        border-top: 1px solid #800080;
        animation: r 60s infinite linear;
    }
    @keyframes r {
        to {
            transform: rotate(1turn);
        }
    }

    Lachlan Arthur

    Posted 2015-10-29T14:27:15.280

    Reputation: 181

    Just a FYI, HTML + CSS is not usually considered a programming language, however it is up to the OP. – GamrCorps – 2015-10-30T03:49:58.837

    1It doesn't do anything on Firefox 41.0.2. – n̴̖̋h̷͉̃a̷̭̿h̸̡̅ẗ̵̨́d̷̰̀ĥ̷̳ – 2015-10-30T07:19:29.310

    1Just tested on Firefox 41.0.2, Win 10. Works fine for me. – Lachlan Arthur – 2015-10-30T07:28:20.170

    1Works for me in 41.0.2 in ubuntu. – None – 2015-10-30T08:04:09.857

    1+1 Good thinking to just animate the body itself. :) – insertusernamehere – 2015-10-30T18:32:19.507

    7

    QBasic, 106

    SCREEN 7
    COLOR 5,15
    DO
    t=TIMER
    CLS
    PSET(99+99*COS(i),99+99*SIN(i))
    i=i+ATN(1)/75
    1IF TIMER<t+.1THEN 1
    LOOP
    

    Tested on QB64, which says it has a Linux version (though I've only tried it on Windows).

    • SCREEN 7 sets the graphics mode.
    • COLOR 5,15 sets dark magenta as foreground color and bright white as background color.
    • DO ... LOOP is an infinite loop. Usually you would see it as DO WHILE ... LOOP (or you can put LOOP WHILE instead, or use UNTIL for a negated condition), but you can also leave the condition out, in which case it loops forever.
    • TIMER is the number of seconds since midnight, as a floating-point value.
    • CLS = CLear Screen.
    • PSET SETs a Point to a color, foreground color by default.
    • i starts at zero and counts up by pi/300 each time through the loop, thus completing a full circle after 600 repetitions. We calculate pi as 4*arctan(1).
    • The last line waits until 0.1 seconds have elapsed. The idiom that I learned from my QBasic books was t# = TIMER: WHILE TIMER < t# + 0.1: WEND. But we don't need double-precision numbers (marked with #) for a 0.1-second difference, and it turns out that the IF cond THEN [GOTO] line syntax is 1 character shorter than a WHILE ... WEND loop.

    The loop repeats 600 times in 60 seconds, thus completing a full circle.

    Caveats

    • Color 5, dark magenta, is #8B008B instead of the requested #800080 (cleared with the OP).
    • Screen mode 7 is 320x200, and so the circle has diameter 198, which isn't >= 0.75 of the width but is >= 0.75 of the height (also cleared with the OP).
    • If you run this on DOS QBasic, it's fullscreen, so the "pixel" isn't actually a single pixel on the monitor (unless you happen to have a 320x200 monitor). But it should be close enough. QB64 runs in a window that uses the exact dimensions, and thus the pixel is a literal pixel.
    • In QB64 at least, this takes more like 65 seconds to make a complete revolution. I don't really know why; it must be either rounding errors or overhead on the loop, though I've tried mitigating both without success. In theory, the code should work correctly as-is. In practice, one can tweak the amount by which i is incremented until a revolution is close enough to 60 seconds. (Try a denominator of 69 or 68.)
    • No pretty picture here. :( LICEcap's quality wasn't good enough to capture a single pixel accurately.

    DLosc

    Posted 2015-10-29T14:27:15.280

    Reputation: 21 213

    This code works perfectly for me in Linux. Thank you. – None – 2015-10-29T20:08:04.200

    This actually runs in QBasic 4.5, but the background is not really white :) . Here is a GIF of it compiling and running: http://codegolf.square7.ch/altqb.gif

    – mınxomaτ – 2015-10-29T20:57:03.577

    @mınxomaτ Odd, color 15 should give either white or light gray according to everything I thought I knew... that looks like light cyan (color 11). What does SCREEN 8 instead of 7 do? – DLosc – 2015-10-29T21:52:07.413

    Same greenish background. But you're right, according to spec it should be white. I also tried color 7 (grey) and it came out as grey. So your solution is absolutely ok, but there's something wrong with my DOS. – mınxomaτ – 2015-10-29T21:59:59.957

    7

    mIRC script, 184 bytes

    alias g {
    window -p @m -1 -1 100 128
    f
    }
    alias f {
    inc %s 1
    set %o $calc(%s *38/360)
    clear @m
    drawdot -r @m $rgb(128,0,128) 1 $calc($cos(%o)*38+50) $calc($sin(%o)*38+52)
    .timer 1 1 f
    }
    

    This is optimised for mIRC in Wine. Start mIRC, press Alt + R then paste this, close the editor and run it with /g

    Preview

    The timing on the gif might be off.

    Varis

    Posted 2015-10-29T14:27:15.280

    Reputation: 71

    This is a new one on me! It would be great if you could make an animated gif of it running. – None – 2015-10-30T16:16:13.687

    It was one of the first languages that I used/got me interested in coding! – Varis – 2015-10-30T17:48:31.627

    6

    Ruby with Shoes, 159 bytes

    Shoes.app{animate{background stroke white
    fill purple
    r=0.75*c=self.width/2
    t=Time.now
    m=Math
    rect c+r*m.sin(a=(t.sec+t.usec*1e-6)*m::PI/30),c-r*m.cos(a),2,2}}
    

    The pixel is actually the tip of an analog clock's seconds hand. So this one is absolutely precise.

    Ruby with Shoes, 134 bytes

    m=Math
    Shoes.app{animate{|f|r=0.75*c=self.width/2
    background stroke white
    fill purple
    rect c+r*m.sin(a=f*m::PI/360),c-r*m.cos(a),2,2}}
    

    This is a frames-per-seconds based alternative, inspired by the other answers. Although the documentation says the default fps is 10, practical tests shows it is actually 12.

    Both solutions take “The width of the circle should be 0.75 (rounding suitably) the width of the screen or window” literally: calculate based on window width, so the pixel occasionally may leave the bottom of a non-square window. Not sure how such case is expected to be handled. (Use minimum of width and height? Walk on oval path?) The window starts with default 600 x 500 size and is resizable.

    manatwork

    Posted 2015-10-29T14:27:15.280

    Reputation: 17 865

    Very pleased to see a Ruby solution! Now we need Python, Perl,.... – None – 2015-10-30T10:06:38.827

    6

    R, 170 bytes

    library(animation);for(i in 1:60){par(mar=rep(0,4));plot.new();t=2*pi*(1-i)/60;points(3*cos(t)/8+.5,3*sin(t)/8+.5,pch=19,col="#800080");ani.record()};repeat{ani.replay()}
    

    It relies on package animation. And here 's a gif to show it works:

    In a window

    Invalid Solution saving to a gif (139 bytes):

    animation::saveGIF({for(i in 1:60){par(mar=rep(0,4));plot.new();t=2*pi*(1-i)/60;points(3*cos(t)/8+.5,3*sin(t)/8+.5,pch=19,col="#800080")}})
    

    This one requires ImageMagick to be installed. The result is saved to a gif.

    ![Round and round it goes

    plannapus

    Posted 2015-10-29T14:27:15.280

    Reputation: 8 610

    This is great however.. the challenge needs the code to write to the screen/window. – None – 2015-10-30T10:39:06.610

    Oh I didn't understand that. – plannapus – 2015-10-30T10:40:24.850

    2Here it is, in a window. – plannapus – 2015-10-30T10:51:56.757

    5

    D, 286 280 bytes

    (392 if written normally)

    import simpledisplay,std.math;void main(){auto w=new SimpleWindow(100,100);auto c=50;auto r=c*2/3;int t;auto y=600/PI;w.eventLoop(50,{auto p=w.draw();p.clear;p.outlineColor=Color(128,0,128);p.drawPixel(Point(c+cast(int)(r*cos(t/y)),c+cast(int)(r*sin(t/y))));if(++t==1200)t=0;});}
    

    Or the way I originally wrote it without golfing:

    import simpledisplay, std.math;
    
    void main() {
            auto window = new SimpleWindow(100, 100);
            auto c = window.width/2;
            auto r = c*2/3;
            int t;
            float cycle = 20*60/(PI*2);
            window.eventLoop(50, {
                    auto p = window.draw();
                    p.clear;
                    p.outlineColor = Color(128, 0, 128);
                    p.drawPixel(Point(c + cast(int) (r*cos(t/cycle)), c + cast(int) (r*sin(t/cycle))));
                    if(++t == 20*60)
                            t = 0;
            });
    }
    

    Depends on simpledisplay.d and color.d located here: https://github.com/adamdruppe/arsd

    Just download those two individual files and put them in your same directory as the above code, then: dmd yourfile.d simpledisplay.d color.d to compile and then just run it.

    My little library was written to make quick animations like this fairly simple so this plays well to its strengths! Alas, I kinda like long identifier names and didn't provide a Point constructor that takes float so that adds 18 bytes casting and.... idk a couple dozen spelling out my method names.

    Adam D. Ruppe

    Posted 2015-10-29T14:27:15.280

    Reputation: 151

    1The first argument to eventLoop btw is a millisecond timer. If it is non-zero, it automatically makes a timer for you and calls the function with zero args provided at that interval. (eventLoop can also take functions with MouseEvent or KeyEvent args to handle user input). So 50 millisecond interval = 20 frames per seconds, so 20 * 60 = cycle in 60 seconds. – Adam D. Ruppe – 2015-10-29T17:13:55.750

    I think the way you have written the answer the leaderboard code picks up 392 instead of 280. – None – 2015-10-29T21:53:45.180

    5

    X86 Machine-code - 150 146 149 133 127 bytes

    Golfed version:

            00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
            --------------------------------------------------------------------
    0000    B0 13 CD 10 BA C9 03 88 F1 BE 76 01 F3 6E B0 0F - °.Í.ºÉ.ˆñ¾v.ón°.
    0010    49 68 00 A0 07 F3 AA 64 66 A1 6C 04 66 A3 80 01 - Ih. .óªdf¡l.f£€.
    0020    64 66 A1 6C 04 66 2B 06 80 01 66 50 89 E5 D9 EB - df¡l.f+.€.fP‰åÙë
    0030    D8 C0 DA 4E 00 DE 34 D9 FB BB 7D 01 DE 0F DE 47 - ØÀÚN.Þ4Ùû»}.Þ.ÞG
    0040    FE DF 5E 02 DE 0F DE 47 FE DF 5E 00 5F 69 FF 40 - þß^.Þ.ÞGþß^._iÿ@
    0050    01 58 01 C7 BB 88 01 8B 0F 39 CF 74 C3 30 C0 AA - .X.Ç»ˆ.‹.9ÏtÃ0Àª
    0060    4F 89 3F 89 CF B0 0F AA 31 C0 FE C4 CD 16 74 B0 - O‰?‰Ï°.ª1ÀþÄÍ.t°
    0070    B8 03 00 CD 10 C3 20 00 20 44 04 64 00 4B 00    - ¸..Í.Ã . D.d.K.
    

    'Ungolfed', source version:

    ; golfCrcl.asm
    ;
    ; - 16 bit implementation of an animated pixel that circumscribes a circle.
    ; - 127 bytes .COM file
    ;
    ;   - enhzflep -
    ;   31 Oct 2015 - initial
    ;               - set closest colour to desired #800080
    ;    2/3 Nov 2015 - removed unnecessary instuctions, used BX register to index mem by fpu
    ;               - removed .data section alignment, better register use in curPixel/lastPixel compares and calcs, reusing value of si after palette setting
    [section .text]
    [bits 16]
    [org 0x100]
    EntryPoint:
    ;   mov     fs, bx          ; bx is 0 on entry. Set fs seg register to this
    
        ; set graphics mode 320x200
        mov     al, 0x13
        int     0x10
    
        ; set colour #0 to be as close to the desired one as possible
        ; the vga palette registers are 6 bits by default (some models allow switching to 8 bits)
        ; therefore, we cant represent all of the 16.7m colours that we can in 24bit modes
        ; we're limited to 'just' 64*64*64 = 262,144 (256k) colours. Unfortunately, #800080 is not
        ; a colour we can represent exactly in mode13 or any other mode with 6 bit regs.
        mov     dx, 0x3c9
        mov     cl, dh
        mov     si, desiredCol
        rep     outsb                           ; cx now=0 and si now points to totalTicksNeeded
    
        ; clear the screen to white
        mov     al, 0x0f                        ; index of a colour thats already FF,FF,FF
    ;   xor     cx, cx                          ; cx = 0 - its zeroed by the rep outsb instruction above.
        dec     cx                              ; cx = FFFF
        push    word 0xA000                     ; segment of video memory
        pop     es                              ; pop it into es
        rep     stosb                           ; es:[di] = 0F, inc di, dec cx. If cx != 0 then repeat.
    
        ; setup the timing stuff
        mov     eax, [fs:0x046C]                ; 32 bit value updated at 18.2Hz by bios
        mov     [initialTicks], eax
    
    .drawLoop:
        mov     eax, [fs:0x046C]                ; 32 bit value updated at 18.2Hz by bios
        sub     eax, [initialTicks]             ; eax = curTime-startTime (in increments of 1/18.2 of a second --- 182 = 10 seconds)
    
        push    eax                             ; number of elapsed clock ticks - ready to be loaded by fpu. Also stack space for calc result
        mov     bp, sp                          ; get pointer to last element pushed onto the stack
        fldpi                                   ; st0 = pi
        fadd    st0                             ; st0 = 2pi
        fimul   long [bp]                       ; (currentTick/requiredTicks) * 2pi
    ;   fidiv   word [totalTicksNeeded]
        fidiv   word [si]                       ; si still points to totalTicksNeeded after setting the palette earlier
        fsincos                                 ; st0 = cos(old_st0), st1 = sin(old_st0)
    
        mov     bx, radius
        fimul   word [bx]                       ;   fimul word [radius] -  cos(angle)*radius
        fiadd   word [bx-2]                     ;   fiadd word [origin] -  origin + cos(angle)*radius
        fistp   word [bp+2]                     ; ---- X-coord -------
    
        fimul   word [bx]                       ;   fimul   word [radius]
        fiadd   word [bx-2]                     ;   fiadd   word [origin]
        fistp   word [bp+0]                     ;  ---- Y-coord -------
    
        ;---------------
        pop     di                              ; calculated Y-coord
        imul    di, 320                         ; multiply it by the screen width
        pop     ax                              ; calculated X-coord
        add     di, ax                          ; di = x + (pixels_per_row * y_coord)
    
        mov     bx, lastIndex
        mov     cx, [bx]                        ; get the mem index for the last pixel
        cmp     di, cx                          ; check if we're indexing the same pixel as last time through the loop
        je      .drawLoop                       ; if so, return to start of loop - no need to delete and redraw the pixel in the same spot.
    
        xor     al, al                          ; col index 0
        stosb                                   ; draw our purple pixel
        dec     di                              ; stosb advanced di to the next pixel, undo this (stosb followed by dec di is still shorter than mov es:[di], al)
        mov     [bx], di                        ; save the pixel's mem address
        mov     di, cx                          ; restore index of pixel drawn last time through the loop
        mov     al, 0x0f                        ; pal index of white
        stosb                                   ; erase the last pixel
    
        ; check for a keystroke
        xor     ax, ax
        inc     ah
        int     0x16
        jz      .drawLoop                           ; loop if no keys pressed
    
    .drawingDone:
        ; set text mode 80x25
        mov     ax, 0x3
        int     0x10
    
        ; program exit
        ret                                     ; Dos pushes a 0000 onto the stack and copies CD 20 to offset 0 of our code-seg
                                                ; before it invokes our program. ret jumps back to that CD 20 (int 0x20) instruction
    
    ; Since this is a .COM file, all program, data and stack exist in the same segment. 
    ; Using .text and .data sections only improves program readability - doing so only has minor effects on the binary produced.
    ;
    ; In this case, the assembler word aligns anything in the data section. This may have the effect of adding a padding byte,
    ; which we really dont need/want here. Data is machine-word aligned to improve the speed of access for the hardware. Machine-word
    ; is used to refer to the size of an int. In the case of 16 bit code, this will generally be 16 bits, 32 bit code has 32 bit words
    ; and so on. This code is 16 bit, so things should be aligned to word boundaries for maximum execution speed
    ;
    ;[section .data]
    desiredCol          db  0x80/4, 0x00, 0x80/4        ; palette registers are only 6 bit.
    totalTicksNeeded    dw  1092
    origin              dw  100
    radius              dw  75
    
    ; ticks/second = 18.2
    ; totalTime = 60 seconds
    ; totalTicks = 1092 (18.2 * 60)
    ; degreesPerTick = 360 / 1092 = 0.3296703
    ; timerTicksAddr = 0040:006C (0000:046C) dword
    [section .bss]
    initialTicks    resd    1
    lastTickValue   resd    1
    lastIndex       resw    1
    

    Downloadable, base64 encoded version

    data:application/octet-stream;base64,sBPNELrJA4jxvnYB826wD0loAKAH86pkZqFsBGajgAFkZqFsBGYrBoABZlCJ5dnr2MDaTgDeNNn7u30B3g/eR/7fXgLeD95H/t9eAF9p/0ABWAHHu4gBiw85z3TDMMCqT4k/ic+wD6oxwP7EzRZ0sLgDAM0QwyAAIEQEZABLAA==
    

    Copy and paste this address into your browser. Rename the resulting file golfcrcl.com and run in a DOS environment, i.e DosBox.

    enhzflep

    Posted 2015-10-29T14:27:15.280

    Reputation: 227

    This is great! Tested and works perfectly. – None – 2015-10-30T20:52:18.593

    1Oh snap! Just realized that you specified a colour to use and I totally ignored it. :oops: I'll fix that a little later. The colour index should be 0x5C, instead of 0x09 (assuming dosbox sets the pallette correctly, otherwise, I'll just remap colour 1) – enhzflep – 2015-10-30T21:00:47.030

    5

    SVG, 177 bytes

    <svg><g transform=translate(75,75)><circle id=x r=.5 cx=56 fill=#800080><animateTransform xlink:href=#x attributeName=transform type=rotate to=360 dur=60s repeatCount=indefinite

    Invalid markup from hell to breakfast, but it runs (in Chrome at least). Like a HTML5 canvas, the default size for an SVG appears to be 300x150, so that's what this is assuming.

    Edit: Whoops, I'd accidentally left in a duration of 6 instead of 60. Fixed that, but also found that 0.5 works as just .5, so no change in the byte count.

    Flambino

    Posted 2015-10-29T14:27:15.280

    Reputation: 1 001

    4

    Javascript / Processingjs, 175 173 156 153 152 bytes

    var s=256,e,h,m;void setup(){size(s,s);h=s/2;}void draw(){background(-1);m=-millis()*(PI/36000);stroke(h,0,h);e=s/2*0.75;point(h+sin(m)*e,h+cos(m)*e);}
    

    To run : either visit http://www.openprocessing.org/sketch/226733 to see it in action using processing.js, or download processing 2.0 from processing.org, paste the code into the processing IDE, select Javascript mode and watch it go.

    Timothy Groote

    Posted 2015-10-29T14:27:15.280

    Reputation: 245

    Lol, you posted Processing 20 seconds before me. – PurkkaKoodari – 2015-10-29T14:51:34.387

    Is the header wrong in this answer? It doesn't show up in the leaderboard. – None – 2015-10-29T14:56:25.897

    @Lembik i missed a comma. fixed now, thanks :) – Timothy Groote – 2015-10-29T15:02:56.943

    Thanks. Did you implement the 60 seconds part of the question? – None – 2015-10-29T15:05:50.530

    1Missed that, i'm on it now. – Timothy Groote – 2015-10-29T15:08:59.857

    1it should now meet the 60 seconds requirement – Timothy Groote – 2015-10-29T15:44:12.347

    1background(-1) is one byte shorter than background(255) – user41805 – 2017-04-23T15:25:01.867

    @KritixiLithos i had no idea that worked. awesome! – Timothy Groote – 2017-04-24T13:32:20.860

    @TimothyGroote If you want to know, here is the answer that contains this tip

    – user41805 – 2017-04-24T16:30:00.510

    4

    Mathematica 208 185 139 bytes

    Moves a purple pixel around an array used as an Image.

    Method 1 139 bytes

    n=900;Dynamic@Refresh[t=DateValue@"Second";ReplacePixelValue[Image@Array[1&,{n,n}],
    400{Cos[z=Pi/30t],Sin@z}+450->Purple],UpdateInterval->1]
    

    Method 2 154 bytes

    Plots a pixel along a circular path in 60 seconds.

    Dynamic@Refresh[t=DateValue@"Second";Graphics[{AbsolutePointSize@.01,Purple, 
    Point[{Cos[z=Pi/30t],Sin@z}]},PlotRange->1,ImageSize->Full],UpdateInterval->1]
    

    Method 3 193 bytes

    This draws a clock, with ticks and labels in white, for which the second hand is a pixel.

    Dynamic@Refresh[ClockGauge[AbsoluteTime[],TicksStyle->White, 
    GaugeMarkers->{None,None,Graphics[{White,Disk[],Purple, 
    AbsolutePointSize[.01],Point@{3,0}}]},PlotTheme->"Minimal"],UpdateInterval->1]
    

    DavidC

    Posted 2015-10-29T14:27:15.280

    Reputation: 24 524

    I see, basic LTR confusion... But anyways, you can remove the space between 30 and t. – LegionMammal978 – 2015-11-01T12:36:46.493

    4

    C#, 379 365 bytes

    using System.Windows.Forms;using static System.Math;class P:Form{static void Main(){var f=new P();var p=new PictureBox();f.SetBounds(0,0,1000,1000);f.Controls.Add(p);f.Show();for(var i=0d;;i+=PI/3000){p.SetBounds((int)(Cos(i)*375+500),(int)(Sin(i)*375+500),1,1);p.CreateGraphics().Clear(System.Drawing.Color.FromArgb(-8388480));System.Threading.Thread.Sleep(10);}}}
    

    Depends on System.Windows.Forms and System.Drawing to run. Output is in a 1000x1000 window.

    LegionMammal978

    Posted 2015-10-29T14:27:15.280

    Reputation: 15 731

    Can save some bytes using var – pinkfloydx33 – 2015-10-31T11:06:11.703

    Save another byte using static import on system math – pinkfloydx33 – 2015-10-31T12:51:58.523

    you can declare your code in the System namespace and remove all other references to system and save i think 10 bytes – None – 2017-09-28T22:50:00.597

    4

    Obj-C++ / Cocoa, 777 678 668 657 643 628 bytes

    #include <Cocoa/Cocoa.h>
    float r;@implementation V:NSView-(void)drawRect:(NSRect)d{CGContext*c=(CGContext*)NSGraphicsContext.currentContext.graphicsPort;CGContextSetRGBFillColor(c,.5,0,.5,1);CGContextFillRect(c,(CGRect){cos(r)*38+50,sin(r-=pi/300)*38+50,1,1});[NSTimer scheduledTimerWithTimeInterval:.1 target:self selector:@selector(x)userInfo:0 repeats:0];}-(void)x{self.needsDisplay=1;}@end
    int main(){NSRect b={0,0,100,100};NSWindow*w=[[NSWindow alloc]initWithContentRect:b styleMask:1 backing:2 defer:0];[w orderFront:0];w.backgroundColor=[NSColor whiteColor];w.contentView=[[V alloc]initWithFrame:b];[NSApp run];return 0;}
    

    So this is probably the worst way to do anything, but I figured I'd try.

    Can be compiled on a Mac (mine anyway) with g++ -framework Cocoa file.mm and run from the terminal (ctrl-C to quit, since it's not an app).

    screenshot

    Edit: Saved 99 bytes: Fixed main() to run on OS X 10.10 (1st version only ran on 10.8), skipped translate/rotate in favor of plain trig calculations, stopped bothering with window placement, and other small stuff.

    Edit: Saved another 10 bytes: Changed to just orderFront to display the window. Doesn't actually make it the front window, though, but neither did orderFrontAndMakeKey, so...

    Edit: Saved another 11 bytes: Skipped NSMakeRect and found a digit that just had to go.

    Edit: Saved another 14 bytes: Didn't need to assign the NSTimer instance to anything, and can apparently skip initializing r to zero.

    Edit: Saved another 15 bytes: I can't stop. Send help.

    Flambino

    Posted 2015-10-29T14:27:15.280

    Reputation: 1 001

    Thank you. Obj-C++ is the clear winner in the longest shortest code competition currently! – None – 2015-11-01T19:48:50.653

    14+1 for also winning the most animated non-animated image competition. – Lynn – 2015-11-01T19:52:07.007

    3

    Elm, 274 bytes

    import Color exposing (..)
    import Graphics.Collage exposing (..)
    import Time exposing (..)
    main=Signal.map((\t->collage 200 200 [move(75*cos(-2*pi*t/60),75*sin(-2*pi*t/60))(filled(rgb 128 0 128)(circle 2)),outlined(solid black)(square 200)])<<inSeconds)(every(0.01*second))
    

    Try or edit it in your browser:

    Note that if we get rid of the imports and drawing the outline around the canvas, we're down to 149 bytes, but that's probably cheating!

    jmite

    Posted 2015-10-29T14:27:15.280

    Reputation: 271

    Whoops, fixed! I got impatient during testing – jmite – 2015-10-30T06:01:47.987

    1This is very nice and it's great to get something in a functional language. We just need Haskell and Scala now! – None – 2015-10-30T09:48:03.400

    2@Lembik I just added a Haskell version – Frerich Raabe – 2015-10-30T11:38:12.547

    3

    Python 2 + Pygame, 221 198 193

    exec'from %s import*;'*3%('math','pygame','time')
    _,p,D=[255],128,display
    S=D.set_mode(_*2)
    while 1:S.fill(_*3);S.set_at(map(lambda f:int(p+f(pi*(time()%60)/30)*96),(cos,sin)),(p,0,p));D.flip()
    

    dieter

    Posted 2015-10-29T14:27:15.280

    Reputation: 2 010

    1Pythontastically awesome! – None – 2015-10-31T10:37:22.883

    Now we just need a python+turtle solution too. – None – 2015-10-31T14:35:05.667

    3

    C#, 301 bytes

    using System.Windows.Forms;using System.Drawing;class P:Form{static void Main(){Application.Run(new P());}P(){Paint+=(o,e)=>{var g=e.Graphics;g.Clear(Color.White);g.TranslateTransform(150,150);g.RotateTransform(System.DateTime.Now.Second*6);g.FillRectangle(Brushes.Purple,105,0,1,1);Invalidate();};}}
    

    Depends on default size metrics; size and position may be a bit off depending on a number of factors. May or may not flicker horribly; to solve that, add the following:

    SetStyle(ControlStyles.OptimizedDoubleBuffer|ControlStyles.AllPaintingInWmPaint,true);
    

    user12864

    Posted 2015-10-29T14:27:15.280

    Reputation: 151

    3

    Lua + Löve, 189 characters

    t=0
    m=math
    l=love
    g=l.graphics
    function l.update(d)t=t+d end
    function l.draw()a=t*m.pi/30
    g.setBackgroundColor(255,255,255)g.setColor(127,0,127)g.point(400+225*m.cos(a),300+225*m.sin(a))end
    

    love.update() receives as parameter the time elapsed since previous frame. Draws in the default 800 x 600 window at fixed coordinates, as the window is not resizable anyway.

    manatwork

    Posted 2015-10-29T14:27:15.280

    Reputation: 17 865

    The first lua answer! Thank you. – None – 2015-10-31T15:40:10.040

    3

    C (using SDL1.2), 237 233

    #include <SDL.h>
    #define P(f)(int)(128+96.0*f(3.14*((int)(.001*SDL_GetTicks())%60)/30))
    main(){SDL_Surface*s=SDL_SetVideoMode(255,255,32,0);while(1){int*p=s->pixels;memset(p,255,260100);p[P(cos)+s->w*P(sin)]=0x800080FF;SDL_Flip(s);}}
    

    Compiles & run using gcc -I/usr/include/SDL snippet.c -lSDL -lm && ./a.out

    dieter

    Posted 2015-10-29T14:27:15.280

    Reputation: 2 010

    Awesomely great! I thought no one would do it. – None – 2015-11-01T13:36:08.157

    2

    Tcl/Tk, 174

    grid [canvas .c -bg #FFF -he 202 -w 202]
    .c cr r 0 0 0 0 -outline #800080 -t p
    while 1 {after 167;incr A;.c coo p [lmap r {cos sin cos sin} {expr 75*$r\($A/57.3)+77}]
    update}
    

    Tcl/Tk, 168

    grid [canvas .c -bg #FFF -he 202 -w 202]
    .c cr o 0 0 0 0 -f #800080 -t p
    while 1 {after 167;incr A;.c coo p [lmap r {cos sin cos sin} {expr 75*$r\($A/57.3)+77}]
    update}
    

    Tcl/Tk, 172

    grid [canvas .c -bg #FFF -he 202 -w 202]
    set p [.c cr o 0 0 0 0 -f #800080]
    while 1 {after 167;incr A;.c coo $p [lmap r {cos sin cos sin} {expr 75*$r\($A/57.3)+77}]
    update}
    

    Tcl/Tk, 173

    grid [canvas .c -bg #FFF -he 202 -w 202]
    set p [.c cr o 0 0 0 0 -f #800080]
    while 1 {after 167;incr A;.c coo $p [lmap r {1.57 0 1.57 0} {expr 75*sin($A/57.3+$r)+77}]
    update}
    

    Tcl/Tk, 195

    proc P {y\ 0} {expr 75*sin($::A/57.3+($y?0:1.57))+77}
    grid [canvas .c -bg #FFF -he 202 -w 202]
    set p [.c cr o 0 0 0 0 -f #800080]
    while 1 {after 167;incr ::A;.c coo $p [P] [P 1] [P] [P 1]
    update}
    

    Tcl/Tk, 204

    proc P {A y\ 0} {expr 75*sin($A/57.3+($y?0:1.57))+77}
    grid [canvas .c -bg #FFF -he 202 -w 202]
    set p [.c cr o 0 0 0 0 -f #800080]
    while 1 {after 167;.c coo $p [P [incr A]] [P $A 1] [P $A] [P $A 1]
    update}
    

    Tcl/Tk, 210

    proc P {A y\ 0} {expr 75*[expr $y?"sin":"cos"]($A/57.3)+77}
    grid [canvas .c -bg #FFF -he 202 -w 202]
    set p [.c cr o 0 0 0 0 -f #800080]
    while 1 {after 167;.c coo $p [P [incr A]] [P $A 1] [P $A] [P $A 1]
    update}
    

    Tcl/Tk, 214

    proc P {A y\ 0} {expr 75*[expr $y?"sin":"cos"]($A*3.14/180)+77}
    grid [canvas .c -bg #FFF -he 202 -w 202]
    set p [.c cr o 0 0 0 0 -f #800080]
    while 1 {after 167;.c coo $p [P [incr A]] [P $A 1] [P $A] [P $A 1]
    update}
    

    enter image description here

    sergiol

    Posted 2015-10-29T14:27:15.280

    Reputation: 3 055

    Instructions for running: create the file pixround.tcl, paste my code and then save. Then on your graphical environment,open a console, go to the file you created's directory and type wish pixround.tcl and you should see the see pixel doing its round trip. – sergiol – 2017-09-29T01:07:59.227

    I run your 168-byte code with Tk 8.6.6. I see a black pixel instead of a purple one. Your screenshot also has a black pixel. I checked by using xmag to magnify the pixel. – kernigh – 2017-11-26T22:35:33.057

    1@kernigh: fixed. At the expense of some bytes. – sergiol – 2017-11-26T23:23:00.670

    2

    ActionScript 2.0, 151 bytes

    Unfortunately, Adobe Flash isn't freeware, and Google informs that it doesn't work on Linux without a VM or Wine (and even with Wine, it only mostly works). Still, I wanted to see how well it would do on this task. Pretty well, it turns out.

    createEmptyMovieClip("p",0)
    p._x=p._y=r=200
    p.beginFill(0x800080)
    p.moveTo(r,0)
    p.lineTo(r-1,0)
    p.lineTo(r,1)
    onEnterFrame=function(){p._rotation+=.25}
    

    The basic idea: create a new movie clip object, position it at (200, 200), and then draw a dot2 in it 200 pixels farther right. Now the movie clip is 200 pixels wide and 1 pixel high. The pivot point is the original coordinates where we started, so when we modify the _rotation property, the dot moves in a circle around the point (200, 200). Conveniently, _rotation is in degrees; 0.25 degrees/frame * 24 frames/second * 60 seconds/minute = 360 degrees/minute.

    To run from scratch if you have Flash, create a new Flash document1, open the Actions panel, and paste the above code. No further customization is required, assuming the default white background, 550x400 canvas, and 24 fps. Hit Ctrl-Enter and watch it go.

    If you don't have Flash itself, you can still view the results with the free Flash Player, which should come with most modern browsers. Download the SWF file here. If you can't play it, try downloading this HTML page as well and opening it, with the SWF file in the same directory.

    1 Tested on Adobe Flash CS4 Professional, choosing "Flash File (ActionScript 2.0)" when asked what type of new file to create.

    2 Actually a small triangle, as you'll see if you zoom in on it enough. It was the golfiest way I could find to draw a dot.

    DLosc

    Posted 2015-10-29T14:27:15.280

    Reputation: 21 213

    2

    JavaScript w/jQuery, 205 bytes

    y=75;with($('<canvas/>').appendTo(document.body)[0].getContext('2d')){fillStyle='#800080';translate(y,y);(f=function(){clearRect(-y,-y,y*2,y*2);fillRect(0,56,1,1);rotate(Math.PI/300);setTimeout(f,100)})()}
    

    jsfiddle, snippet below

    This is maybe not quite by the book. The default size of a canvas (in Chrome at least) is 300x150, so I've centered the circle on 75x75. I could center it on 150x75, and make its radius 113px (~75% of width), but it'd be outside the canvas some of the time, so I chose ~75% of height instead.

    But it's not particularly short anyway, so meh'

    y=75;with($('<canvas/>').appendTo(document.body)[0].getContext('2d')){fillStyle='#800080';translate(y,y);(f=function(){clearRect(-y,-y,y*2,y*2);fillRect(0,56,1,1);rotate(Math.PI/300);setTimeout(f,100)})()}
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>

    Flambino

    Posted 2015-10-29T14:27:15.280

    Reputation: 1 001

    2

    Blitz 2D/3D, 126 bytes

    Graphics 180,180
    ClsColor 255,255,255
    Color 128,0,128
    While 1
    Cls
    ang#=ang+3
    Plot 90+67*Cos(ang),90+67*Sin(ang)
    Delay 500
    Wend
    

    Unfortunately, this language is only supported on Windows (though it may run in Wine).

    El'endia Starman

    Posted 2015-10-29T14:27:15.280

    Reputation: 14 504

    2

    Javascript ES6, 202 bytes

    a=0;with((D=document).body.appendChild(D.createElement`canvas`).getContext`2d`)with(Math)setInterval((f=t=>t(a+=PI/6e3)*60+75)=>fillRect(f(cos,clearRect(0,0,150,150),fillStyle=`#800080`),f(sin),1,1),10)
    

    Tested in Firefox 41.

    Like the other (almost) pure Javascript answer, the circle is centered at 75x75 since the canvas elements default size is 300x150 as defined by the HTML specs.

    Dendrobium

    Posted 2015-10-29T14:27:15.280

    Reputation: 2 412

    2

    Matlab, 141 136

    I just submit this for you, Lembik, to have a complete list.

    v=-100:100;
    [y,x,m]=ndgrid(v,v,0);
    n=75;
    while 1;
        pause(1);
        c=m;
        c(x+i*y==round(n))=1;
        imshow(c);
        colormap([1,1,1;.5,0,.5]);
        n=n*exp(pi*i/30);
    end
    

    Old version:

    v=-100:100;
    [x,y,m]=ndgrid(v,v,0);
    while 1;
    c=m;
    c(x+i*y==round(75*(-1)^(s/30)))=1;
    imshow(c);
    colormap([1,1,1;.5,0,.5]);
    s=mod(s-1,60);
    pause(1);
    end
    

    flawr

    Posted 2015-10-29T14:27:15.280

    Reputation: 40 560

    2

    PHP, 291 295 bytes

    I don't know whether this qualifies, but here is something:

    function d($y,$a){$s=strrev(str_pad("
    ",140));echo"\033[0G".str_repeat($s,abs($y-30)).str_pad("\033[35m■",80+$a*sqrt(abs(pow(30,2)-pow($y,2)))*2,' ',STR_PAD_LEFT)."
    ".str_repeat($s,abs(30+$y))."\033[120A";usleep(5e5);}for(;;){for($y=30;$y>-30;--$y)d($y,1);for($y=-30;$y<=30;++$y)d($y,-1);}
    

    Runs as a PHP-file from command line, like:

    php what_is_this.php
    

    In Action

    This examples GIF runs 10 times faster than the original code (usleep(5e4) instead of usleep(5e5)):

    enter image description here


    Notes

    • As I can't output one single pixel, I supersized it to this .
    • One cycle should be approx. 1 minute.
    • Yes, your whole console output is purple. ;)
    • You need a large terminal window. If you're on OS X zoom out at least one or two times using CMD + - (Restore using CMD + 0).
    • It doesn't know anything about 75%. Could be simulated by adding blank lines before and after the output.

    Yes, it is rounding heavily and yes I think this can be golfed more, but I'm too tired right now. :)


    Ungolfed

    function d($y,$a){
        $s = strrev(str_pad("\n",140));
        echo "\033[0G";
        echo str_repeat($s, abs($y-30));
        echo str_pad("\033[35m■", 80 + $a * sqrt(abs(pow(30,2) - pow($y,2)))*2,' ', STR_PAD_LEFT) . "\n";
        echo str_repeat($s, abs(30+$y));
        echo "\033[120A";
        usleep(500000);
    }
    
    for(;;){      
        for($y = 30; $y > -30; --$y) {
            d($y,1);
        }
        for ($y = -30; $y <= 30; ++$y) {
            d($y,-1);
        }
    }
    

    Edits

    • Saved 4bytes by throwing some {} over board.

    insertusernamehere

    Posted 2015-10-29T14:27:15.280

    Reputation: 4 551

    A PHP solution! I thought it would never come :) – None – 2015-10-31T08:20:12.490

    1

    SmileBASIC, 70 bytes

    G=99@L
    A=A+1745E-6GCLS
    GPSET G+COS(A)*G,G+G*SIN(A),#PURPLE
    WAIT
    GOTO@L
    

    Luckily #PURPLE is exactly FF800080
    1745E-6 is an approximation of 2pi/(60*60)

    12Me21

    Posted 2015-10-29T14:27:15.280

    Reputation: 6 110

    1

    LOGO, 58 bytes

    A language of turtle graphics.

    settimer 1 50[setpixel 7 arc2 .3 99 setpixel "purple]ht pu
    

    Unfortunately, I can't find any webpage (LOGO interpreter) support settimer, and this one does not support turtle-graphics. However you can download UCBLogo or FMSLogo and test.

    Alternatively, this version is compatible with JSLogo (which can be try online):

    setpc "purple
    forever[pe setpensize 9 bk 99 rt 1 fd 99 ppt setpensize 1 fd 0 wait 10]
    

    Because the pixel almost can't be seen, you can use this version instead:

    setpc "purple
    forever[pe setpensize 9 bk 99 rt 1 fd 99 ppt setpensize 5 fd 0 wait 1]
    

    Which increases the pixel size and make it moves 10x faster.


    Explanation:

    settimer 1 50[   For each 50 millisecond, do:
    setpixel 7       Set the color under the turtle to white (color 7). Alternatively: "white (6 bytes) or [255 255 255] (too many bytes)
    arc2 .3 99       Rotate 0.3 degrees around a circle with radius 99
    setpixel "purple Set the pixel under the turtle to purple (800080).
                     Color magenta (FF00FF, if allowed) would takes much less bytes (just 1 bytes: "5")
    ]                End instruction-list.
    ht               Hide the turtle. Avoid drawing the turtle on the screen together with the pixel.
    pu               Pen-up. Avoid the turtle leave a trail while moving.
    

    user202729

    Posted 2015-10-29T14:27:15.280

    Reputation: 14 620

    1

    Pascal (FPC), 216 bytes

    Uses Graph,Crt;Var
    a:Real;b,c:integer;Begin
    b:=0;
    InitGraph(b,c,'');SetRGBPalette(1,$80,0,$80);repeat
    a:=a+Pi/500;b:=Trunc(60+50*sin(a));c:=Trunc(60+50*cos(a));PutPixel(b,c,1);Delay(60);PutPixel(b,c,0);until 1<0
    End.
    

    Ungolfed code and explanation here on TIO. Can't run on TIO, however.

    user202729

    Posted 2015-10-29T14:27:15.280

    Reputation: 14 620

    Need <s> Pascal now. – user202729 – 2017-10-30T04:34:01.897

    1

    Ruby+RMagick+FFmpeg, 203 bytes

    include Magick
    a=ImageList.new
    600.times{|i|Draw.new.fill('purple').translate(80,80).rotate(i*0.6).point(60,0).draw(a.new_image(160,160))}
    a.delay=10
    a.write'c.gif'
    system'ffplay -loop 0 c.gif'
    

    Run with ruby -rrmagick circle.rb; I count 193 bytes in the file, plus 10 bytes to edit ruby circle.rb into ruby -rrmagick circle.rb. This is longer than Ruby with Shoes (134 bytes).

    Before running this program, you must install ImageMagick, ffmpeg, ruby, then run gem install rmagick. Ubuntu user would need some dev packages. The program takes a few minutes to save the c.gif file, then displays it in ffplay's window. It leaves c.gif in the current directory.

    Commented version

    require 'rmagick'
    include Magick  # for Magick::ImageList, Magick::Draw
    
    # Draw 600 frames.
    a = ImageList.new
    600.times {|i|
      Draw.new
        .fill('purple')     # Set fill color to #800080.
        .translate(80, 80)  # Move origin to center of circle.
        .rotate(i * 0.6)    # Rotate axes by 0...360 degrees.
        .point(60, 0)       # Draw pixel in fill color.
        .draw(a.new_image(160, 160))
      # Draw image of 160x160 pixels on the default white background.
    }
    
    # Set delay between frames to 10 ticks.
    # By default, 100 ticks = 1 second.
    # Therefore, 600 frames at 10 ticks = 60 seconds.
    a.delay = 10
    
    a.write 'c.gif'
    system 'ffplay -loop 0 c.gif'
    

    If I use a.animate, then RMagick displays the animation in its own window, but the timing is too slow. The circle takes about 66 seconds, not the correct 60 seconds.

    To get the correct timing, I must add 36 bytes by deleting a.animate and adding code to save a .gif and display it in another program. If I run firefox c.gif or chrome c.gif, the timing is correct, but the white box of 160x160 pixels appears in the center of a much larger window, so the circle seems too small in the window. I run ffplay -loop 0 c.gif to get both the correct timing and the correct window size.

    ImageMagick also comes with shell commands, so it might be possible to translate this answer into shell script, but I have not done so.

    kernigh

    Posted 2015-10-29T14:27:15.280

    Reputation: 2 615

    1

    Processing, 101 100 bytes

    float r;void draw(){background(-1);translate(50,50);stroke(#800080);rotate(r+=PI/1800);point(0,38);}
    

    Instead of the sin/cos calculations, this uses the translate and rotate methods. Funnily enough, it ends up being 101 bytes just like Pietu1998's Processing code.1

    I wish rotate calls would stack so I could skip r, but the transformation matrix is reset on each frame. Boo.

    1: Well, at the time of writing it's the same, but there are 4 bytes to be saved in Pietu1998's, so it wins.

    Edit: Saved a byte thanks to Kritixi Lithos

    Flambino

    Posted 2015-10-29T14:27:15.280

    Reputation: 1 001

    background(-1) is one byte shorter than background(255) – user41805 – 2017-04-23T15:22:23.010

    @KritixiLithos Thanks - updated this answer as well as the other one you commented on – Flambino – 2017-04-23T15:52:58.597

    1

    javascript/html/css 343 202 182

    s=document.getElementById('c').style
    i=0
    setInterval(function(){s.left=52+50*Math.cos(i+=.005)+'px'
    s.top=52+50*Math.sin(i)+'px'},50)
    b{color:#800080;position:absolute}
    <b id=c>.</b>

    wolfhammer

    Posted 2015-10-29T14:27:15.280

    Reputation: 1 219

    If you look at the question or the other answers you will see how to set out the headers so your result can be put in the leaderboard. Having said that I think it is buggy currently. The dot jumps from one side to the other at least using the code snippet. – None – 2015-10-30T20:32:43.773

    You can save 4 bytes by dropping the var keyword and space. Globals are ok for golfing – Flambino – 2015-10-31T10:26:14.657

    There are a couple of other minor changes which can reduce the code size: http://pastebin.com/1GPCA227 (By the way, the color code should be #800080.)

    – manatwork – 2015-10-31T12:09:21.397

    1

    GLSL (Shadertoy), 180 165 142 bytes

    void mainImage(out vec4 a,in vec2 b){float r=-iGlobalTime/9.55;a=floor(vec2(cos(r),sin(r))*135.+vec2(180))==floor(b)?vec4(.5,0,.5,1):vec4(1);}
    

    Try it out by pasting it here. Can't golf the built-in variables unfortunately.

    I have never written anything WebGL/OpenGL, but I figured why not? Seems to work, but it's probably horrible.

    Edit 1: Saved 15 bytes by skipping a variable, though it means the circle is no longer centered horizontally in the canvas, just offset the same as it is vertically.

    Edit 2: Saved 23 bytes by also making it resolution dependent. Shadertoy's canvas is 640x360 by default.

    Flambino

    Posted 2015-10-29T14:27:15.280

    Reputation: 1 001

    @Lembik You're welcome - it's a neat challenge! Plus, I got to flail helplessly about in a language I've never tried - fun! :) – Flambino – 2015-10-31T14:58:22.500

    1

    Matlab, 104 103 102 bytes

    figure('Color','w');while 1;plot(3*exp(toc*pi/30i),'Co',[.5 0 .5]);axis([-4 4 -4 4],'off');drawnow;end
    

    Smallest I could get it with the colour requirements. If you had gone for magenta rather than purple it would be 12 bytes shorter :).

    figure('Color','w');                        %Start with a white background
    while 1
             3*exp(toc*pi/30i)                  %This bit makes the point - e^(theta/i)
        plot(                 ,'Co',[.5 0 .5]); %This plots it
        axis([-4 4 -4 4],'off');                %Make the axis 33% larger than the circle and invisible
        drawnow;                                %Update within the loop
    end
    

    Basically it creates a figure which has a white background. Then in a forever loop it plots a figure which is a single point of a complex number which has a magnitude of 3 and an angle of the current time normalised to a 60 second circle. The colour of the plotted point is purple (#7f007f). Once plotted, the axis are set to limits of +/-4 which means the circle drawn will be 75% of the axis size. The axes are then turned off (made invisible) and the figure updated. This gives a nice point moving around a circle in real time.

    I've corrected the code so that it rotates clockwise (it was going anticlockwise before) and in the process saved a byte :). The wonders of -j*n = n/j.

    Tom Carpenter

    Posted 2015-10-29T14:27:15.280

    Reputation: 3 990

    1

    VB.NET, 361 395 452 bytes

    Thanks @ClickRick for pointing out all the unnecessary white-space :-)

    Module m
    Sub Main()
    Dim f As New Form
    f.BackColor=Color.White
    f.MinimumSize=New Size(100,100)
    f.ClientSize=New Size(100,100)
    AddHandler f.Paint,Sub(r,g)
    Dim u=Date.Now.Ticks/10000000/9.55,k=CInt(Cos(u)*37.5+37.5),l=CInt(Sin(u)*37.5+37.5)
    g.Graphics.FillRectangle(Brushes.Magenta,k,l,1,1)
    f.Invalidate()
    End Sub
    Application.Run(f)
    End Sub
    End Module
    

    This is a console application that creates a form. This saves a lot of designer generated clutter.

    Add a reference to System.Drawing.dll and System.Windows.Forms.dll. Add user Imports for System.Drawing, System.Windows.Forms and System.Math namespaces.

    I shamelessly ripped the position calculation from Mauris' QB64 answer (https://codegolf.stackexchange.com/a/62126/20520), but based the calculation on Date.Now.Ticks instead, which needs to be converted to seconds by dividing by 10 million!

    The form is refreshed by a timer and the dot is painted directly to the form in its Paint event. This saves a lot of initialization code for any picturebox or similar.

    From user12864's answer in C# (https://codegolf.stackexchange.com/a/62433/20520) I got the idea of invalidating the form in its own paint handler, which is a horrible thing to do but gets rid of any need for a timer. The timer solution looked a lot prettier due to all the flickering induced by this solution...but length over style in Code Golf I guess :-)

    Unfortunately, the forms have a larger default MinimumSize than 100,100, which needs to be adjusted to fullfill the requirement. You also need to set ClientSize instead of Size to correctly scale the "active" drawing surface.

    Believe it or not, GDI+ does not have a simple DrawPoint function. You draw a point by drawing a filled 1x1 rectangle.

    Application.Run() starts the message loop for the form and shows it.

    Jens

    Posted 2015-10-29T14:27:15.280

    Reputation: 191

    34 redundant spaces. Gotta love auto-format :D – ClickRick – 2015-11-02T14:06:21.647

    @ClickRick Wups, yeah you're right about that. First code-golf submission, it shows I guess ;-) – Jens – 2015-11-02T14:35:27.167

    1

    SpecBAS, 103 bytes

    1LET r=SCRh*.75/2,a=0:DO:PLOT INK 3;r*COS a+SCRw/2,r*SIN a+SCRh/2:INC a,TAU/60000:WAIT SCREEN:CLS:LOOP
    

    INK 11 in SpecBAS isn't quite the right colour but it's close. Other than that, this is pretty standard stuff. A single pixel isn't easy to see on an 800x480 screen though!

    ZXDunny

    Posted 2015-10-29T14:27:15.280

    Reputation: 39

    1Sinclair BASIC! We are close to the source now... :) – None – 2015-11-02T12:18:42.327

    1I wrote an interpreter a while ago (actually still am) and I'm always looking out for fun stuff to do with it - this site is an absolute goldmine :) – ZXDunny – 2015-11-03T13:09:52.680

    1

    Python 2, 173 bytes

    exec"from %s import*;"*3%("time","math","turtle")
    color("#800080")
    pu()
    shape("square")
    shapesize(.1)
    while 1:r=screensize()[0]*.75;a=-time()%60/9.55;goto(r*cos(a),r*sin(a))
    

    Here's an answer which uses the turtle module. Unfortunately I can't remember how big the turtle's square pen is, so I hope I scaled it down right (I'm passing .1 into shapesize).

    As a bonus, here's an invalid 163 byte version which skips out on the math module but the turtle blinks a lot:

    from time import*
    from turtle import*
    color("#800080")
    pu()
    shape("square")
    shapesize(.1)
    speed(0)
    while 1:ht();home();rt(time()%60*6);fd(screensize()[0]*.75);st()
    

    Sp3000

    Posted 2015-10-29T14:27:15.280

    Reputation: 58 729

    Turtles all the way down! – None – 2015-11-02T17:06:17.070

    1

    Qt Quick via qmlscene, 315

    import QtQuick 2.5
    Rectangle {id:p;visible:true;property double t: 0.0; Rectangle{width: 4;y: p.height / 2 + .75*p.height/2*Math.sin(p.t);x: p.width / 2 + .75*p.height/2*Math.cos(p.t);height: 4;color: "#800080"}NumberAnimation {target: p;property: "t";from: 0; to:3.14159*2;duration: 60000;loops: -1;running: true}}
    

    Ariel M.

    Posted 2015-10-29T14:27:15.280

    Reputation: 111

    Another language I had never heard of! Thank you. – None – 2015-11-07T07:13:41.143

    1

    Progress ABL, character Interface, 445 bytes

    A couple of comments:

    I have no way in ABL to really work with pixels. It could possibly be done by creating a rectangle that's 1 x 1 pixel and moving it around. But even that would be cumbersome. Instead I choose to use a period character (.): hence this solution is for character interface and not a graphic client. Maybe I'll come back with a graphical solution some other time...

    Since the space of one character is higher than it is wide I've set the screen size to 65 columns by 20 rows. Roughly estimating a square.

    Purple colour is another problem. From start I'm limited to 16 preset colors and none match the purple I need. Changing the colors in character mode is done by editing a init file used when starting the program. Therefore I instead set the period to "color 13" - 255,0,255 by default. Not the wanted purple but at least a purple color.

    Another dilemma is the absence of sine and cosine functions or anything remotely like that (rotate etc). To bypass this I choose to call an external Windows DLL - meaning this specific solution only works in Windows environments. However if there are any similar Linux libraries available it should be easy enough to port.

    Of course I've been "inspired" by solutions in other languages to pull this off...

    My main ways of reducing size:

    • Shortening certain statements, ie DISP instead of DISPLAY.
    • Global definitions (preprocessors).
    • Whitespace and line breaks

    This is my first attempt at Golf so I might very well be doing something wrong here - like byte count or otherwise. Please tell me if so!

    Solution:

    &GLOB v DEF VAR
    &GLOB e EXTERNAL "MSVCRT40.DLL" CDECL: 
    PROCE cos {&e} DEF INPUT PARAM v AS DO. DEF RETURN PARAM r AS DO. END. PROCE sin {&e} DEF INPUT PARAM v AS DO. DEF RETURN PARAM r AS DO. END. {&v} c AS C FORM "x". {&v} t AS DE. {&v} i AS DE. {&v} j AS DE. c=".". REPEAT: t=t - 0.1. DISP c NO-LABEL WITH FRAM f SIZE 65 BY 20. c:FGC=13. RUN cos(T, OUTPUT i). RUN sin(t, OUTPUT j). c:ROW=10 + i * 7.5. c:COLUMN=30 + j * 26.3. PAUSE 1. END
    

    Ungolfed:

    &GLOBAL-DEFINE v DEFINE VARIABLE
    &GLOBAL-DEFINE e EXTERNAL "MSVCRT40.DLL" CDECL: 
    
    
    PROCEDURE cos {&e} 
        DEFINE INPUT PARAM v AS DOUBLE. 
        DEFINE RETURN PARAM r AS DOUBLE. 
    END. 
    
    PROCEDURE sin {&e} 
        DEF INPUT PARAM v AS DOUBLE. 
        DEF RETURN PARAM r AS DOUBLE. 
    END. 
    
    {&v} c AS CHARACTER FORMAT "x". 
    {&v} t AS DECIMAL. 
    {&v} i AS DECIMAL. 
    {&v} j AS DECIMAL. 
    
    c = ".". 
    
    REPEAT: 
        t = t - 0.1. 
        DISPLAY c NO-LABEL WITH FRAM f SIZE 65 BY 20. 
        c:FGCOLOR = 13. 
        RUN cos(T, OUTPUT i). 
        RUN sin(t, OUTPUT j). 
        c:ROW = 10 + i * 7.5. 
        c:COLUMN = 30 + j * 26.3. 
        PAUSE 1. 
    END
    

    (All lines normally end with period or colon (colon for start of blocks) but the compiler lets this slip on the very last line...)

    The preprocessor statements are basically pre run/compile replacements so {&v} in the part {&v} t AS DE. is replaced with DEF VAR rewriting the entire line to

    DEF VAR t AS DE. 
    

    Jensd

    Posted 2015-10-29T14:27:15.280

    Reputation: 111

    0

    Haskell 265 bytes

    Runs in a terminal and prints a @ which changes position.

    It takes about 64 seconds to do a full loop but 999999 can be changed to fix this. If someone can be bothered working out the right number then feel free to change it.

    import Control.Concurrent
    f _ _ _ 0=[]
    f a 0 x y=(g a x)++f a(-1)x(y-1)
    f a b x y="\n"++f a(b-1)x(y-1)
    g _ 0="\n"
    g 0 x="\27[1;35m@"++g(-1)(x-1)
    g a x=' ':g(a-1)(x-1)
    main=h 0
    h i=threadDelay 999999>>putStrLn(f(round$(sin i)*w+w)(round$(cos i)*w+w)(w*2+1)(w*2+1))>>h(i+0.1)
    

    HEGX64

    Posted 2015-10-29T14:27:15.280

    Reputation: 313

    1Pretty sure an @ doesn't count as a purple pixel. – nwp – 2015-11-01T11:07:44.180

    It certainly doesn't. – None – 2015-11-01T11:18:52.317

    True, but nor does https://codegolf.stackexchange.com/a/62124/19083. It all depends on your terminal font anyway.

    – HEGX64 – 2015-11-02T22:39:24.057