Our server costs ~$56 per month to run. Please consider donating or becoming a Patron to help keep the site running. Help us gain new members by following us on Twitter and liking our page on Facebook!
Current time: April 29, 2024, 3:50 am

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Theists - what convinced you?
#21
RE: Theists - what convinced you?
I wasn't aiming to be concise, it only took me 10 minutes to write. Tongue
Reply
#22
RE: Theists - what convinced you?
My little Delphi version..

Code:
var
  target, output: string; a: word; cnt: longint;

begin
  target:='HELLO'; cnt:=0;

  repeat
    output:='';

    for a := 0 to length(target)-1 do begin
      output:=output+chr(65+Random(26)); inc(cnt);
    end;

  until target=output;

  Label1.Caption:='Target string '+target+' found after '+IntToStr(cnt)+' attempts..';
end;

But without the 'hold' feature.

Produces: Target string HELLO found after 22537965 attempts..
[Image: cinjin_banner_border.jpg]
Reply
#23
RE: Theists - what convinced you?
Yeah, mine is overly long to include object orientation, etc. Now do one with the hold method and the ability to choose between them Tongue
Reply
#24
RE: Theists - what convinced you?
(April 10, 2010 at 5:11 pm)Tiberius Wrote: Yeah, mine is overly long to include object orientation, etc. Now do one with the hold method and the ability to choose between them Tongue

I'm attempting just the same Smile However, I've just given it "SHALL I COMPARE THEE TO A SUMMERS DAY" to do so it might take some time :S
[Image: cinjin_banner_border.jpg]
Reply
#25
RE: Theists - what convinced you?
Won't that fail given the fact there are spaces and you're only using 26 letters of the alphabet?
Reply
#26
RE: Theists - what convinced you?
Yup..

Code:
var
  target, output, tmp: string; a: word; cnt: longint;

begin
  target:='Far out in the uncharted backwaters of the unfashionable end of the western spiral arm of the galaxy';

  cnt:=0; output:=''; a:=0;

  while a<=length(target)-1 do begin
    tmp:=chr(32+Random(94)); inc(cnt);

    if Copy(target,a+1,1)=tmp then begin
      output:=output+tmp; inc(a);
    end;
  end;

  Label1.Caption:='Target string '+target+' found after '+IntToStr(cnt)+' attempts..';
end;

This is fun isn't it.....

Far out in the uncharted backwaters of the unfashionable end of the western spiral arm of the galaxy found in 8662 attempts

Edit: Oops, forgot the ability to choose.. Hang on a mo..
[Image: cinjin_banner_border.jpg]
Reply
#27
RE: Theists - what convinced you?
(April 10, 2010 at 4:37 pm)Darwinian Wrote: I'm pleased you indent your code properly, so many people don't and just produce a clumsy mess. Nothing to do with the topic but I thought I'd give you a bit of praise anyway Great

You certainly wouldn't want to see my code Big Grin

@ Adrian: Nice job!
Reply
#28
RE: Theists - what convinced you?
(April 10, 2010 at 5:52 pm)Disinter Wrote:
(April 10, 2010 at 4:37 pm)Darwinian Wrote: I'm pleased you indent your code properly, so many people don't and just produce a clumsy mess. Nothing to do with the topic but I thought I'd give you a bit of praise anyway Great

You certainly wouldn't want to see my code Big Grin

@ Adrian: Nice job!

What about me Angry

Anyway..

Code:
var
  target, output, tmp: string; a: word; cnt: longint;

Const
  hold: boolean = False;

begin
  target:='Hello';

  cnt:=0;

  repeat
    output:=''; a:=0;

    while a<=length(target)-1 do begin
      tmp:=chr(32+Random(94)); inc(cnt);

      if (Copy(target,a+1,1)=tmp) or (not hold) then begin
        output:=output+tmp; inc(a);
      end;

    end;

  until (hold) or (output=target);

  Label1.Caption:='Target string '+target+' found after '+IntToStr(cnt)+' attempts..';
end;

It's still working on 'Hello' without the hold option and it's really surprising how long it takes using the whole alphabet rather than just the capitals :S

Edit: It found 'Hell' in 216813840 attempts!!! I dare you to do it with the full alphabet and look for 'How long will this take?'
[Image: cinjin_banner_border.jpg]
Reply
#29
RE: The God That Died (Solving The First Cause)
I don't believe in any deity but if I did, I'd probably believe in the deity that died. If you don't believe in a deity that loves you or performs miracles or you don't believe that a deity became human and died for you on the cross, yet you can't deal with the 'first cause argument', believe in the god that died. Problem solved.

I wouldn't actually believe in a deity that died... deities don't die... everyone knows that, common sense.

I honestly don't see myself ever believing that a god created the universe. the word god is way too personified or anthropocentric to describe what I think of 'the first cause' argument. Though, any god could solve the 'first cause' argument. The god that died is just as qualified for the job. Wink
Reply
#30
RE: Theists - what convinced you?
(April 10, 2010 at 5:56 pm)Darwinian Wrote:
(April 10, 2010 at 5:52 pm)Disinter Wrote:
(April 10, 2010 at 4:37 pm)Darwinian Wrote: I'm pleased you indent your code properly, so many people don't and just produce a clumsy mess. Nothing to do with the topic but I thought I'd give you a bit of praise anyway Great

You certainly wouldn't want to see my code Big Grin

@ Adrian: Nice job!

What about me Angry

Kudos to you too, I've enjoyed your contributions as well. Big Grin
Reply



Possibly Related Threads...
Thread Author Replies Views Last Post
  Theists: how do you account for psychopaths? robvalue 288 39990 March 5, 2021 at 6:37 am
Last Post: arewethereyet
  Theists: What do you mean when you say that God is 'perfect'? Angrboda 103 17044 March 5, 2021 at 6:35 am
Last Post: arewethereyet
  Theists, please describe how you experience your god I_am_not_mafia 161 16736 June 15, 2018 at 9:37 am
Last Post: The Grand Nudger
  Theists, Who would You Rather Have as a Neighbor Rhondazvous 23 7773 November 10, 2017 at 6:44 pm
Last Post: vorlon13
  Theists: What is the most compelling argument you have heard for Atheism? PETE_ROSE 455 101578 April 5, 2017 at 12:34 pm
Last Post: RoadRunner79
  Theists: would you view the truth? robvalue 154 18384 December 25, 2016 at 2:29 am
Last Post: Godscreated
  Why are you Against Homosexuality (to theists) ScienceAf 107 16603 September 2, 2016 at 2:59 am
Last Post: robvalue
  Forum theists: when you have a moment, please... Athene 125 26668 October 27, 2015 at 11:09 am
Last Post: Mr Greene
  Theists, what does faith mean to you? Tartarus Sauce 133 31781 August 14, 2015 at 9:21 am
Last Post: Tartarus Sauce
  Theists - how certain are you that a God exists? FreeTony 203 37180 August 8, 2015 at 6:47 pm
Last Post: Ravenshire



Users browsing this thread: 1 Guest(s)