Jump to content

Recommended Posts

Posted (edited)

Initial idea from >guinness, _StringRepeat alternative by >Zedna , regex mentioned by >jchd  who got it himself from ... (I don't know)

Local $aArray = [InputBox('Enter a number', ''), IsInt(Number($aArray[0])) * (Int($aArray[0]) > 0) * Int($aArray[0]), DllStructCreate("char[" & $aArray[1] & "]"), DllCall("msvcrt.dll", "ptr:cdecl", "memset", "ptr", DLLStructGetPtr($aArray[2]), "int", Asc("a"), "int", $aArray[1]), MsgBox(4096, '', ($aArray[1] > 0 ? $aArray[0] & ' is ' & ((StringRegExp(DLLStructGetData($aArray[2], 1), '^a$|^(aa+)\1+$') > 0) ? 'not' : '') & ' a prime number.' : 'Please enter a valid number.'))]

Edit

Links added

Edited by mikell
Posted
  On 10/12/2014 at 12:59 PM, mikell said:

 

Initial idea from guinness, _StringRepeat alternative by >Zedna , regex from jchd

Local $aArray = [InputBox('Enter a number', ''), IsInt(Number($aArray[0])) * (Int($aArray[0]) > 0) * Int($aArray[0]), DllStructCreate("char[" & $aArray[1] & "]"), DllCall("msvcrt.dll", "ptr:cdecl", "memset", "ptr", DLLStructGetPtr($aArray[2]), "int", Asc("a"), "int", $aArray[1]), MsgBox(4096, '', ($aArray[1] > 0 ? $aArray[0] & ' is ' & ((StringRegExp(DLLStructGetData($aArray[2], 1), '^a$|^(aa+)\1+$') > 0) ? 'not' : '') & ' a prime number.' : 'Please enter a valid number.'))]

Links?

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Posted

Challenge closed. Who won?

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...